Sip Cucm
Sip Cucm
Sip Cucm
Core Issue
All outbound PSTN SIP calls are validated by the SIP Trunk provider to ensure the calls are
valid and not toll fraud attempts. The methods of call validation can vary from provider to
provider, and many involve multiple methods for the same call. This becomes a concern
when using the default settings in a CUCM w/CUBE topology and attempting to call forward
an inbound PSTN call back out to the PSTN. One of the most common validation methods
is for the SIP provider to examine the "From" field in the incoming INVITE of a call and make
sure it matches to a known DID number for that customer. The default setting in CUCM for
forwarding calls is to maintain the CLID of the calling originator. This causes the "From" field
of an outgoing INVITE to contain the CLID number of the original PSTN caller, and not a
valid DID belonging to the customer. When the provider sees this with no additional
information, it typically will reject the call setup attempt or ignore it completely.
Resolution
There are three common solutions to this issue.
The first is to alter the "From" field so that the CUCM will send the information of the
redirecting number instead of the call originator. In this scenario the "From" field will contain
a valid customer DID number, and the call will validate. The advantage of this technique is
that it works with virtually all SIP providers. The disadvantage is that the receiving party of
the forwarded call will only see the caller-ID of the number that was set to forward (typically
their own office DID number). They will not see the caller-ID of the original caller, and
therefore will not know who is calling prior to answering the call.
field retains the calling originator's information so that the recipient of the call can see who is
calling on their caller-ID. The disadvantage of this technique is that it is not universally used,
and customers need to check with their SIP providers to make sure they will validate calls
based on the p-asserted identity value instead of the "from" field value.
Here are the steps to use the second technique when using a CUBE gateway:
-Log into the CUBE router
-Add the following SIP profile (make sure to use a unique profile number if you have existing
SIP profiles, or add it to your outbound SIP profile in use. Also make sure to use a valid DID
number and SBC URL information.)
voice class sip-profiles 1
request INVITE sip-header P-Asserted-Identity add "P-AssertedIdentity:<sip:[email protected]>"
-Add the following configuration line to the dial-peer being matched to place the outbound
call to the SIP provider:
voice-class sip profiles 1
Make sure that the SIP Profile contains a valid DID with your SIP provider. Also, most
providers will look for a fully qualified domain name in the PAI, as opposed to an IP
address. Be use to use the FQDN in the profile, even if you are routing the calls directly to
the provider's IP address.
The third method is similar to the second but instead of a PAI line, this uses a Diversion
Header. The Diversion Header is added to the outbound INVITE and contains a DID
number that the provider can validate the call with. Like with the second option, the
advantage of this technique is that the "From" field retains the calling originator's information
so that the recipient of the call can see who is calling on their caller-ID. The disadvantage of
this technique is that it is not universally used, and customers need to check with their SIP
providers to make sure they will validate calls based on the diversion header value instead of
the "from" field value.
Here are the steps to use the third technique when using a CUBE gateway:
-Navigate to SIP Trunk page in CUCM
-Navigate to "Outbound Calls" section of the page
-Check the "Redirecting Diversion Header Delivery - Outbound" Check box
-Save the change, and apply the change (may drop calls why you press apply, so be careful
with this change during business hours)
-Log into the CUBE router
-Add the following SIP profile (make sure to use a unique profile number if you have existing
SIP profiles, or add it to your outbound SIP profile in use. Also make sure to use a valid DID
number and SBC URL information.)
voice class sip-profiles 1
request INVITE sip-header Diversion modify "<sip:(.*)@(.*)>"
"<sip:[email protected]>"
-Add the following configuration line to the dial-peer being matched to place the outbound
call to the SIP provider:
voice-class sip profiles 1
Make sure that the SIP Profile contains a valid DID with your SIP provider. Also, most
providers will look for a fully qualified domain name in the diversion header, as opposed to
an IP address. Be use to use the FQDN in the profile, even if you are routing the calls
directly to the provider's IP address.
Troubleshooting
The following debugs are useful in this call scenario:
debug ccsip messages
debug voip ccapi inout
When reading these debugs keeping the different call legs straight can get confusing. It is
recommended to use an application such as Notepad ++, and to mark the Call ID of each
call leg traversing the CUBE. The goal of these debugs is to check that the outbound
INVITE for the forwarded call contains either the correct "from" field, or the correct "passerted identity" or "diversion header" field. If using the "from" field method, check that the
SIP INVITE coming from the CUCM contains the full 10 digit DID number for the last
redirecting party, and that this value is the same in the INVITE going to the provider. If using
either the "p-asserted identity" method or the "diversion header" method, make sure that the
outgoing call is matching the correct dial-peer that has the voice-class sip profile set on it. If
it is matching a different dial-peer, add the sip profile to that dial-peer.
Feature Overview
Dial-peer selection is based on immediate SIP neighbor's address information
and applicable only to incoming SIP calls. The address information is retrieved from the VIA
header of the incoming message, which is then used to lookup the dial-peer that has the
best match for the criteria selected. The lookup will first attempt to match a dial-peer with
the address information in the following order:
Via header
Request URI
To URI
From URI
Called Number
If none of the parameters match, then the default inbound dial-peer is matched.
This feature also allows for Generic DNS Caching framework for faster FQDN to IP
Address lookup. For a configured FQDN, the DNS Caching framework resolves the FQDN
and stores the corresponding set of IP addresses for it. The framework also takes care of
the regular DNS refreshes for the FQDN. For a dial-peer match to be done, if the incoming
Via header has an IP address and the configuration has an FQDN, then the
corresponding resolved addressed of this FQDN is queried from the DNS
Caching Framework.
Call Flow
ITSP1 ---> SIP --> Call from source address 172.16.1.10 ----->
| ----> CUBE - SIP CUCM - IP Phones
ITSP2 ---> SIP --> Call from source address 172.31.10.10 --->
Sample Config
!To handle incoming calls from ITSP1
voice class uri 1001 sip
host ipv4:172.16.1.10
dial-peer voice 1 voip
description Calls from ITSP1
session protocol sipv2
incoming uri via 1001
max-connection 10
codec g711ulaw
acc-qos controlled-load
req-qos controlled-load
!To handle incoming calls from ITSP2
voice class uri 1002 sip
host ipv4:172.31.10.10
Solution
Show commands to Identify the active call count on SIP:
Show commands
SBC03#Show call active voice compact
Number of call-legs counted during viewing: 1448
SBC03#Show voip rtp connections
Found 1459 active RTP connections
SBC03#show call active voice brief | incl call-legs
Telephony call-legs: 0
SIP call-legs: 1053
H323 call-legs: 0
Call agent controlled call-legs: 0
SCCP call-legs: 410
Multicast call-legs: 0
Total call-legs: 1463
Telephony call-legs: 0
SIP call-legs: 1050
H323 call-legs: 0
Call agent controlled call-legs: 0
SCCP call-legs: 410
Multicast call-legs: 0
Total call-legs: 1460
is not equal to the initial count. Some call-legs were
Number of call-legs counted during viewing: 1460
SBC03#
SBC03#
SBC03#
SBC03#sh sip-ua call su
Total SIP call legs:1066, User Agent Client:526, User Agent Server:540
But there can be more on total legs as there can some calls being generated. If you have
MTP/transcoder / conference then those legs will be more than the actual call leg. So we should take
of SIP legs /2 for SIP-SIP calls.
Introduction
This document intends to help the beginners to understand the basics of IP Telephony. It
explains the working concept of the SCCP & SIP Phones and the Dial rules, digit forwarding methods
to initiate a call.
SIP Phones: Enbloc, KPML (default on newer phones), SIP dial rules
What is KPML?
It is nothing but Keypad Markup Language (KPML). Call came from an SIP Phone using
KPML, CUCM receives, interprets and analyzes the dial plan on a digit-by-digit basis. Cisco
SIP Phones that support KPML use digit-by-digit dialing by default. KPML is not supported
on older SIP Phones. Type A phones.
As soon as the user goes off-hook, a signaling message is sent from the phone to the
CUCM server with which it is registered. A user goes off-hook and then dials extension
1000. Each event is reported to CUCM in real time.
All the call progress feedback provided by CUCM to the end user on the Cisco IP Phone,
Screen display messages showing calling or called party, dial tone, secondary dial tone,
ring back, reorder tone and so on is initiated by an SCCP message sent from CUCM to
the Cisco IP Phone.
Skinny Client Control Protocol (SCCP) is a stimulus/response protocol where the endpoint
sends user input (stimulus) and expects some type of response from the server instructing
the endpoint about what to do.
Note: - It is not possible to configure dial plan information (dial rules) on Cisco IP Phones
using SCCP. All dial plan functionality is contained in the CUCM cluster with an SCCP
phone.
A user dialing an international pattern that is denied by the end user's CoS deployed in
CUCM will result in the reorder tone ie busy signal that is played to the calling party letting
the party know that the "Call could not be completed as dialed".
If calls to the 976 area code are denied based on the calling party's configured CoS, a
reorder tone is sent to the calling party phone as soon as the user dials 91976.
SIP IP Phones:
Type A SIP Phones: Cisco Unified IP Phone models 7905, 7912,
7940 and 7960
Type A SIP Phones support SIP dial rules, which are configured in CUCM and downloaded
to the IP Phone at boot time. It does not support KPML. SIP dial rules will enable dial tone
and traditional phone functionality on CUCM.
Type A SIP Phones: No Dial rules
Type A Cisco IP Phones using SIP firmware without SIP dial rules do not deliver a dial tone
to the calling party when the calling party goes off-hook with the handset or speaker phone.
All digits are sent to CUCM enbloc after the user completes the dialing and press the Dial
softkey.
Figure shows, User making a call to extension 1000. The user dials 1000 followed by
pressing the Dial soft key. The Cisco IP Phone sends a SIP INVITE message to CUCM with
all dialed digits (enbloc). CUCM performs digit analysis and provides a call progress
message to the IP Phone.
rules allow Type A Phones to emulate SCCP and traditional phone systems while also
providing processing and signaling overhead benefits.
Figure illustrates a phone configured to recognize all four-digit patterns beginning with a
leading digit of 1. This pattern has an associated timeout value of 0. All user input actions
matching the pattern will trigger the sending of the SIP INVITE message to CUCM
immediately, without requiring the user to press the Dial key.
Note: Cisco SIP Phones that support KPML use digit-by-digit dialing by default. KPML is not
supported on older Cisco Type A SIP Phones. Type A phones only support enbloc dialing
when using SIP firmware.
3. Ringing
4. ACK
5. OK
We will look at these messages as we try to understand the debugs. These messages are key
in knowing whats going on. They help us to understand the language been spoken so we
are not lost like a non French speaking man in Paris!
Ok enough of grammars, lets dive in! Ready?
INVITE:
An Invite is a SIP requests called methods. There are Six SIP methods described in the SIP
specification document RFC 3261 [1].
The INVITE, REGISTER, BYE, ACK, CANCEL, and OPTIONS methods are the original six
methods
in SIP.
The INVITE method is used to establish media sessions between user agents. In
telephony, it is similar to a Setup message in ISDN
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)
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
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)
From: <sip:[email protected]>;tag=25526~ffa80926-5fac-4dd6-b4052dbbc56ae9a2-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]
The Call-ID header field is an identifier used to keep track of a particular SIP session. The
originator of the request creates a locally unique string. Some older implementations also
add an @ and its host name to the string. The initiator of the session that generates the
establishing INVITE generates the unique Call-ID and From tag.
The Call ID is one of the key components used in troubleshooting. Each UA generates its
own Call ID. Sowhen a call originates from CUCM, CUCM generates its own call id and when
a call origate from the CUBE, CUBE generate its own call ID.
Cseq Header:
The command sequence CSeq header field is a required header field in every request. The
CSeq header field contains a decimal number that increases for each request. Usually, it
increases by 1 for each new request, with the exception of CANCEL and ACK requests, which
use the CSeq number of the INVITE request to which it refers. The CSeq count is used by
UASs to determine out-of-sequence requests or to differentiate between a new request
(different CSeq) or a retransmission (same CSeq). The CSeq header fi eld is used by UACs to
match a response to the request it references
User-Agent: Cisco-CUCM8.6
This header identifies the UA that is originating this request/response. In this trace we can
see that the UA above is CUCM version 8.6.The user agent header helps identify the
originator of the request/response.
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
Name
v=0
Version Number
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-event/8000
Dtmf attributes
a=fmtp:101 0-15
Dtmf tones
This line defines the media attribtes that will be used for the call.
Audio:
Video call
25268:
means that this is an Audio call, we can also have m=video in case of a
Is the dynamic RTP port used for the call
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.
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
Content-Length: 0
7. Now the CUBE receives a 200 ok from CUCM. Please note that some elements of the SDP
has changed
m=audio 16730 RTP/AVP 18 101---------Codec to use for call and DTMF type to use
a=rtpmap:18 G729/8000-------------------Codec = G729
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,
Contact: <sip:[email protected]:5070;transport=udp>
Max-Forwards: 69
Content-Length: 0
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
Below are a few of the Threads that we have used the indepth understanding of sip trcaes
to help resolve thier issues. Please take a look as this will help you to understand better sip
traces and how they play a key part in troubleshooitng issues
Introduction
This document explains the basic SIP Call flow between the PBX, Gateways and SIP
Phones in detail. Idea of creating this document is to help the beginners to
understand the Various SIP Call flows and messages. Also this document covers the
SIP Troubleshooting commands.
Prerequisites
Basic knowledge about the SIP Protocol and the call flow Messages.
Step
Action
Description
1.
SetupPBX A to
Gateway 1
2.
INVITEGateway
1 to Cisco SIP IP
phone
3.
Call Proceeding
Gateway 1 to PBX
A
4.
100 TryingCisco
SIP IP phone to
Gateway 1
5.
180 Ringing
Cisco SIP IP phone
to Gateway 1
6.
AlertingGateway
1 to PBX A
7.
200 OKCisco
SIP IP phone to
Gateway 1
8.
ConnectGateway
1 to PBX A
9.
Connect ACK
PBX A to Gateway
1
10.
ACKGateway 1
to Cisco SIP IP
phone
11.
BYECisco SIP IP
phone to Gateway
1
12.
Disconnect
Gateway 1 to PBX
A
13.
ReleasePBX A
to Gateway 1
14.
200 OKGateway
1 to Cisco SIP IP
phone
15.
Release
Complete
Gateway 1 to PBX
A
Step
Action
Description
1.
SetupPBX A to
Gateway 1
2.
INVITEGateway
1 to Cisco SIP IP
phone
3.
Call Proceeding
Gateway 1 to PBX
A
4.
100 TryingCisco
SIP IP phone to
Gateway 1
5.
180 Ringing
Cisco SIP IP phone
to Gateway 1
6.
AlertingGateway
1 to PBX A
7.
200 OKCisco
SIP IP phone to
Gateway 1
8.
ConnectGateway
1 to PBX A
9.
ACKGateway 1
to Cisco SIP IP
phone
10.
Connect ACK
PBX A to Gateway
1
11.
INVITECisco SIP
IP phone to
Gateway 1
12.
200 OKGateway
1 to Cisco SIP IP
phone
13.
ACKCisco SIP IP
phone to Gateway
1
14.
INVITECisco SIP
IP phone to
Gateway 1
User B takes User A off hold. The Cisco SIP IP phone sends
a SIP INVITE request to Gateway 1.
15.
200 OKGateway
1 to Cisco SIP IP
phone
16.
ACKCisco SIP IP
phone to Gateway
1
Step
1.
Action
Description
INVITECisco
SIP IP phone A
to Cisco SIP IP
phone B
2.
180 Ringing
Cisco SIP IP
phone B to
Cisco SIP IP
phone A
3.
200 OKCisco
SIP IP phone B
to Cisco SIP IP
phone A
ACKCisco
SIP IP phone A
to Cisco SIP IP
phone B
4.
The ACK might contain a message body with the final session
description to be used by Cisco SIP IP phone B. If the message
body of the ACK is empty, Cisco SIP IP phone B uses the
session description in the INVITE request.
A two-way RTP channel is established between Cisco SIP IP phone A and Cisco SIP IP
phone B.
5.
INVITECisco
SIP IP phone B
to Cisco SIP IP
phone A
200 OKCisco
SIP IP phone A
to Cisco SIP IP
phone B
7.
ACKCisco
SIP IP phone B
to Cisco SIP IP
phone A
The RTP channel between Cisco SIP IP phone A and Cisco SIP IP phone B is torn down.
8.
INVITECisco
SIP IP phone B
to Cisco SIP IP
phone A
200 OKCisco
SIP IP phone A
to Cisco SIP IP
phone B
10.
ACKCisco
SIP IP phone B
to Cisco SIP IP
phone A
SIP Troubleshooting
This document is to demonstrate how codec negotiation is done between calls involving
CUBE, SIP Trunks, CUCM, IP Phones and Cisco Unity connection. In some scenarios a
transcoder will be invoked and we shall look at why and how to properly design your
network to know if you need a transcoder or not.
This will be based on a very practical approach as seen from a production environment. The
call flow will be divided into different call scenarios and we will examine what codec is used
for each call and if a transcoder is needed or not. Each of the call scenarios will also be
discussed based on the direction of the call; Inbound or Outbound. This is because different
rules apply depending on which direction the call originates and terminate.
The region settings involved in each of the call flow will also be considered as they play a key
role in codec negotiation.
NB: Some of the call scenario use voice-class codec on the dial-peers. There is a general
good practice on using voice-class codec on CUBE.
for voice-class codec to work well on cube, ensure the codec preference and order is the same on
both inbound and outbound dial-peer.
THE ENVIRONMENT
This environment is a cluster of 8 CUCM servers with four call processing servers (CUCM
service activated), two Unity connection clustered servers and two CUBES
CUCM version: 8.6.2.21900-5
CUBE IOS version:c3900e-universalk9-mz.SPA.151-4.M4.bin
INBOUND CALLS
Lets start with inbound calls:
ITSP--------sip----------->CUBE--------sip----->CUCM----sccp---->IP Phone
SCENARIO 1------Inbound call to an IP Phone(no xcoder invoked)
++++Inbound dial-peer to CUBE++++
dial-peer voice 1 voip
modem passthrough nse codec g711ulaw
incoming called-number .
voice-class codec 1
dtmf-relay sip-kpml rtp-nte
+++++Outbound dial-peer config to CUCM++++
dial-peer voice 50 voip
description Inbound calls to CUCM
translation-profile outgoing IN_PORT
destination-pattern 44T
modem passthrough nse codec g711ulaw
session protocol sipv2
session target ipv4:10.10.4.74
session transport tcp
dtmf-relay rtp-nte digit-drop h245-alphanumeric
voice-class codec 1
fax rate disable
Region between phone and cube is set to use G711. Inbound and outbound dial-peer set to
use voice class codec with g729 as preferred codec
CALL ANALYSIS
1. Call arrives on CUBE and matched inbound DP=1 with voice-class codec set.
2. Call matches outbound dial-peer 50, voice-class codec set
3. When a voice-class is configured on a DP, the codec used will depend on the region
setting between the source and the destination. Here, the source is cube (sip trunk), the
destination is an IP Phone. Because the region setting between the CUBE and IP Phone is
G711, the call will use G711. The region setting becomes the prevailing factor here. CUCM
will send a 200 OK to the invite received from CUBE with the codec set between the
endpoint and destination. In actual fact whatever the region setting between the IP phone
and the CUBE is, thats the codec that will be used. If its G729, then the call will use G729.
An abbreviated trace is shown below:
Cube receives invite from ITSP with early offer and all supported codecs
Received:
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.106.33.24:5070;branch=z9hG4bKeao3hl307oi03u4716b0.1
From: <sip:[email protected]:5060;user=phone>;tag=4516878931338998863036To: " -SPK TestGrid"<sip:[email protected]>
Content-Type: application/sdp
v=0
o=BroadWorks 161384816 1 IN IP4 10.10.10.10
s=c=IN IP4 10.10.10.10
t=0 0
m=audio 15382 RTP/AVP 18 0 8 101-------------Advertised CODECS
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=fmtp:18 annexb=no
CUBE sends invite to cucm with early offer and codecs matched on voice-class codec
Sent:
To: <sip:[email protected]>;tag=811681~ffa80926-5fac-4dd6-b4052dbbc56ae9a2v=0
o=CiscoSystemsCCM-SIP 811681 1 IN IP4 10.10.4.14
s=SIP Call
c=IN IP4 10.54.117.13------RTP sent directly to IP Phone
t=0 0
m=audio 27770 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000---------------G711Ulaw selected to use for the call
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
A show voip rtp connection shows the flow of RTP stream for the two call legs
Sh voip rtp connection:
13 91498 91499 31298 23516 10.10.4.174 10.10.10.10 (ITSP-CUBE)
14 91499 91498 17432 25092 10.10.4.174 10.54.117.13 (CUBE to IP phone)
ITSP--------sip----------->CUBE(1)--------sip----->CUCM---->Ip Phone
<---------------------G729-------------------------> (Reg btw IP phone-Cube)
SCENARIO 2------Inbound call to an IP Phone(xcoder invoked)
++++Inbound dial-peer to CUBE++++
dial-peer voice 1 voip
modem passthrough nse codec g711ulaw
incoming called-number .
voice-class codec 1
dtmf-relay sip-kpml rtp-nte
+++++Outbound dial-peer config to CUCM++++
dial-peer voice 50 voip
description Inbound calls to CUCM
translation-profile outgoing IN_PORT
destination-pattern 44T
Region between phone and cube is set to use G729. Outbound dial-peer is hard coded to
use g711ulaw
CALL ANALYSIS
1. Call arrives on CUBE and matched inbound DP=1 with voice-class codec set.
2. Call matches outbound dial-peer 50, codec set to G711ulaw
3. At this point regardless of the region setting between the ip phone and cube or sip trunk
to the CUBE, G711u will be used. This is because the CUBE sends an early offer with only
g711ulaw advertised. So CUCM is forced to send an ACK back with only g711u as the codec
to use for the call. The region setting between the phone and cube will now determine if a
xcoder is invoked or not. Since the region setting between the phone and CUBE is set to
G729 in this case, a xcoder must be invoked and available otherwise the call will fail.
The two call legs look like this:
Callleg1=g711..inbound call leg to CUBE (DP Is set to G711ulaw
Callleg2=G729.outbound call leg to ip phone (region between phone and cube=g729).
In this case which I looked at, the system was not properly designed; hence there was no
transcoder available for use in the MRGL of the cube.
NB: There was a transcoder in the MRG but the region between the CUBE and the
transcoder was set to G729. Hence the CUBE couldnt use it. CUCM however found a
transcoder in the default MRGL which was an unassigned transcoder. The problem with this
is, the system administrators had no idea that calls were been redirected to this transcoder.
After a while users started reporting that calls come into their phone and they are unable to
pick up. When they pickup the headset, calls dont connect. This was because the remote
transcoder in use didnt have enough sessions on it to support the call traffic redirected to
it. The system was not designed for this transcoder to be used; hence no one made such
provisions.
This is why its crucial to design your system very well and to understand each element of
your solution and how they interact.
An abbreviated trace is shown below:
Cube receives invite from ITSP with early offer and all supported codecs
Received:
Scenario 3, an inbound call comes to an IP phone via CUBE. The IP phone has a CFWdall set
to a cell phone.
Configurations:
+++Voice-class codec++++
voice class codec 1
codec preference 1 g729r8
codec preference 2 g711ulaw
codec preference 3 g711alaw
++++Inbound dial-peer to CUBE++++
dial-peer voice 1 voip
modem passthrough nse codec g711ulaw
incoming called-number .
voice-class codec 1
dtmf-relay sip-kpml rtp-nte
+++++Outbound dial-peer config to CUCM++++
dial-peer voice 50 voip
description Inbound calls to CUCM
translation-profile outgoing IN_PORT
destination-pattern 44T
modem passthrough nse codec g711ulaw
session protocol sipv2
session target ipv4:10.10.4.74
session transport tcp
Region Settings between CUBE= G.729, region setting between cube and IP Phone=g729
CALL ANALYSIS
1. Call arrives on CUBE and matched DP=1 with voice-class codec set.
a=fmtp:100 192-194
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
CUCM sends a 200 OK, agreeing on G711ulaw as the codec to use
Received:
SIP/2.0 200 OK
Via: SIP/2.0/TCP 10.10.4.20:5060;branch=z9hG4bK375566FA
From: <sip:[email protected]>;tag=306F1686-1BE5
To: <sip:[email protected]>;tag=189823~ffa80926-5fac-4dd6-b4052dbbc56ae9a2-477054169
Date: Wed, 09 May 2012 21:28:12 GMT
Call-ID: [email protected]
CSeq: 101 INVITE
Content-Type: application/sdp
Content-Length: 214
v=0
o=CiscoSystemsCCM-SIP 189823 1 IN IP4 10.10.4.14
s=SIP Call
c=IN IP4 10.10.10.40--------->CUCM informs CUBE to send RTP to Transcoder
t=0 0
m=audio 17496 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000------------------>G711ulaw accepted
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
So on the first call leg G711ulaw is used
Below is the Sh sccp connection on the Xcoder
Tag13=ITSP--->CUBE call leg
Tag14= CUBE--->Xcoder Call leg
Sh voip rtp connection:
Observe that the region between the IP phone and the CUBE does not even come into play
here. This is because the call was diverted, hence no RTP stream is sent to the phone.It is
the destination where RTP stream will be sent to that codec negotiation will be considered
for
In this call setup, a xcoder at a remote site was used even though transcoder resources are
configured on the CUBE and registered to CUCM.
This is because the region setting between the Xcoder and the CUBE were wrongly
configured. Hence the CUBE found an available transcoder in the default MRGL. This is a
very crucial part of your design. Ensure that:The region setting between a XCODER and the
Device invoking it is G711.
sh sccp connections on the transcoder:
NB: that the codec section has two main distinctions
1. The leg that invokes a xcoder will always be G711
2. The other leg of the call will use whatever region setting is configured between it and the
xcoder. So if its G711, you will see G711, if its G729, you will see G729.
sess_id conn_id stype mode codec sport rport ripaddr
536967470 469864467 xcode sendrecv g711u 32106 16882 10.10.4.174
536967470 469864466 xcode sendrecv g711u 25092 17432 10.10.4.174
We are seeing the CUBE ip here duplicated because this is a hairpinned call. The same CUBE
is sending rtp connection to the xcoder.
SCENARIO 4
Scenario 4 is similar to scenario 3 but the region settings are different and we use voice class
codec on the outbound dial-peer to CUCM.An inbound call comes to an IP phone via CUBE.
The Ip phone has a CFWdall set to a cell phone.
ITSP------->CUBE--------->CUCM---->Ip Phone---CFWDall--->CUBE----->ITSP
<----------------G729-------------------->(cubetoiphone=g729)
<------------------------------G711------------------------------------->(cubetocube=g711)
Configurations:
+++Voice-class codec++++
voice class codec 1
codec preference 1 g729r8
codec preference 2 g711ulaw
codec preference 3 g711alaw
Region Settings between CUBE(s)= G.711, region setting between cube(s) and IP
Phone=g729
CALL ANALYSIS
1. Call arrives on CUBE and matched inbound DP=1 with voice-class codec set.
In this call scenario we can see that no transcoder is involved because of the homogeneity
of the codecs used.
CALL ANALYSIS
1. Call arrives on CUBE and matched DP=1 with voice-class codec set.
3. At this point regardless of the region setting between the ip phone and cube or sip trunk
to the CUBE, G711u will be used. This is because the CUBE sends an early offer with only
g711ulwa advertised. So CUCM is forced to send an ACK back with only g711u as the codec
to use for the c all.
4. When the call arrived on ip phone, it was cfwd to voice mail,
5. Hence RTP connection is setup inbound to cube and outbound to unity connection. So in
this case the second call leg of the call will be between CUBE->Unity connection
Now the region setting between CUBE-Unity Connection=G729.
So we have a call flow like this
Callleg1=g711
Callleg2=G729
Hence a xcoder is needed. The CUBE invokes a xcoder. If there is no transcoder available,
then this call will fail.
NB: This is a really bad design. You dont want calls to unity connection using a transcoder.
This is happening because the codec and region configurations were poorly done without
the consideration of how they interact.
Now we have covered quite a few scenarios that are involved in our day to day call
requirements on the inbound direction. Here is a quick recap
In summary, rule on dial-peer and region settings is this
When voice-class codec is used, the codec set on the region between the calling device and called
device wil be used. E.g Cube calling ip phone and region set to G729, G729 will be used.
If the region between the calling CUBE/Gateway, and the gateway used to make the Forwarded
call is set to g729, then G729 will be used.
If the region set between calling gateway and the gw making forwarded call = G711, then G711
will be used
If the DP=G711 hard coded, and the region between the gateways is G729, then a xcoder will be
invoked. as explained above
If DP=g729 and region between gateways is G711, then g729 will be used (its as if G711 can step
down to G729)
OUTBOUND CALLS
IP phone----sccp----------->CUCM---------sip---------->CUBE--------sip----->ITSP
Received:
SIP/2.0 183 Session Progress
v=0
o=BroadWorks 161411162 1 IN IP4 10.10.10.10
s=c=IN IP4 10.10.10.10
t=0 0
m=audio 18758 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=fmtp:18 annexb=no
CUBE sends 183 to CUCM with G729
Sent:
SIP/2.0 183 Session Progress
v=0
o=CiscoSystemsSIP-GW-UserAgent 2278 8254 IN IP4 10.10.4.174
s=SIP Call
c=IN IP4 10.10.4.174
t=0 0
m=audio 29694 RTP/AVP 18 100 101
c=IN IP4 10.10.4.174
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:100 X-NSE/8000
a=fmtp:100 192-194
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
We received 200 ok from ITSP
Received:
SIP/2.0 200 OK
v=0
o=BroadWorks 161411162 1 IN IP4 10.10.10.10
s=-
t=0 0
m=audio 28170 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
a=ptime:20
SUMMARY/CONCLUSION
Finally, Summarising both call scenario,
In both cases the codec selected by the far end will determine what codec is used for the
call.
Outbound leg, far end is ITSP, prefered codec in advertised codec will take effect. Simples!
SCENARIO :
[ Home-1 Cluster] User Calls 7777 --> CUSP ( via SIP Trunk CUSP1) --> CVP --> ICM
(Script Runs, If no agents available = Kick out to 110011 = Hunt Pilot on Home-2 Cluster) -->
CVP --> CUSP ( via SIP Trunk CUSP1) --> Home-2 Cluster Hunt Pilot 110011 [Fails]
If we use a RE-INVITE method of performing a transfer, this scenario can be quite easy to
achieve. However, at times customers would like to use the REFER mechanism for transfer.
During such a scenario, CUCM has the capability of accepting the INBOUND REFER and
handles this call based on the SIP Route Pattern configuration.
In the above case, as an example this is what should happen ideally from signalling
perspective :
CUCM
CUSP1 Trunk
--INVITE-->
<--TRYING-<--200 OK--
-- ACK-->
<--REFER---202 ACCEPTED-->
*Note REFER here will have "Refer to" header with the destination IP Address that CUCM
needs to send the new INVITE to for transfer purpose. CUCM will generate this new INVITE
based on the "IPAddress Routing" type SIP Route Pattern that is configured.
WORKAROUND :
Configure an alternate SIP Trunk CUSPTEST that has the same destination IP Address
as that of CUSP1. Since we cannot create two SIP Trunks with same destination IP
Address, associate the new SIP Trunk with a SIP TRUNK SECURITY Profile
"TEST_PROFILE" that has incoming port as any dummy port such as 5065.
We don't need to bother about the dummy incoming port because CUSP is never going to
talk to CUCM on that port for incoming messages.
Once we have associated the new SIP Trunk CUSPTEST with the "TEST_PROFILE" we
can now successfully associate this SIP Trunk to the SIP Route Pattern to get the above
call flow working.
This is a great example of how a dummy SIP Trunk can be used to get a simple REFER
transfer working in such a deadlock situation.
Hope this helps!
Regards,
Avinash
Problem description
When we register the Cisco Router as SIP Gateway, the Provider will see the Router's
Registered name as "User-Agent: Cisco-SIPGateway/IOS-12.x" in the SIP header. Is it
possible to Rename the SIP User-Agent Name ?
Sample SIP INVITE message with the User-Agent name ( field is highlighted in bold):
*Mar 1 00:34:45.515: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.184.83:5060;branch=z9hG4bK1E1E51
From: <sip:[email protected]>;tag=85E9C7C8-A4C
To: <sip:[email protected]>;tag=1EDC10-2436
Date: Tue, 28 Feb 2006 23:44:38 GMT
Call-ID: [email protected]
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Timestamp: 1141170279
CSeq: 103 BYE
Reason: Q.850;cause=16
Content-Length: 0
*Mar 1 00:34:45.535: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Sent:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.184.83:5060;branch=z9hG4bK1E1E51
From: <sip:[email protected]>;tag=85E9C7C8-A4C
To: <sip:[email protected]>;tag=1EDC10-2436
Date: Fri, 01 Mar 2002 00:34:45 GMT
Call-ID: [email protected]
Server: Cisco-SIPGateway/IOS-12.x
Timestamp: 1141170279
CSeq: 103 BYE
Reason: Q.850;cause=16
Content-Length: 0
Solution
Yes, It is possible to Rename the default SIP User-Agent name by Modifying the User Agent
in SIP Header using Sip profile.
Configuration Steps
voice service voip
media flow-around
allow-connections sip to sip
sip
sip-profiles 100
voice class sip-profiles 100
response 200 sip-header User-Agent add "User-Agent: CiscoSystems-SIP-GW-UA"