Optimizing Call Quality With CUCM Regions
Optimizing Call Quality With CUCM Regions
1. Unified Communications Manager takes the matching codecs from both sides of a call leg,
2. filters out the codecs that exceed the configured maximum audio bit rate,
3. and then picks the preferred codec among the codecs that are remaining in the list.
Internet Speech Audio An adaptive wideband audio codec, specially designed to deliver wideband sound quality with low delay in both low and medium bit rate applications.
Codec (iSAC)
Internet Low Bit Rate Provides audio quality between G.711 and G.729 at bit rates of 15.2 and 13.3 kb/s while allowing for graceful speech quality degradation in a lossy network due to independently
Codec (iLBC) encoded speech frames. iLBC is supported for SIP, SCCP, H323, and MGCP devices.
Adaptive Multi-Rate The required standard codec for 2.5G/3G wireless networks based on GSM (WDMA, EDGE, GPRS). This codec encodes narrowband (200-3400 Hz) signals at variable bit rates
(AMR) ranging from 4.75 to 12.2 kb/s with toll quality speech starting at 7.4 kb/s. AMR is supported only for SIP devices.
Adaptive Multi-Rate Codified as G.722.2, an ITU-T standard speech codec formally known as Wideband, codes speech at about 16 kb/s. This codec is preferred over other narrowband speech codecs
Wideband (AMR-WB) such as AMR and G.711 because it provides better speech quality due to a wider speech bandwidth of 50 Hz to 7000 Hz. AMR-WB is supported only for SIP devices.
Opus Opus codec is an interactive speech and audio codec, specially designed to handle a wide range of interactive audio applications such as voice over IP, video conferencing, in-game
chat, and live distributed music performance.
This codec scales from narrowband low bit rate to a very high quality bit rate ranging from 6 to 510 kb/s.
Opus codec support is enabled by default for all SIP devices. You can reconfigure Opus support via the Opus Codec Enabled service parameter (the default setting is Enabled for All
Devices ). You can reconfigure this parameter to disable Opus codec support, or to enable support in non-recording devices only.
Let's suppose, we have a call from Phone A (blue one) to Phone B (yellow one)
Phone A, Codecs Supported:
╔═══════════╤════════╤════════╤════════╤═════════╤═══════╤══════╗
║ Codec │ G.711a │ G.711µ │ G.729 │ G.729ab │ G.728 │ iLBC ║
╠═══════════╪════════╪════════╪════════╪═════════╪═══════╪══════╣
║ BandWidth │ 64 │ 64 │ 8 │ 64 │ 16 │ 16 ║
╚═══════════╧════════╧════════╧════════╧═════════╧═══════╧══════╝
╔═══════════╤════════╤═══════╤═══════╤═══════╤═══════╤═══════╗
║ Codec │ G.711a │ iLBC │ G.729 │ G.726 │ G.722 │ G.728 ║
╠═══════════╪════════╪═══════╪═══════╪═══════╪═══════╪═══════╣
║ BandWidth │ 64 │ 16 │ 8 │ 24 │ 64 │ 16 ║
╚═══════════╧════════╧═══════╧═══════╧═══════╧═══════╧═══════╝
On CUCM
If MaxBitRate configured between the Region of Phone A and Phone B is configured to 32kbps, it will filter out:
╔════════╤═══════╤══════╤═══════╤═══════╗
║ Codec │ G.728 │ iLBC │ G.726 │ G.729 ║
╠════════╪═══════╪══════╪═══════╪═══════╣
║ PhoneA │ 16 │ 16 │ │ 8 ║
╟────────┼───────┼──────┼───────┼───────╢
║ PhoneB │ 16 │ 16 │ 24 │ 8 ║
╚════════╧═══════╧══════╧═══════╧═══════╝
Then, CUCM will remove the codecs not supported for both parties ⇒ { G.728, iLBC, G.729 }
╔════════╤═══════╤══════╤═══════╗
║ Codec │ G.728 │ iLBC │ G.729 ║
╠════════╪═══════╪══════╪═══════╣
║ PhoneA │ 16 │ 16 │ 8 ║
╟────────┼───────┼──────┼───────╢
║ PhoneB │ 16 │ 16 │ 8 ║
╚════════╧═══════╧══════╧═══════╝
Then, CUCM will select one codec by matching that above list with ⇒ { G.728, iLBC, G.729 } by checking the CodecList configured for the region relationship between Regions between phones. In this case Factory
Default lossy.
[+] Checking the content of the codec prerence list, CUCM will look top to down until matches on of the codec inside ⇒ { G.728, iLBC, G.729 }, the first one matched is ILBC, so, for that Call We will use ILBC:
run sql select cl.name as codec_preference_list, cl.description,c.name as codec,clm.preferenceorder as preference,c.minimumbandwidth as kbps,c.enum as payload from codeclistmember
as clm \
inner join codeclist as cl on clm.fkcodeclist = cl.pkid \
inner join typecodec as c on c.enum = clm.tkcodec \
where cl.name = 'Factory Default lossy' \
order by cl.name,clm.preferenceorder,kbps ASC
=====================
╔════════╤═══════╤══════╤═══════╤═══════╗
║ Codec │ G.728 │ iLBC │ G.726 │ G.729 ║
╠════════╪═══════╪══════╪═══════╪═══════╣
║ PhoneA │ 16 │ 32 │ │ 8 ║
╟────────┼───────┼──────┼───────┼───────╢
║ PhoneB │ 16 │ 32 │ 24 │ 8 ║
╚════════╧═══════╧══════╧═══════╧═══════╝
run sql select s1.name as Region_A, s2.name as Region_B, cdl.name as Codec_list,rgm.audiobandwidth as Audio_BW, rgm.videobandwidth as Video_BW, rgm.immersivebandwidth as
Immersive_BW from regionmatrix as rgm left join region as s2 on rgm.fkregion_b = s2.pkid left join region as s1 on rgm.fkregion_a = s1.pkid left join codeclist as cdl on cdl.pkid =
rgm.fkcodeclist order by audio_bw ASC
run sql insert into callmanagergroupmember (fkcallmanagergroup,fkcallmanager,priority) values ((select pkid from callmanagergroup where name like 'CM_group_test'),(select pkid from
callmanager where ctiid = 1),1)
2. Create a DateTimeGroup with default settings (this is just a required field when creating a DevicePool)
4. Create two Device Pool with Regions, CM Group and Date Time Group
run sql insert into devicepool (fkcallmanagergroup,fkdatetimesetting,fkregion,name) values ((select pkid from callmanagergroup where name like 'CM_group_test'),(select pkid from
datetimesetting where name like 'DTG_test'),(select pkid from region where name like 'Region_A_Test'),'DevicePool_A_Test')
run sql insert into devicepool (fkcallmanagergroup,fkdatetimesetting,fkregion,name) values ((select pkid from callmanagergroup where name like 'CM_group_test'),(select pkid from
datetimesetting where name like 'DTG_test'),(select pkid from region where name like 'Region_B_Test'),'DevicePool_B_Test')
5. Create two devices and assign to different regions, and make sure they are able to call between them.
Codecs
for IP Communicator: https://www.cisco.com/c/en/us/products/collateral/collaboration-endpoints/ip-communicator/data_sheet_c78-669663.html
Codecs for Jabber Windows: https://community.cisco.com/t5/collaboration-applications/jabber-for-windows-codec-support/td-p/3031937>
╔══════════════════════════════════════════════════════╤════════════════════╗
║ Codec Ip Communicatior │ Codec Jabber ║
╠══════════════════════════════════════════════════════╪════════════════════╣
║ G.722 wideband, │ G.711 A-law ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ G.711a, │ G.711 µ-law/Mu-law ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ G711ų, │ G.722 ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ iLBCm, │ G.722.1 ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ G.729a, │ G.729 ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ G.729ab, │ G.729a ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ G.729b (Skinny Client Control Protocol [SCCP] only), │ Opus ║
╟──────────────────────────────────────────────────────┼────────────────────╢
║ Internet Speech Audio Codec (iSAC) │ ║
╚══════════════════════════════════════════════════════╧════════════════════╝
╔═══════════════╤═══════════════╤═══════════════════════╤═════════════════╗
║ Region A │ Region B │ CodecList │ Codec ║
╠═══════════════╪═══════════════╪═══════════════════════╪═════════════════╣
║ Region_A_Test │ Region_B_Test │ Codec list g729a │ G.729a 8k ║
╟───────────────┼───────────────┼───────────────────────┼─────────────────╢
║ Region_A_Test │ Region_A_Test │ Codec list g729 a-law │ G.711 A-Law 64k ║
╟───────────────┼───────────────┼───────────────────────┼─────────────────╢
║ Region_B_Test │ Region_B_Test │ Codec list g729 u-law │ G.711 U-Law 64k ║
╚═══════════════╧═══════════════╧═══════════════════════╧═════════════════╝
7. Create 3 Audio Codec Preference List
run sql insert into codeclist (name,description,isstandard) values ('Codec list g729a','Testing purposes for g729a','f')
run sql insert into codeclistmember (fkcodeclist,tkcodec,preferenceorder) values ((select pkid from codeclist where name like 'Codec list g729a'),(select enum from typecodec where
name like 'G.729a 8k'),1)
run sql insert into codeclist (name,description,isstandard) values ('Codec list g729 a-law','Testing purposes for g729alaw','f')
run sql insert into codeclistmember (fkcodeclist,tkcodec,preferenceorder) values ((select pkid from codeclist where name like 'Codec list g729 a-law'),(select enum from typecodec
where name like 'G.711 A-Law 64k'),1)
run sql insert into codeclist (name,description,isstandard) values ('Codec list g729 u-law','Testing purposes for g729Ulaw','f')
run sql insert into codeclistmember (fkcodeclist,tkcodec,preferenceorder) values ((select pkid from codeclist where name like 'Codec list g729 u-law'),(select enum from typecodec
where name like 'G.711 U-Law 64k'),1)
run sql insert into regionmatrix (fkregion_a,fkregion_b,videobandwidth,fkcodeclist,immersivebandwidth,audiobandwidth) values ((select pkid from region where name like
'Region_A_Test'),(select pkid from region where name like 'Region_A_Test'),6000,(select pkid from codeclist where name like 'Codec list g729 a-law'),2147483647,64)
run sql insert into regionmatrix (fkregion_a,fkregion_b,videobandwidth,fkcodeclist,immersivebandwidth,audiobandwidth) values ((select pkid from region where name like
'Region_B_Test'),(select pkid from region where name like 'Region_B_Test'),6000,(select pkid from codeclist where name like 'Codec list g729 u-law'),2147483647,64)
run sql select s1.name as Region_A, s2.name as Region_B, cdl.name as Codec_list,rgm.audiobandwidth as Audio_BW, rgm.videobandwidth as Video_BW, rgm.immersivebandwidth as
Immersive_BW from regionmatrix as rgm left join region as s2 on rgm.fkregion_b = s2.pkid left join region as s1 on rgm.fkregion_a = s1.pkid left join codeclist as cdl on cdl.pkid =
rgm.fkcodeclist order by audio_bw ASC
10. We do Receive the supported codecs for the device on the SDP content Either on Invite (early offer) or 200ok (delay offer)
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:9 G722/8000
a=rtpmap:116 iLBC/8000
a=rtpmap:124 ISAC/16000
a=rtpmap:101 telephone-event/8000
a=rtpmap:114 opus/48000/2
a=rtpmap:9 G722/8000
a=rtpmap:104 G7221/16000
a=rtpmap:105 G7221/16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=rtpmap:100 H264/90000
a=rtpmap:98 H264/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=rtpmap:111 x-ulpfecuc/8000
a=rtpmap:98 H264/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=rtpmap:111 x-ulpfecuc/8000
a=rtpmap:125 H224/4800
NOTE:
The payload (number identififer for a Codec) for the codecs that SIP protocol uses is different that the codec payload that CUCM handle internally, from the below table we can know what are they on CUCM.
If a device sends a codec on the SDP message and this is not handle by CUCM it will be ignored.
[+] From CUCM Traces we can get the region relationship for two legs
Then, MediaManager and its number of instace will show this message when we can see the codecs
We will be using the the codec list Codec list g729a this inter region is set to 8kbps, and the preference codec is G.729a 8k with payload 12
Notice that this MediaExchange creates two instances of SipInterface and checks InterRegion bandwith
10287415.008 |09:18:24.453
|AppInfo |DET-SIPInterface-(0)- CI=30514126
mrId=0 PartySide=65
HOP RegionBwKbps[ A=8 V = 6000 I = 2147483647 ] E2E RegionBwKbps[ A=8 V = 6000 I = 2147483647 ]
vid=0 AllowedCallType=0x00000001 MCast=0 port=61385 IpAddrMode(my=0 peer=0 farEnd=0) XferMode(peer=16 farEnd=0) mediaReq=0 farEndMedReq=0 PassThru(A=2 V=2) Qos(0,1) vidPref(0)
isPartyA(1) otherAgentPorts=0 FSInfo=0
10287415.010 |09:18:24.453 |AppInfo |DET-SIPInterface-(0)- CI=30514127 mrId=0 PartySide=66 HOP RegionBwKbps[ A=8 V = 6000 I = 2147483647 ] E2E RegionBwKbps[ A=8 V = 6000 I =
2147483647 ] vid=0 AllowedCallType=0x00000001 MCast=0 port=57855 IpAddrMode(my=0 peer=0 farEnd=0) XferMode(peer=16 farEnd=0) mediaReq=0 farEndMedReq=0 PassThru(A=2 V=2) Qos(0,1)
vidPref(0) isPartyA(0) otherAgentPorts=0 FSInfo=0
According to the region BW the codecs will be filtering out, we see 11 and 12, G.729 8k and G.729a 8k, respectively
10287461.014 |09:18:24.456 |AppInfo |DET-SIPInterface-(5)::filterAudioCaps, doSort=1 audioRegion=8 kbps, nAudio=1 lineIndex=0
10287461.015 |09:18:24.456 |AppInfo |DET-SIPInterface-(5)::filterAudioCaps, mAudiomLine[0].capCount=7 index=0 after filter
10287461.016 |09:18:24.456 |AppInfo |DET-MediaUtility-::getClockRateList using default clockrate 8k for codec 11
10287461.017 |09:18:24.456 |AppInfo |DET-MediaUtility-::getClockRateList using default clockrate 8k for codec 12
Then we see an SDP answer from the AudioInterface from the Call Leg B, in this case: SIPInterface(1,100,186,5), we can see the codec and the port selectd, and the IP as well
Finally we send and ACK to the Call Leg B, to send the port and the codec negotiated
10287498.001 |09:18:24.462 |AppInfo |SIPTcp - wait_SdlSPISignal: Outgoing SIP TCP message to 198.18.1.36 on port 61385 index 58492
[3841494,NET]
ACK sip:[email protected]:61385;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 198.18.133.3:5060;branch=z9hG4bKa1c5a11e74631
From: <sip:[email protected]>;tag=1228733~0a37f347-c14b-44f5-8299-186aa2addafc-30514127
To: <sip:[email protected]>;tag=005056a9a57c3c02000013a4-0000512e
Date: Wed, 01 Feb 2023 15:18:21 GMT
Call-ID: [email protected]
User-Agent: Cisco-CUCM12.5
Max-Forwards: 70
CSeq: 101 ACK
Allow-Events: presence
Session-ID: 393bcdb429c149398852e75aa1228730;remote=00007a4000105000a000005056a9a57c
Content-Type: application/sdp
Content-Length: 694
v=0
o=CiscoSystemsCCM-SIP 1228733 1 IN IP4 198.18.133.3
s=SIP Call
c=IN IP4 10.16.169.162
b=AS:24
t=0 0
m=audio 18402 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
m=video 0 RTP/AVP 31 34 96 97
a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000
a=rtpmap:96 H263-1998/90000
a=rtpmap:97 H264/90000
a=content:main
a=inactive
m=video 0 RTP/AVP 31 34 96 97
a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000
a=rtpmap:96 H263-1998/90000
a=rtpmap:97 H264/90000
a=content:slides
a=inactive
m=application 0 UDP/BFCP *
c=IN IP4 0.0.0.0
m=application 0 RTP/AVP 96
a=rtpmap:96 H224/0
a=inactive
m=application 0 UDP/UDT/IX *
10287523.001 |09:18:24.466 |AppInfo |SIPTcp - wait_SdlSPISignal: Outgoing SIP TCP message to 10.16.169.162 on port 57855 index 65669
[3841495,NET]
SIP/2.0 200 OK
Via: SIP/2.0/TCP 10.16.169.162:57855;branch=z9hG4bK00003427
From: "1134" <sip:[email protected]>;tag=bc542fe2ecfc06aa00005d75-00000afe
To: <sip:[email protected];user=phone>;tag=1228730~0a37f347-c14b-44f5-8299-186aa2addafc-30514126
Date: Wed, 01 Feb 2023 15:18:21 GMT
Call-ID: [email protected]
CSeq: 101 INVITE
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
Allow-Events: presence
Supported: replaces
Server: Cisco-CUCM12.5
Call-Info: <urn:x-cisco-remotecc:callinfo>; security= NotAuthenticated; orientation= to; gci= 1-17041; isVoip; call-instance= 1
Send-Info: conference, x-cisco-conference
Session-ID: 00007a4000105000a000005056a9a57c;remote=393bcdb429c149398852e75aa1228730
Remote-Party-ID: "Adam McKenzie - X6016" <sip:[email protected]>;party=called;screen=yes;privacy=off
Contact: <sip:[email protected]:5060;transport=tcp>;+u.sip!devicename.ccm.cisco.com="UCSFAMCKENZIE";video;bfcp
Content-Type: application/sdp
Content-Length: 348
v=0
o=CiscoSystemsCCM-SIP 1228730 1 IN IP4 198.18.133.3
s=SIP Call
c=IN IP4 198.18.1.36
b=TIAS:8000
b=AS:24
t=0 0
a=cisco-mari:v1
a=cisco-mari-rate
m=audio 24632 RTP/AVP 18 101
a=extmap:14/sendrecv http://protocols.cisco.com/timestamp#100us
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15`~