cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
233
Views
0
Helpful
0
Replies

Is correct this SIP Normalization Script to modify a Contact Header?

david.alfaro1
Level 1
Level 1

Hello Dears

 

I hope you are doing well

 

We wan to modify a Contact Header in an inbound REGISTER message in the CUCM, since that REGISTER message is coming from third party telephones (AVAYA).

From this one

 

Contact: <sip:72012@10.17.101.191:43881;transport=tcp>;q=1;expires=3600;+sip.instance="<urn:uuid:d84492bc-8df5-41db-839d-965183f765c0>";reg-id=1;mobility="fixed";+av.sip.iptolerance;+av.sip.sig=4;avaya-actions="presence.initiate-pubsub, presence.redirect"

To this one

Contact: <sip:72012@10.17.101.191:43881;transport=tcp>;q=1

The Script is the following.

M = {}

trace.enable()

function M.inbound_REGISTER(msg)
local contacto = msg:getHeader("Contact")
if contacto
then
local parametro = "q=1"
contact1 = contact:gsub("(.*<sip:.*>;).*", "%1" .. parametro)
trace.format("Contact header, setting to: %s", contact1)
msg:modifyHeader ("Contact", contact1)
end
end

return M

Is this script edited correctly for the aforementioned purpose?

 

Kind regards,

0 Replies 0