The Session Initiation Protocol (SIP) is an IETF-defined signaling protocol widely used for controlling communication sessions such as voice and video calls over IP. The protocol can be used for creating, modifying and terminating two-party or multiparty sessions. Sessions may consist of one or several media streams.
The SIP protocol is an Application Layer protocol designed to be independent of the underlying Transport Layer; it can run on TCP, UDP and SCTP. It is a text-based protocol, incorporating many elements of the HTTP and SMTP.
Other SIP applications include video conferencing, streaming multimedia distribution, instant messaging, and presence information and file transfer. The Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions (SIMPLE) is the SIP-based suite of standards for instant messaging and presence information. MSRP (Message Session Relay Protocol) allows instant message sessions and file transfer.
The SIP protocol is an Application Layer protocol designed to be independent of the underlying Transport Layer; it can run on TCP, UDP and SCTP. It is a text-based protocol, incorporating many elements of the HTTP and SMTP.
Other SIP applications include video conferencing, streaming multimedia distribution, instant messaging, and presence information and file transfer. The Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions (SIMPLE) is the SIP-based suite of standards for instant messaging and presence information. MSRP (Message Session Relay Protocol) allows instant message sessions and file transfer.
Network elements
SIP also defines server network elements. Although two SIP endpoints can communicate without any intervening SIP infrastructure, which is why the protocol is described as peer-to-peer, this approach is often impractical for a public service.
User Agent
A SIP user agent (UA) is a logical network end-point used to create or receive SIP messages and thereby manage a SIP session. A SIP UA can perform the role of a User Agent Client (UAC), which sends SIP requests, and the User Agent Server (UAS), which receives the requests and returns a SIP response.
Proxy server
An intermediary entity that acts as both a server (UAS) and a client (UAC) for the purpose of making requests on behalf of other clients. A proxy server primarily plays the role of routing, which means its job is to ensure that a request is sent to another entity "closer" to the targeted user. Proxies are also useful for enforcing policy (for example, making sure a user is allowed to make a call). A proxy interprets, and, if necessary, rewrites specific parts of a request message before forwarding it.
Registrar
A server that accepts register requests and places the information it receives in those requests into the location service for the domain it handles which registers one or more IP addresses to a certain SIP URI, indicated by the sip: scheme, although other protocol schemes are possible (such as tel:). More than one user agent can register at the same URI, with the result that all registered user agents will receive a call to the SIP URI.
Redirect server
A user agent server that generates 3xx (Redirection) responses to requests it receives, directing the client to contact an alternate set of URIs. The redirect server allows proxy servers to direct SIP session invitations to external domains.
SIP messages
SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a method, defining the nature of the request, and a Request-URI, indicating where the request should be sent. The first line of a response has a response code.
- REGISTER: Used by a UA to indicate its current IP address and the URLs for which it would like to receive calls.
- INVITE: Used to establish a media session between user agents.
- ACK: Confirms reliable message exchanges.
- CANCEL: Terminates a pending request.
- BYE: Terminates a session between two users in a conference.
· OPTIONS: Requests information about the capabilities of a caller, without setting up a
- Provisional (1xx): Request received and being processed. Like 100 for Trying, and 180 for Alerting.
- Success (2xx): The action was successfully received, understood, and accepted. Like 200 for OK, and 202 for Accepted.
- Redirection (3xx): Further action needs to be taken (typically by sender) to complete the request. Like 301 for Moved Permanently and 302 for Moved Temporarily
- Client Error (4xx): The request contains bad syntax or cannot be fulfilled at the server. Like 404 User Not Found and 480 Temporarily Unavailable
- Server Error (5xx): The server failed to fulfill an apparently valid request. Like 500 for Server Internal Error or 503 for Service Unavailable
- Global Failure (6xx): The request cannot be fulfilled at any server. Like 603 when the call is declined
Class of Response | Status Code | Explanation |
Informational/provisional | 100 | Trying |
180 | Ringing | |
181 | Call Is Being Forwarded | |
182 | Queued | |
183 | Session Progress | |
Success | 200 | OK |
Redirection | 300 | Multiple Choices |
301 | Moved Permanently | |
302 | Moved Temporarily | |
305 | Use Proxy | |
380 | Alternative Service | |
Client-error | 400 | Bad Request |
401 | Unauthorized | |
402 | Payment Required | |
403 | Forbidden | |
404 | Not Found | |
405 | Method Not Allowed | |
406 | Not Acceptable | |
407 | Proxy Authentication Required | |
408 | Request Timeout | |
410 | Gone | |
413 | Request Entity Too Large | |
414 | Requested URL Too Large | |
415 | Unsupported Media Type | |
416 | Unsupported URI1 Scheme | |
420 | Bad Extension | |
421 | Extension Required | |
423 | Interval Too Brief | |
480 | Temporarily Not Available | |
481 | Call Leg or Transaction Does Not Exist | |
482 | Loop Detected | |
483 | Too Many Hops | |
484 | Address Incomplete | |
485 | Ambiguous | |
486 | Busy Here | |
487 | Request Terminated | |
488 | Not Acceptable Here | |
491 | Request Pending | |
493 | Undecipherable | |
Server-error | 500 | Internal Server Error |
501 | Not Implemented | |
502 | Bad Gateway | |
503 | Service Unavailable | |
504 | Server Timeout | |
505 | SIP Version Not Supported | |
513 | Message Too Large | |
Global failure | 600 | Busy Everywhere |
603 | Decline | |
604 | Does Not Exist Anywhere | |
606 | Not Acceptable |
SIP Trunk configuration on Cisco Voice Gateway
!
voice service voip
ip address trusted list
ipv4 0.0.0.0 0.0.0.0
allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
supplementary-service h450.12
no supplementary-service sip moved-temporarily
no supplementary-service sip refer
sip
registrar server expires max 3600 min 3600
outbound-proxy ipv4:xxx.xxx.xxx.xxx:5060
ip address trusted list
ipv4 0.0.0.0 0.0.0.0
allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
supplementary-service h450.12
no supplementary-service sip moved-temporarily
no supplementary-service sip refer
sip
registrar server expires max 3600 min 3600
outbound-proxy ipv4:xxx.xxx.xxx.xxx:5060
--- SIP UA Configuration ---
sip-ua
keepalive target ipv4:xxx.xxx.xxx.xxx:5060
authentication username xxxxxxx password 7 xxxxxx
no remote-party-id
retry invite 2
retry register 10
timers connect 100
timers keepalive active 10
sip-server ipv4:4.xxx.xxx.xxx:5060
host-registrar
!
voice class codec 1
codec preference 1 g711ulaw
!
--- SIP Trunk Configuration ---
keepalive target ipv4:xxx.xxx.xxx.xxx:5060
authentication username xxxxxxx password 7 xxxxxx
no remote-party-id
retry invite 2
retry register 10
timers connect 100
timers keepalive active 10
sip-server ipv4:4.xxx.xxx.xxx:5060
host-registrar
!
voice class codec 1
codec preference 1 g711ulaw
!
--- SIP Trunk Configuration ---
dial-peer voice 100 VoIP
permission term
description ** Incoming call from SIP trunk (Level 3) **
session protocol sipv2
session target sip-server
incoming called-number .%
voice-class codec 1
voice-class sip dtmf-relay force rtp-nte
dtmf-relay rtp-nte
no vad
!
Dial-peer voice 101 VoIP
Description ******outgoing call to SIP trunk******
Destination-pattern 9.T
Session protocol sipv2
Session target sip-server
Voice-class codec 1
voice-class sip dtmf-relay force rtp-nte
dtmf-relay rtp-nte
no vad
!
permission term
description ** Incoming call from SIP trunk (Level 3) **
session protocol sipv2
session target sip-server
incoming called-number .%
voice-class codec 1
voice-class sip dtmf-relay force rtp-nte
dtmf-relay rtp-nte
no vad
!
Dial-peer voice 101 VoIP
Description ******outgoing call to SIP trunk******
Destination-pattern 9.T
Session protocol sipv2
Session target sip-server
Voice-class codec 1
voice-class sip dtmf-relay force rtp-nte
dtmf-relay rtp-nte
no vad
!
Troubleshooting Tools
If calls cannot be made between SIP gateways or over SIP trunks, dial peer configuration is one of the first places to check. Make sure that the dial peer is configured to use SIP and that both devices are using the same transport protocol and DTMF relay method. Make sure that destination patterns and session targets are correct, also.
The show sip-ua connections {udp|tcp} command gives you information on active connections, including those with errors. To stop a problem connection, use the clear sip-ua {udp | tcp} [connection id number] [target ipv4: ip-address] command.
To ensure that the SIP is enabled on the gateway, use the show sip-ua service command. You should get the following result:
SIP-GW#show sip-ua service
SIP Service is up
Good initiative Nawaz.. Keep doing good work…Murali
ReplyDeleteGood bro
ReplyDelete