×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

Modifying Sip Header in call manager (Sip Normalization)

Blog

Thu, 03/27/2014 - 17:29
Mar 12th, 2012
User Badges:
  • Cisco Employee,

     Overview


Sip normalization is a method used to modify sip messages sent from the call manager out the sip trunk. Before call manager 8.5 if we had to modify the sip messages the same had to be done by using a CUBE and appliying sip profiles on dial peers.


It is normally required in a scenario when you are integrated with a third party sip server and they have specific requirements in terms of information coming from the cisco side.



Topology


         Cisco call manager (8.5 and above) ---> sip trunk -----> third party sip server



Normalization Scripts


  1. Sip normalization is a C script which enables us to change the various headers fields of a SIP messgae such as invite , from to, 181 etc.
  2. We create a recusrive function call, and enter the queries in a if else format.
  3. Following are the steps to apply a normalization scrip on calls:


  • On the call manager admin page go to device
  • Navigate to device settings and select sip mormalization script under it.
  • Click on add new. Name the scipt something according to your naming conventions.


Below is a example of a default script where in we need to change the from feild in the SIP invite message and add "user=phone" tag.


Default Invite



INVITE sip:[email protected]:5060 SIP/2.0

Via: SIP/2.0/UDP 0.0.0.0:5060;branch=z9hG4bK2938b58562

From: <sip:[email protected]>;tag=241~f88ceed7-4ccc-49aa-ad02-4534616cc344-29414802

To: <sip:[email protected]>

Date: Wed, 07 Mar 2012 02:14:07 GMT

Call-ID: [email protected]

Supported: timer,resource-priority,replaces

Min-SE:  1800

User-Agent: Cisco-CUCM8.5

Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY

CSeq: 101 INVITE

Expires: 180

Allow-Events: presence

Supported: X-cisco-srtp-fallback

Supported: Geolocation

Cisco-Guid: 0917276416-0000065536-0000000037-0083927212

Session-Expires:  1800

P-Asserted-Identity: <sip:[email protected]>

Remote-Party-ID: <sip:[email protected]>;party=calling;screen=yes;privacy=off

Contact: <sip:[email protected]:5060>

Max-Forwards: 70

Content-Length: 0


           


Modified Invite



INVITE sip:[email protected];user=phone SIP/2.0

Via: SIP/2.0/UDP 0.0.0.0:5060;branch=z9hG4bK380671373

From: 7024343344 <sip:[email protected];user=phone>;tag=00404d0102030a0a0a36-4950fca5

To: <sip:[email protected];user=phone>

Call-ID: [email protected]

CSeq: 2 INVITE

Contact: <sip:[email protected];user=phone>

Authorization: Digest username="476119065202", realm="BroadWorks", nonce="BroadWorksXgt37bop3Td0105nBW", uri="sip:[email protected];user=phone", response="4a8491694347451bd28dd2b5c35bc1a8", algorithm=MD5, cnonce="702c5d07", qop=auth, nc=00000001

Max-Forwards: 70

User-Agent: HST-3000/6.0.0

Unsupported: 100rel

Supported: resource-priority

Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, NOTIFY, INFO

Content-Type: application/sdp

Content-Length:   133


As observed above we need to add a tag "user=phone" in the from message.


Normalization Script


M = {}


function M.outbound_INVITE(msg)


   msg:addHeaderUriParameter("From", "user", "phone")


end


return M




This script is a recursive C function call. We created a function M.outbound_INVITE(msg) which is for outbound calls and will affect the invite message.

It will modify the from field to the desired results.


  • After adding the script save the same.
  • Go to the SIP trunk configured for out bound calls.
  • Choose this script on the SIP trunk and then save it.



Important Links


Link for SIP normalization scripts:


http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/sip_tn/8_5_1/10-sip_transparency.html




Hope this helpful.

Loading.
Mark VandeVere Mon, 09/09/2013 - 10:08
User Badges:

This is good to know it is available and the link to documentation is appreciated. I have a situation where this needs to happen, so I will be exploring in detail over the next several days.

Actions

This Blog

Related Content