An Introduction to SIP and debug logs
Posted by on 25 January 2012 11:06 AM
What is SIP
Session Initiation Protocol (SIP) is a signaling protocol, used to set up a VOIP call over the Internet.
– It’s just used to initiate a session.
– Based on HTTP protocol, it is an easy to read protocol.
– Use URI (Uniform Resource Identifier) to identify peers, SIP URI use the same form as email address, e.g. firstname.lastname@example.org.
– In VoIP application, SIP is used to establish the VoIP connection.
– In VoIP application, most VoIP issue happens in SIP phase.
SIP supports peer-to-peer direct calling and also calling via a SIP proxy server
After a call is setup, the voice streams transmit via RTP (Real-Time Transport Protocol). Different codecs (methods to compress and encode the voice) can be embedded into RTP packets.
Ways to Make SIP calls
1: Peer to peer call (No need to register)
Before calling, you have to know your friend’s IP Address. For example A knows B’s IP address/DDNS name and phone number. Use email@example.com to call.
2: Call through SIP server
User A only knows User B’s sip URL address. SIP server will introduce B to A.
The standard format of SIP URI is sip: user:password @ host: port
Role of SIP Server (Registrar)
– A initials the request to iptel.org, who should know if firstname.lastname@example.org is registered and online, if so, forward the request to B, and forward B’s response to A.
– If email@example.com is not online, maybe respond to A a busy tone, or redirect A’s call to voice mail.
– After the session negotiation, A and B knows each other(IP address and port), A talks with B directly.
– A and B don’t send voice traffic to each other directly, instead, they send the traffic to the proxy, then proxy will send the traffic to the other end.
VoIP issues can be diagnosed by examining the readable SIP messages.
SIP Registration Process
Type 1 (No authentication)
Type 2 (With authentication)