SIP Fundamentals
SDP (Session Description Protocol)
SDP (RFC 8866) is the body format inside a SIP INVITE that describes the offered media: codecs, IP addresses, ports, encryption, DTMF mode. It uses a simple line-oriented key=value syntax.
Annotated example
v=0 # protocol version o=- 12345 1 IN IP4 192.0.2.1 # origin: session-id, version, address s=- # session name (often empty) c=IN IP4 192.0.2.1 # connection: where to send media t=0 0 # timing (0 0 = unbounded) m=audio 16384 RTP/AVP 0 8 9 101 # media: type, port, profile, payload-types a=rtpmap:0 PCMU/8000 # PT 0 = G.711 mu-law a=rtpmap:8 PCMA/8000 # PT 8 = G.711 A-law a=rtpmap:9 G722/8000 # PT 9 = G.722 wideband a=rtpmap:101 telephone-event/8000 # PT 101 = RFC 4733 DTMF a=fmtp:101 0-16 # DTMF events 0-16 supported a=sendrecv # bidirectional
Offer/Answer
RFC 3264 defines the offer/answer model: the caller sends an SDP offer in INVITE; the callee replies with a refined SDP answer in 200 OK. The answer must intersect the offer's codec list (it cannot add new codecs).
Common SDP issues
- Codec mismatch: caller offers only Opus, callee only does G.711 →
488 Not Acceptable Here. - Wrong c= line: private IP in c= breaks media behind NAT — see NAT traversal.
- DTMF mismatch: in-band vs RFC 4733 vs SIP INFO. Use a=rtpmap:101 telephone-event/8000 unless you have a strong reason.
Related terms
Ready to get a number?
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.