A follow up to the first introduction to SIP presentation. An in-depth look into SIP:
- Understanding Headers
- Sticky proxies
- BLF (Busy Lamp Field)
- Troubleshooting
Presentation given during the weekly FreeSWITCH Conference Call.
Ini1a1on Protocol – Nego1ates a session, or a connec1on, between two par1es – Mostly consists of connec1on headers (things that wouldn’t prac1cally work or fit in binary TCP/UDP headers) – Can op1onally offer payloads with the connec1on headers (SDP) – RFC 3261 • Session Descrip1on Protocol – SDP is Separate from SIP – Offer / Answer Model – RFC 3264 Understanding SIP
To: <sip:[email protected]> Contact: <sip:[email protected]:1234> Call-‐ID: 490dffec2cafa2772a11eec8716e CSeq: 102 INVITE User-‐Agent: 2600hz Max-‐Forwards: 30 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE Content-‐Type: applica1on/sdp Content-‐Length: 180 v=0 s=session c=IN IP4 67.231.8.9 m=audio 35918 RTP/AVP 0 18 8 3 101 a=rtpmap:101 telephone-‐event/8000 Sample SIP Packet This is SIP (Describes Connection – i.e. how to get from point A to point B) This is SDP (Describes Content)
– How these work with proxies – How proxies are supposed to behave – How FreeSWITCH uses these headers – RFC 3261 • No1fy, Subscribe, BLF, MWI – SDP is Separate from SIP – Offer / Answer Model – RFC 3265 Understanding SIP
Sample Via: SIP/2.0/UDP 57.230.8.195;branch=z9hG4f Via: SIP/2.0/UDP 57.230.8.89;branch=z9hG42 Via: SIP/2.0/UDP 57.230.0.81:5060;branch=z9hG49 • Notes – Via Headers are manipulated (added/removed) as they go – Request URI is not manipulated (nor is rest of packet) – The response is sent back using the top Via: – Each server removes itself from the Via: header on a match – When any UA gets a SIP response, there should only be 1 Via Via
2 -‐-‐-‐-‐-‐> Server Via: Phone Via:Proxy1 Via:Proxy2 Via:Phone Via:Proxy1 Via:Phone As the packet traverses from the phone to the server it traverses two proxies • Phone adds itself as a Via: • Each proxy adds itself to the Via: header Via
2 <-‐-‐-‐-‐-‐ Server Via: Phone Via:Proxy1 Via:Proxy2 Via:Phone Via:Proxy1 Via:Phone Packet traverses from server to phone via same two proxies • Each proxy REMOVES itself from Via: Via: headers are required for each hop, by all devices Via
use them Record-‐Route: <sip:57.230.8.89:5060;lr;oag=19QNr566rKH3B> Record-‐Route: <sip:57.230.8.195:5060;lr;oag=19QNr566rKH3B> • These proxies want to stay in the path for all future signaling • Will be kept by each user agent for the dura1on of this dialog • Will be converted into “Route:” headers for new requests – Flipped Order! Record-‐Route
Route: <sip:57.230.8.195:5060;lr;oag=19QNr566rKH3B> Route: <sip:57.230.8.89:5060;lr;oag=19QNr566rKH3B> • Usually in response to new requests and old Request-‐Route • This strategy allows for stateless rou1ng of many many calls – Most of the rou1ng informa1on is kept in the packet – Only first and last endpoint must “remember” things – Offloads work to calling devices – Can be manipulated Route
rou1ng via specific proxies – Used by 3GPP implementa1on Path solves the problem of differing routes inbound/outbound From the RFC: 1) Path applies to REGISTER and responses to REGISTER. Record-‐Route doesn't. 2) Path is direc1onal and starts at the node origina1ng the Path header and is "learned" by the node receiving the Path header. 3) The Path header is a unidirec1onal opera1on. Path
– Can be difficult to troubleshoot – Tags and parsing is done differently by different devices – See lots of failures due to unknown chars or tags Packet Size! – We see this the most as carriers interop more and more – Packets can become too large – People then try to 1nker with them without knowledge • Break them Problems w/ Rou1ng
a service – Can be MWI – Can be Presence (BLF) – Can be Fax – Can be anything, really • Different defini1ons of services: hup://www.iana.org/assignments/sip-‐ events/sip-‐events.xml SUBSCRIBE
you’re sending the right stuff • You can trace by Call-‐ID! • Oversized packets! • Lost Packets! Hint: TCP can be handy for problema1c clients here Troubleshoo1ng