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. 8201@iptel.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 xxx@ 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)

  • Maintain the status of every peer. (peer’s register status, ip address, port, and etc)
  • Introducer.

–      A wants to call B(A is 100@iptel.org, B is 200@iptel.org)

–      A initials the request to iptel.org, who should know if 200@iptel.org is registered and online, if so, forward the request to B, and forward B’s response to A.

–      If 200@iptel.org 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.

  • Outbound Proxy.

–      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)

  1. Router/TA sends register packet.
  2. Sip server returns ‘200 OK’
  3. Register succeed!

Type 2 (With authentication)

  1. Router/TA sends register packet.
  2. Sip server returns ‘401 Unauthorized’
  3. Router/TA sends register packet again with username and password
  4. Sip server returns ‘200 OK’
  5. Register succeed!

Sample Log