sip_helper library
A lightweight SIP/VoIP library for Dart.
Provides SIP protocol signaling (UDP), RTP audio transport, G.711 A-law (PCMA) codec, and Windows native audio via WinMM FFI.
import 'package:sip_helper/sip_helper.dart';
final sip = SipHelper.instance;
await sip.initialize(SipConfiguration(
server: 'pbx.example.com',
username: '1001',
password: 'secret',
));
await sip.connect();
Classes
- AudioLevelService
- Tracks real-time audio levels from mic input and speaker output. Provides normalized 0.0-1.0 levels for UI visualization.
- AudioPlayerService
- Real-time audio playback service for VoIP calls.
- CallInfo
- Call information model for SIP calls
- MicrophoneService
- Microphone capture service for VoIP calls.
- PcmaDecoder
- PCMA (G.711 A-law) decoder — ITU-T G.711 standard Converts A-law compressed audio to 16-bit linear PCM
- PcmaEncoder
- PCMA (G.711 A-law) encoder Converts 16-bit PCM to A-law compressed audio
- RtpSession
- Native RTP audio handler without WebRTC. Handles plain RTP/AVP audio for Asterisk compatibility.
- SipCall
- Active call information
- SipConfiguration
- SIP configuration model
- SipHelper
- Orchestrator service that wires together SIP signaling, RTP audio, microphone capture, audio playback, and sound effects into a single API.
- SoundService
- Generates and plays ringing, ringback, DTMF, and voice audio.
- UdpSipClient
- Custom UDP SIP client for native UDP communication with Asterisk chan_sip
- WAVEFORMATEX
- WAVEHDR
- WinAudioDevices
- WinAudioPlayer
- WinAudioRecorder
Enums
- CallDirection
- Call direction
- CallState
- Call state enum
- RingTone
- Available ring tone styles
Properties
- sipLogger ↔ SipLogCallback?
-
Global logger. Set this to receive log output from sip_helper.
Example:
sipLogger = print;getter/setter pair
Typedefs
- SipLogCallback = void Function(String message)
- Log callback type for sip_helper package.