Home / Training / Lesson 2
VoIP Training · Lesson 2 of 10

SIP fundamentals: call flow, SDP, RTP, codecs and NAT

How a SIP call is set up and torn down, what SDP and RTP do, how G.711 and G.729 differ, and why NAT causes audio problems.

By VoxComms · · 4 min read

Almost every wholesale VoIP call today is set up with SIP — the Session Initiation Protocol. SIP does not carry the voice itself; it is the signalling that sets up, changes and ends calls. The voice travels separately in RTP packets. Reading SIP confidently is the single most useful technical skill in a VoIP NOC.

SIP in one paragraph

SIP is a text-based request/response protocol, a bit like HTTP. One side sends a request (such as INVITE), the other answers with responses that have three-digit codes. Codes in the 1xx range are provisional (“working on it”), 2xx means success, 3xx redirection, 4xx a client or request problem, 5xx a server problem and 6xx a global failure.

A normal call, step by step

Carrier A (192.0.2.10) Vendor X (192.0.2.20) INVITE (with SDP offer)100 Trying180 Ringing or 183 Session Progress(caller hears ringback — nothing billed yet)200 OK (with SDP answer) — billing startsACKRTP voice in both directionsBYE200 OK — billing stops
A successful call. Addresses are from the 192.0.2.0/24 documentation range.
  1. INVITE – the calling side asks to set up a call. The request line contains the dialled number, and the body contains an SDP offer describing how the caller wants to receive audio.
  2. 100 Trying – the next hop confirms it received the INVITE and is working on it. It stops the sender from retransmitting.
  3. 180 Ringing or 183 Session Progress – the destination is being alerted. 180 tells the caller’s side to play its own ringback tone; 183 usually comes with SDP so the caller hears “early media” from the network (ringback, announcements) before answer.
  4. 200 OK – the called party answered. It carries the SDP answer. This is the moment billing starts.
  5. ACK – the caller confirms it received the 200 OK. The call is now established.
  6. RTP – voice packets flow in both directions, directly between the media addresses agreed in SDP.
  7. BYE – either side hangs up. The other side replies 200 OK and billing stops.

If a call fails, instead of 200 OK you see a final error response (for example 486 Busy Here), which the caller acknowledges with an ACK. Lesson 9 covers the common error codes.

Headers you will read every day

SDP: describing the media

The Session Description Protocol body inside INVITE and 200 OK says where to send audio and how to encode it. A minimal example with documentation addresses:

c=IN IP4 192.0.2.10
m=audio 49170 RTP/AVP 18 0 101
a=rtpmap:18 G729/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

The c= line is the IP address for media, m= gives the RTP port and the list of codecs offered in order of preference, and the rtpmap lines name them. Payload 101 here is used for DTMF tones. The answering side picks codecs from the offer and returns its own address and port.

RTP: the voice itself

RTP (Real-time Transport Protocol) carries small packets of audio, typically one packet every 20 milliseconds per direction. Each packet has a sequence number and timestamp, which lets the receiver detect loss and smooth out timing differences (jitter). RTP normally runs over UDP, so lost packets are not resent — for live voice, a late packet is as useless as a lost one.

Codecs: G.711 and G.729

Both sides must agree on at least one common codec. If they cannot, the call fails (often with 488 Not Acceptable Here). When one leg uses G.711 and the other G.729, something in the middle must transcode, which costs processing power.

NAT: why audio sometimes goes missing

Many devices sit behind NAT (Network Address Translation): they use a private address internally and a public address on the internet. SIP is awkward with NAT because the private address can end up written inside the SIP headers and SDP. The far end then sends audio to an address it cannot reach, and you get one-way or no audio.

Common fixes include configuring the device to advertise its public address, enabling NAT handling (“media proxy” or “symmetric RTP”) on the softswitch so it sends audio back to where packets actually came from, and making sure firewalls allow the RTP port range. Lesson 9 walks through a one-way audio case.

Practical tips for reading traces

Key takeaways

  • SIP is signalling only; the voice travels separately in RTP packets.
  • A normal call: INVITE, 100, 180/183, 200 OK (billing starts), ACK, media, BYE, 200 OK.
  • SDP in INVITE and 200 OK says where to send audio and which codecs are allowed.
  • G.711 gives the best quality with more bandwidth; G.729 saves bandwidth with slightly lower quality.
  • Private addresses in SIP/SDP behind NAT are the classic cause of one-way or no audio.

Quick quiz

1. Which SIP response marks the moment billing starts?

200 OK to the INVITE (the answer).

2. What is the difference between 180 Ringing and 183 Session Progress?

180 asks the caller side to generate its own ringback; 183 usually carries SDP so the caller hears early media from the network.

3. Which part of the SDP tells the other side where to send audio?

The c= line (connection address) together with the port in the m= line.

Related reading

Examples in this course use invented names (Vendor X, Customer Y, Country Z) and documentation IP ranges. Menu names and options differ between softswitch versions; always check your own system and vendor documentation.