Skip to main content

SIP Trunking

This document covers SIP peer configuration, OPTIONS keepalive monitoring, SDP codec negotiation, in-dialog re-INVITE handling, mid-call services (hold/resume, REFER transfer, UPDATE refresh), session timers, DTMF relay, and SIP trunk call states in OmniMSC.

For SIP-related routing, see Routing Configuration. For SIP with encapsulated ISUP, see SIP-I Trunking. For SIP trunk troubleshooting, see Troubleshooting Guide. For call flow sequences showing SIP signaling in context, see Call Flow Diagrams. For media gateway codec negotiation, see Media Control. For SIP peer configuration parameters, see Configuration Reference.


SIP Peer Configuration​

Each SIP peer represents a remote endpoint such as a VoIP gateway, SBC, IMS node, or SIP trunking provider. Peers are defined in the :sip configuration block and referenced by name in the route table.

ParameterTypeDefaultDescription
namestring-- (required)Logical peer name. Referenced in route table entries.
addressstring-- (required)Peer IP address or hostname.
portinteger5060Peer SIP port.
transportatom:udpTransport protocol: :udp, :tcp, or :tls.
codecslist(atom)[:pcmu, :pcma]Supported audio codecs for SDP negotiation.
max_channelsinteger100Maximum concurrent calls to this peer.
options_intervalinteger or nilnilInterval in seconds for SIP OPTIONS keepalive probes.

OmniMSC identifies itself with the User-Agent header OmniMSC/0.1 in all outgoing SIP requests and responses.


SIP OPTIONS Keepalive​

When options_interval is configured for a peer, the SIP Peer Manager sends periodic SIP OPTIONS requests to monitor peer health. The peer status determines whether the peer is eligible for call routing.

Peer Health States​

Each peer tracks a status of :up, :down, or :unknown. On startup, all peers begin in the :unknown state.

EventTransitionEffect
OPTIONS 200 OK receivedAny -> upPeer eligible for routing
Consecutive OPTIONS timeoutsup/unknown -> downPeer excluded from routing, alarm raised
OPTIONS 200 OK after downdown -> upPeer re-eligible, alarm cleared
max_channels reachedup -> up (soft limit)New calls rejected for this peer, existing calls unaffected

For SIP peer monitoring in the control panel, see Control Panel Guide.


MO Call SIP Flow​

When OmniMSC routes a mobile-originating call to a SIP peer, the following SIP signaling exchange takes place between OmniMSC and the remote peer.

The INVITE carries an SDP offer with codecs based on the peer configuration and BSC capabilities. The 200 OK contains the SDP answer with the selected codec and remote RTP address. After ACK, the RTP media path is established through the media gateway.


In-Dialog Re-INVITE Handling​

A SIP peer may send a re-INVITE within an established dialog for several purposes: call hold, resume, codec change, or session refresh. OmniMSC accepts any in-dialog re-INVITE with a 200 OK using the current session SDP. If the re-INVITE carries an SDP body, the remote SDP is updated from it.

The re-INVITE is answered the same way regardless of purpose (200 OK with the current session SDP). OmniMSC does not send 488 Not Acceptable Here in response to a re-INVITE, and does not renegotiate the codec on a re-INVITE. The existing dialog and media session remain in place. In addition, OmniMSC inspects the offered SDP for a hold/resume transition and signals it to the Call Control (CC) FSM (see Mid-Call Services below).


Mid-Call Services​

OmniMSC handles three in-dialog mid-call procedures on an established SIP trunk leg: call hold/resume, REFER call transfer, and UPDATE session refresh. All three apply only in the active call state; requests received outside active are ignored or rejected as appropriate.

Call Hold and Resume​

A remote peer places the call on hold by sending a re-INVITE (or UPDATE) whose SDP marks the media stream as inactive. OmniMSC recognises both the modern and the legacy hold encodings (RFC 3264 section 5.1, TS 29.163 Annex B):

Hold encodingSDP markerNotes
Direction attributea=sendonly or a=inactivePreferred (RFC 3264). Media-level attribute overrides session-level
Zeroed connectionc=0.0.0.0Legacy RFC 2543 hold offer
Resumea=sendrecv (or no direction attribute) and a non-zero c=Returns the stream to active

On a transition into hold, OmniMSC answers 200 OK and signals hold_ind to the CC FSM; the FSM marks the call held and propagates the condition toward the mobile station (a NOTIFY with a remote-hold indicator) and the MNCC layer. On a transition back to active, retrieve_ind is signalled and the held state is cleared. Repeated offers with an unchanged direction (for example a session refresh that keeps the call held) are idempotent and do not re-signal a transition.

REFER Call Transfer (RFC 3515)​

A peer can transfer the call by sending an in-dialog REFER whose Refer-To header names the transfer target. OmniMSC accepts the REFER with a 202 Accepted (establishing the implicit refer event subscription), reports the transfer to the CC FSM as an ECT (Explicit Call Transfer, TS 24.091) indication carrying the Refer-To URI, and reports progress back to the transferor through sipfrag NOTIFY messages (RFC 3515 section 2.4.5). A REFER without a usable Refer-To is rejected with 400 Bad Request.

The progress NOTIFYs carry a message/sipfrag body with the status line of the far-leg transaction and a Subscription-State header:

NOTIFYsipfrag bodySubscription-State
ProgressSIP/2.0 100 Tryingactive
CompletionSIP/2.0 200 OKterminated;reason=noresource

Session Timer (RFC 4028)​

OmniMSC supports SIP session timers per RFC 4028 to detect and clean up orphaned SIP sessions. Session timers ensure that both endpoints periodically refresh the session, preventing stale call state after network failures.

ParameterValueDescription
Session-Expires1800s (default)Maximum time between session refreshes
Min-SE90sMinimum acceptable Session-Expires value
RefresherUAC or UASDetermined during negotiation
session_refresh_method:invite (default) or :updateMethod used to send the periodic refresh

Session Timer Negotiation​

OmniMSC includes the Session-Expires and Min-SE headers in outgoing INVITE requests. When OmniMSC receives a 422 Session Interval Too Small in response to an outgoing INVITE, it acknowledges the 422, extracts the peer's Min-SE, and retries the INVITE with an updated Session-Expires that is at least the peer's minimum.

The refresh is sent at half the negotiated Session-Expires interval. If no refresh arrives before the session expires, OmniMSC sends BYE to tear down the call and releases all associated resources.

Refresh Method: re-INVITE or UPDATE (RFC 3311)​

By default the refresh is sent as a re-INVITE. When a trunk is configured with session_refresh_method: :update, OmniMSC refreshes the session with an UPDATE (RFC 3311) instead. UPDATE is lighter-weight: it is a standalone transaction that does not disturb the offer/answer and requires no ACK. An UPDATE 200 OK is therefore never acknowledged, whereas a re-INVITE 200 OK is ACKed as usual.

OmniMSC also answers a peer-initiated UPDATE. When the UPDATE carries an SDP offer, OmniMSC echoes its current SDP as the answer; the 200 OK advertises the negotiated Session-Expires. An UPDATE carrying a hold offer drives the same hold/resume signalling to the CC FSM as a re-INVITE.


DTMF Relay​

OmniMSC relays DTMF tones using SIP INFO messages per the application/dtmf-relay content type. This method is used when the peer does not support RFC 2833 telephone-event RTP payload or when out-of-band DTMF is preferred.

FieldDescriptionExample
Content-TypeMIME type for DTMF relayapplication/dtmf-relay
SignalDTMF digit (0-9, *, #, A-D)Signal=5
DurationTone duration in millisecondsDuration=160

When DTMF events are detected from the radio side (via the media gateway), OmniMSC generates a SIP INFO message toward the SIP peer with the corresponding signal and duration. In the reverse direction, incoming SIP INFO DTMF events are forwarded to the media gateway for playout toward the mobile station.


SDP Codec Negotiation​

OmniMSC generates SDP offers based on the intersection of the peer's configured codec list and the BSC-reported speech codec capabilities. Codecs are offered in preference order.

Supported Codecs​

CodecRTP Payload TypeClock Ratefmtp Parameters
PCMU08000--
PCMA88000--
AMR (narrowband)dynamic (96)8000octet-align=1
AMR-WB (wideband)dynamic (97)16000octet-align=1

The default codec list is [:pcmu, :pcma] (PCMU payload 0 and PCMA payload 8). AMR is offered with octet-align=1 (RFC 4867) for interoperability with 3GPP access networks. The GSM full-rate speech version maps to PCMA (payload 8) on the SIP side. AMR and AMR-WB are offered when the BSC indicates support for these codecs in the speech version list during assignment.

Codec Selection​

The codec selection follows the SDP Offer/Answer model (RFC 3264):

  1. OmniMSC builds the SDP offer from the peer codec list, filtered by BSC speech capabilities.
  2. The remote peer responds with an SDP answer containing one or more accepted codecs.
  3. OmniMSC selects the first common codec from the original offer order.
  4. The media gateway is instructed (via MDCX) with the selected codec and RTP parameters.

If no common codec exists, OmniMSC responds with or receives 488 Not Acceptable Here.


SIP Trunk Call States​

Outgoing Call States​

Incoming Call States​


References​

ReferenceTitleRelevance
RFC 3261SIP: Session Initiation ProtocolCore SIP signaling
RFC 4028Session Timers in SIPSession-Expires, Min-SE, refresh mechanism
RFC 3311The SIP UPDATE MethodUPDATE-based session refresh
RFC 3515The SIP Refer MethodREFER call transfer, sipfrag NOTIFY progress
RFC 2833RTP Payload for DTMF DigitsTelephone-event RTP payload type
RFC 3264Offer/Answer Model with SDPSDP codec negotiation, hold/resume markers
RFC 4867RTP Payload Format for AMR and AMR-WBAMR octet-align parameter
RFC 3326Reason Header FieldCause code in BYE/CANCEL
TS 29.163Interworking between IMS and CS networksAnnex B: hold/resume interworking