Wings Client — BSNL Wings SIP Client for Go

Overview

Wings Client is a Go library that enables VoIP calling through BSNL’s Wings infrastructure. It handles the full SIP signaling and RTP audio pipeline, then exposes a WebSocket API so any voice AI application can plug in — including Python-based Pipecat agents — without needing to touch telephony internals.

The Problem

BSNL Wings is India’s only internet-based calling service using government infrastructure, offering free domestic calls over SIP/IMS. But the protocol is poorly documented, and there’s no open-source Go client that handles the full INVITE/ACK/BYE flow with proper digest auth against BSNL’s IMS servers. This library fills that gap.

Technical Approach

SIP Signaling

The library implements automatic SIP digest authentication with BSNL’s IMS servers and manages the complete call lifecycle:

  • REGISTER with digest authentication
  • INVITE with SDP offer/answer negotiation
  • ACK / BYE for clean call setup and teardown
  • Re-registration and keepalive handling

Built on top of the sipgo library, with BSNL-specific quirks handled transparently.

RTP Audio Pipeline

Once a call is established, the library manages bidirectional RTP audio:

  • 8kHz, 16-bit PCM (G.711 μ-law / a-law compatible)
  • Jitter buffer and packet sequencing
  • Low-latency streaming to keep conversational AI feel natural

WebSocket Bridge

The real power is the WebSocket API. Any client that connects to ws://localhost:8080/ws receives raw audio frames and can send audio back, with JSON control messages for call state changes. This makes it trivial to connect voice AI systems.

BSNL IMS (SIP/RTP)
       │
wings-client (Go)
       │
  WebSocket API
       │
 Pipecat / any voice AI

Voice AI Integration

The library ships with a pre-configured Pipecat bot that demonstrates a full voice AI call flow:

  • Silero VAD for voice activity detection
  • OpenAI GPT-4o for conversation
  • ElevenLabs for TTS
  • Open-Meteo weather tool as a sample function call

Technical Highlights

  • Zero-config auth — just supply your Wings SIP credentials
  • Native Pipecat transport — implements the Pipecat WebSocket transport protocol directly
  • Debug toolingsngrep integration for SIP trace capture, structured logging throughout
  • Health endpoint at http://localhost:8080/health for process monitoring
  • MIT licensed — production-usable without restrictions

Use Cases

  • Automated outbound calling bots (appointment reminders, alerts)
  • Conversational voice AI over Indian phone numbers at near-zero cost
  • SIP protocol research and debugging against BSNL’s IMS stack
  • Integration testing for VoIP-dependent applications

Status: ActivePlatform: Go 1.21+License: MIT

Updated: