-
Notifications
You must be signed in to change notification settings - Fork 2
Migrating from chan_sip
chan_sofia is built to be a drop-in replacement for chan_sip. The public
compatibility surface — channel type, realtime family, CLI verbs, AMI actions
and dialplan functions — is deliberately preserved, so most systems switch with
a two-line change to modules.conf and no dialplan, realtime or AMI rewrite.
This page is the migration checklist. The full feature list is Features; the deep dive is Chan-Sofia.
chan_sofia and chan_sip are mutually exclusive — both register the SIP
channel type and the sippeers realtime family, so exactly one may be loaded.
In modules.conf:
noload => chan_sip.so
load => chan_sofia.soThen put the peer configuration in sofia.conf (the parser accepts
sip.conf-style [peer] blocks), and restart GABPBX so the active SIP driver
changes cleanly.
| Surface | chan_sip | chan_sofia |
|---|---|---|
| Channel type | SIP/<peer> |
SIP/<peer> (tech type SIP, channels/sofia/include/chan_sofia_internal.h:50) |
| Realtime family |
sippeers (+ sipregs) |
sippeers (+ sipregs), channels/chan_sofia.c:2921
|
| CLI |
sip show peers, sip show peer, sip show registry, sip reload, sip set debug, … |
same verbs, channels/sofia/sofia_cli.c
|
| AMI actions |
SIPpeers, SIPshowpeer, SIPqualifypeer, SIPshowregistry, SIPnotify
|
same actions, channels/sofia/sofia_ami.c
|
| Dialplan functions |
${SIPPEER()}, ${SIP_HEADER()}, ${SIPCHANINFO()}, ${CHECKSIPDOMAIN()}
|
same names, channels/chan_sofia.c:5789-6128
|
| Per-peer options |
host/context/secret/nat/allow/disallow/directmedia/qualify/… |
same vocabulary, channels/chan_sofia.c:2556-2910
|
Because the channel tech is SIP (not Sofia), every ${CHANNEL(...)}
consumer, CDR record and AMI event sees SIP/<peer> exactly as before.
-
directmedia/canreinvite— both accepted;canreinviteis the legacy alias. Keepdirectmedia=nountil RTP paths are proven. -
transport=— accepted for compatibility on a peer block (channels/chan_sofia.c:2905-2910). The actual transport a phone uses is learned from how it registered. -
nat=force_rport,comedia— the standard setting for NATed phones; drives in-dialog routing to the registered source and overrides the SDP RTP remote with the real source. -
insecure=invite— honored, and overridable byforce_invite_auth, which also raises an auditableInsecureInviteBypassAMI event.
DTMF handling matches chan_sip across every mode, so dtmfmode on a migrated
peer behaves as it did before:
-
dtmfmode—rfc2833,info,inbandandautoare all accepted.autois resolved at SDP commit: thetelephone-eventpayload is advertised only for RFC 2833 modes, and the negotiated mode is reflected in the channel's RTP DTMF property, so runtime behavior tracks the actual answer rather than the configured default. The DSP reconfigure done forautois fax-safe (CNG detection is preserved). - Inbound SIP
INFODTMF is parsed in both the named and numericSignalforms (for exampleSignal=10→*,Signal=11→#), including Flash. -
SIPDtmfMode()re-syncs the mode mid-call, andAST_OPTION_DIGIT_DETECTis honored — same dialplan behavior aschan_sip.
Registration follows RFC 3261 §10.3 per-Contact, like chan_sip: one AOR can
hold several simultaneous bindings (for example a desk phone and a browser), and
each Contact binds, refreshes and de-registers independently.
- Each Contact honors its own
;expires; a per-bindingexpires=0removes only that binding, and the200 OKreturns each binding's own expiry. -
sip show peer <name> detailreports per-binding state (AVAILABLE/EXPIRED/IN-CALL), which is useful for confirming which contacts are live during cutover. - A call to a peer whose bindings have all expired returns
CHANUNAVAILinstead of routing to a stale binding.
These are off by default unless configured, so a straight swap behaves like
chan_sip and you adopt the extras when ready:
- SIP Outbound (RFC 5626), Path (RFC 3327), Service-Route (RFC 3608), GRUU.
- Outbound PUBLISH, generic outbound SUBSCRIBE, outbound MWI watcher.
- SHA-256 digest auth, mutual TLS, TLS hardening, the local SIP blacklist.
- WebRTC (DTLS-SRTP + ICE-lite, audio and video) — see WebRTC.
- Per-call SIP history with verbose call analysis.
See Features for each, with its source location.
- Move (or write) peer blocks into
sofia.conf; thesip.confper-peer vocabulary loads unchanged. - If you use realtime, point the
sippeersfamily at the same table;sipregsis auto-detected if present. - Confirm
[general]bind ports (bindport,tlsbindport, and for browserswssbindport) are what you expect — these are baked in at load and asip reloadwill refuse a change to them. -
noload chan_sip.so+load chan_sofia.soand restart GABPBX. - Verify with
sip show settings,sip show peers, andsip show peer <name>(registrations, contacts, codecs, NAT, call counters). - Watch AMI registration and security events during cutover.
- Adopt the new features (TLS, SRTP, WebRTC, history) once the basic call path is proven.
- Use strong secrets; disable guest calls unless required.
- Set the correct external address and
localnet. - Use
nat=force_rport,comediafor NATed phones. - Keep
directmedia=nountil RTP paths are proven. - Set call limits for trunks and shared accounts; disable transfers on untrusted trunks.
- Enable TLS/SRTP/WebRTC only after certificates and endpoint support are verified.
- After editing
sofia.confas root, restore ownership (chown gabpbx:gabpbx /etc/gabpbx/sofia.conf).
SIP — chan_sofia
Subsystems
Realtime & data
Operations