Understanding Sip Traces
Understanding Sip Traces
To identify the caller, the called number, the media information and
resources advertised in the Invite, SIP invites use headers. Headers are
key parameters within the SIP invite and we shall look at them so as to
gain full clarity of whats going on.
Lets look at a sample SIP trace from CUCM. Note this is very similar to
what a debug ccsip messages will produce on a CUBE gateway.
(10.105.80.174)
Call-Info: <sip:10.105.80.114:5060>;method="NOTIFY;Event=telephoneevent;Duration=500"
Cisco-Guid: 1752700672-0000065536-0000007823-0237529354
Session-Expires: 84600
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
Content-Length: 0
Content-Type: application/sdp
Content-Length: 238
v=0
o=CiscoSystemsCCM-SIP 811669 1 IN IP4 10.105.40.14
s=SIP Call
c=IN IP4 10.133.92.102
t=0 0
m=audio 25268 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=ptime:20
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
Via
To
From
Call-ID
CSeq
Contact
Max-Forwards
Expires
This is the first part of the trace usually refrred to as the Request-URI This
shows four key things
1. The called number
2. The device responsible for the called number or the device through
which the called number will be routed
3. SIP Port number
4. Sip Version..
The required Via header field is used to record the SIP route taken by a
request
and is used to route a response back to the originator. A UA generating a
request
records its own address in a Via header field.
Here we see that CUCM is the UA generating this invite and it stamps it IP
on the call. This helps identify the origin of the call.
Via header fields contain protocol name, version number, and transport
(SIP/2.0/UDP, SIP/2.0/TCP, etc)
The Via header contains what is called the sent-by field. The image below shows the sent by
field and this is where the required response will be sent to.
via.png
In SIP responses follow the via header except for future requests like ACK and BYE where
responses are sent to the contact header
The To and From Headers
From: <sip:[email protected]>;tag=25526~ffa80926-5fac4dd6-b405-2dbbc56ae9a2-551664735
To: sip:[email protected]
The next header fields are the To and From header fields, which show the
originator and destination of the SIP request.
Note that the To and From header fields are not reversed in the response
message as one might expect them to be. This is because the To and From
header fields in SIP are defi ned to indicate the direction of the request,
not the direction of the message. Since
<sip:[email protected] initiated this request, all responses to
this INVITE will read
To: sip:[email protected]
From: <sip:[email protected].
Date Header:
A key component of the sip message. Its tells us the time of the sip
request.
Call ID:
Call-ID: [email protected]
string. The initiator of the session that generates the establishing INVITE
generates the unique Call-ID and From tag.
Cseq Header:
User-Agent: Cisco-CUCM8.6
The SDP extensions used in the application/SDP header lists the media
capabilities the calling party is willing to receive or negotiate or support
for the session. The table below shows the SDP attributes in this test call
and the meaning of each attribute/extension. Please note that The RFC
3264[17] specifies that the attributes containing a=rtpmap should be
used for each media field
v=0
Version Number
o=CiscoSystemsCCM-SIP 811669 1
IN IP4 10.105.40.14
Origin
s=SIP Call
Call Subject
t=0 0
time
Media
a=rtpmap:18 G729/8000
Attributes-media
a=ptime:20
Attributes-Packetization
a=rtpmap:101 telephone-
Dtmf attributes
event/8000
a=fmtp:101 0-15
Dtmf tones
This line defines the media attribtes that will be used for the call.
Audio:
means that this is an Audio call, we can also have
m=video in case of a Video call
25268:
RTP/AVP:
Represents the RTP/AVP profile number for each of
the profiles listed. The profile numbers are explained below
18=G729
0=PCMU
8=PCMA
101=rtp-nte payload
Now we have looked at the basics of sip headers and messages, lets use
this to understand the following sip trace
PSTN-------->ITSP------->CUBE--------------->CUCM---------------->IP PHONE
ITSP: 10.10.33.132
CUBE:10.100.0.74
CUCM:10.100.0.14
1. An inbound call is received on the CUBE from the ITSP. This invite was
sent with SDP. NB that this inbound leg of this call will have a unique call
ID that shows the origin of the call, highlighted below.
Received:
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.10.33.24:5070;branch=z9hG4bK9377fo00cg5ha7l0g3t0.1
From: <sip:[email protected]:5060;user=phone>;tag=15264387271338998848384To: "voice-lab-aokanlawon"<sip:[email protected]>
Call-ID: [email protected]
CSeq: 558267841 INVITE
Contact: <sip:[email protected]:5070;transport=udp>
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY
Accept: multipart/mixed,application/media_control+xml,application/sdp
Supported:
Max-Forwards: 69
Content-Type: application/sdp
Content-Length: 207
v=0
o=BroadWorks 161384582 1 IN IP4 10.10.33.132
s=c=IN IP4 10.10.33.132
t=0 0
m=audio 11164 RTP/AVP 18 0 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=fmtp:18 annexb=no
+++From our understanding of the traces, we see that the call originates
from a device called Broadworks, which advertises G711a, G711u, G729
and uses rtp-nte for DTMF. We also see the IP address for the CUBE to
stream its RTP to.+++++
NB: that this new invite is sent with a new CALL-ID. This is very important
in understanding the order of thigs especially when troubleshooting
issues. We can also see that the CUBE advertises all its SDP attributes,
codec, dtmf supported, fax etc.
Call-ID: [email protected]
Supported: timer,resource-priority,replaces,sdp-anat
Min-SE: 1800
Cisco-Guid: 2352544350-2938638817-2514718541-1568562753
User-Agent: Cisco-SIPGateway/IOS-12.x
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER,
SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 101 INVITE
Timestamp: 1338998848
Contact: <sip:[email protected]:5060;transport=tcp>
Expires: 180
Allow-Events: kpml, telephone-event
Max-Forwards: 68
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 355
v=0
o=CiscoSystemsSIP-GW-UserAgent 8773 2764 IN IP4 10.100.0.74
s=SIP Call
c=IN IP4 10.100.0.74
t=0 0
m=audio 19264 RTP/AVP 18 0 8 100 101
c=IN IP4 10.100.0.74
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:100 X-NSE/8000
a=fmtp:100 192-194
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
3. Next the CUBE sends a trying to ITSP. Trying simply means: I am looking
for the number you have requested.
4. Next the CUBE receives a trying from CUCM. The call-ID help us to know
where these responses are coming from.
5. Next the CUBE receives ringing from CUCM This informs the CUBE that
the called endpoint is ringing
Received:
SIP/2.0 180 Ringing
Via: SIP/2.0/TCP 10.100.0.74:5060;branch=z9hG4bK7953C1859
From: <sip:[email protected]>;tag=4C85762C-1A2D
To: <sip:[email protected]>;tag=811674~ffa80926-5fac-4dd6-b4052dbbc56ae9a2-477917854
Date: Wed, 06 Jun 2012 16:07:28 GMT
Call-ID:
[email protected]
7. Now the CUBE receives a 200 ok from CUCM. Please note that some
elements of the SDP has changed
9. CUBE then sends a 200 OK to ITSP with the SDP attributes to use for the
Call based on what it received from CUCM.
Sent:
SIP/2.0 200 OK
Via: SIP/2.0/TCP 10.100.0.14:5060;branch=z9hG4bK198a0b7ee5d33c
From: <sip:[email protected]>;tag=811674~ffa80926-5fac-4dd6-b4052dbbc56ae9a2-477917854
To: <sip:[email protected]>;tag=4C85762C-1A2D
Date: Wed, 06 Jun 2012 16:07:28 GMT
Call-ID: [email protected]
CSeq: 101 SUBSCRIBE
Content-Length: 0
Contact: <sip:[email protected]:5060;transport=tcp>
Expires: 7200
Sent:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.33.24:5070;branch=z9hG4bK9377fo00cg5ha7l0g3t0.1
From: <sip:[email protected]:5060;user=phone>;tag=15264387271338998848384To: "voice-lab-aokanlawon"<sip:[email protected]>;tag=4C85763E1CF8
Date: Wed, 06 Jun 2012 16:07:28 GMT
Call-ID: [email protected]
CSeq: 558267841 INVITE
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER,
SUBSCRIBE, NOTIFY, INFO, REGISTER
Allow-Events: kpml, telephone-event
Remote-Party-ID: <sip:[email protected]>;party=called;screen=no;privacy=off
Contact: <sip:[email protected]:5060>
Supported: replaces
Supported: sdp-anat
Server: Cisco-SIPGateway/IOS-12.x
Supported: timer
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 270
v=0
o=CiscoSystemsSIP-GW-UserAgent 7413 6169 IN IP4 10.100.0.74
s=SIP Call
c=IN IP4 10.100.0.74
t=0 0
m=audio 29626 RTP/AVP 18 101
c=IN IP4 10.100.0.74
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
11. Finally the call is ended. Now when troubleshooting the direction of
call termination is important. In this case we can see that the CUBE
receives a BYE, which is the sip method for call termination. However who
sent the BYE, is it CUCM or ITSPThe answer is in the Call-ID. As we call
can see the CALL-ID is for the leg from the ITSP. So we see that the call
was terminated from the ITSP side.
Next important thing is the cause code. The reason why the call was
terminated.
Received:
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.10.33.24:5070;branch=z9hG4bKfj8rji3008r0m4lbg7e0cd1hhq713.1
From: <sip:[email protected]:5060;user=phone>;tag=15264387271338998848384To: "voice-lab-aokanlawon"<sip:[email protected]>;tag=4C85763E1CF8
Call-ID: [email protected]
CSeq: 558267842 BYE
Max-Forwards: 69
Content-Length: 0
Received:
SIP/2.0 200 OK
Via: SIP/2.0/TCP 10.100.0.74:5060;branch=z9hG4bK7954021A8
From: <sip:[email protected]>;tag=4C85762C-1A2D
To: <sip:[email protected]>;tag=811674~ffa80926-5fac-4dd6-b4052dbbc56ae9a2-477917854
Date: Wed, 06 Jun 2012 16:07:34 GMT
Call-ID: [email protected]
CSeq: 103 BYE
Content-Length: 0