cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
193
Views
0
Helpful
1
Replies
Highlighted
Beginner

Cisco CUCM: SIP Normalization Script

Hi there,

 

I want to covert a SIP Profile to SIP Normalization Script using LUA scripting. 

 

The SIP Profile is below:

 

!
voice class sip-profiles 10
response ANY sip-header P-Asserted-Identity modify "<sip:(.*)@.*>" "<sip:1234@name.local>"
request ANY sip-header P-Asserted-Identity modify "<sip:(.*)@.*>" "<sip:1234@name.local>"
!

Any help will be greatly appreciated. 

 

Thanks & Regards,

 

Sam

1 REPLY 1
VIP Advisor

Re: Cisco CUCM: SIP Normalization Script

The first thing I should say is, that I didn't validate this.  So, please give it a try and let me know if it does or doesn't work.

Second, you're using the grouping with parenthesis in there, but for no reason, so I omitted them.

Third, I'm making the assumption that you are applying this in the outbound direction.

M = {}

local function normalize_pai(msg)
    local old_pai = msg:getHeader("P-Asserted-Identity")
    local new_pai = string.gsub(old_pai, "<sip:.+>", "<sip:1234@name.local>")
    msg:modifyHeader("P-Asserted-Identity", new_pai)
end

M.outbound_ANY = normalize_pai
M.outbound_ANY_ANY = normalize_pai

return M

Last, I should mention that there is a method called applyNumberMask, which allows you to manipulate the user portion of the URI just like how CUCM does Transformation masks.  This might be useful if you didn't want to set every call to the same PAI value, but rather, transform it.


Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards
This widget could not be displayed.