cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
43710
Views
65
Helpful
91
Comments
Sreekanth Narayanan
Cisco Employee
Cisco Employee

 

 

I have recorded this guide for SIP Normalization on call manager and also have elaborated a little bit on how we use the Lua scripting.

 

A SIP Normalization script could really help the customer as a workaround or a permanent solution for issues related to calling and CLID.

 

Disclaimer:

Cisco TAC does NOT support SIP Normalization scripts. If the customer has already applied a script, TAC does NOT troubleshoot it. It is the customer's responsiblity to make it work.

91 Comments

i test this script but no Change

 

M = {}
function M.outbound_INVITE(msg)
 msg:modifyHeader("Contact", "2099006t0")

end
return M

 

for my understanding i cann only Change the From  

Question it is possible to Change the From

 

From: <sip:"SIPID"@10.10.10.251>;tag=3535~14bb5db7-95a9-4db0-864a-a21a1f2e14ad-

 

Sreekanth Narayanan
Cisco Employee
Cisco Employee

If the script doesn't change the message, then you'll need to take the traces on the CUCM to see if the script got executed and hit some error.

You will need detailed CUCM traces for it.

Yes you can change the From.

M={}

function M.outbound_INVITE(msg)

    local from = msg:getHeader("From")

    local b = string.gsub(a, "(<sip:.+@)", "<sip:200xxt50@")

    msg:modifyHeader("From", b)

end

return M

   

Hi Thanks for your replay ! but i still have error

 

00226559.005 |20:28:49.629 |AlarmErr |AlarmClass: CallManager, AlarmName: SIPNormalizationScriptError, AlarmSeverity: Error, AlarmMessage: , AlarmDescription: A script error occurred, AlarmParameters: DeviceName:NS_SIP_TRUNK, ScriptName:sipgate, ScriptFunction:M.outbound_INVITE, ScriptType:Custom, ErrorCode:3, ErrorCodeText:Execution Error, ErrorMessage:sipgate at line 7: bad argument #1 to 'gsub' (string expected, got nil), ConfiguredAction:Rollback Only, ResultingAction:Rollback Only, InUseMemory:1306, MemoryThreshold:51200, InUseLuaInstructions:0, LuaInstructionThreshold:1000, AppID:Cisco CallManager, ClusterID:StandAloneCluster, NodeID:NS-CUCM,

 

Also both the INVITE line and the FROM field appear to be unchanged:

 

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Thats because the string.gsub function is getting 'a' as the first argument. Change it to from, because that is the variable.

local b = string.gsub(from, "(<sip:.+@)", "<sip:200xxt50@")

hi just get the ISP

there are expecting this informations:

 INVITE sip:021163553355@sipconnect.sipgate.de:5060 SIP/2.0

To: sip:021163553355@sipconnect.sipgate.de:5060

From: sip:SIP-ID@sipconnect.sipgate.de:5060;tag=c32f2811

 

My CUCS is sending :

INVITE sip:496917320884@sipconnect.sipgate.de:5060 SIP/2.0   is ok

From: <sip:4921163558628806@10.10.10.251>;tag=2044~14bb5db7-95a9-4db0-864a-a21a1f2e14ad-18282657  not ok

To: <sip:496917320884@sipconnect.sipgate.de>  is ok

we only have to Change the from Line

Thanks

Hi Screekanth !

THANKS A LOT for your Help ! ! the Trunk is UP now ! i just have tu Setup the CUCM correctly to get the Phone working

 

Thanks Thanks

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Great! Enjoy scripting further!

Hello, how can I Download the Video?

Regards

Armin

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Hi Armin,

I don't think you can download this video unfortunately. Only the streaming option is allowed.

 

Thanks

alan_baker
Level 1
Level 1

Hi Sreekanth,

Firstly.. the video was informative and provided a good insight on the subject. So thanks for the tutorial.

My query is: Is it possible to do a Ldap lookup in the script for replacing/ adding values to the "From" field based on the name associated with the number in the Ldap?

eg. If a number 4444 (a third party device not capable of forwarding caller id info - clid/cnid) is making a call to a cisco call manager cluster and the number 4444 is associated with the name "XXX" in LDAP, would it be possible to show XXX in the caller id instead of 4444?

Thanks in advance.

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Hi Alan,

 

Thanks for your kind words. Glad it helped.

No, unfortunately, such API has not been provided by the developers. We cannot run functions that call the LDAP search and perform actions on the output.

You will need to figure out a pattern and then make changes based on "if" conditions in the script.

 

Thanks

Hi Sreekanth,

 

I find this thread very useful, but i have a question, do you know if there is any recommendations for the Memory and LUA instructions thresholds? I assume it may be dependant on the load of the server or even on the size of the script.

 

Thanks in advance.

 

Carlos M. 

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Hi Carlos,

No, there isn't any recommendation for memory and lua instruction thresholds.

 

Thanks

Sreekanth

akshay.misra87
Level 1
Level 1

Hi Mr Sreekanth,

 

Very good and informative video!!

I have the same requirement as posted below by Alan Baker. 

I know there are no functions that call the LDAP search and perform actions on the output.

Is there any workaround to that? I mean maybe i can save all my contacts in an external file and maybe perform a search there to map the usernames?

Please suggest something. There are around 14000 users!

 

Thanks in advance.

 

Akshay

Sreekanth Narayanan
Cisco Employee
Cisco Employee

Hi Akshay,

 

Thanks for your kind words!

Unfortunately, no, we can't parse a file located on the CUCM and link that to the sip normalization script. The workaround would need to performed out of the scope of the normalization script.

 

Regards,

Sreekanth

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links