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

SIP Normalization SCRIPT CUCM

Hi

 

I need to change the inbound messages form my Elastix to CUCM with NAT Problem

 

FROM

 

To: <sip:2785@10.9.5.8>;tag=55175~d89b35a4-e372-491a-b327-2b984a9839b6-30232487

 

TO

 

To:<2785@10.1.1.1>;tag=55175~d89b35a4-e372-491a-b327-2b984a9839b6-30232487

 

I dont have any knowlegth about Scripting Lenguage, but i build this script form the next document

 

http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/sip_tn/8_5_1/sip_t_n/3-sip_msg.html#wp1074754

 

M = {}
function M.outbound_INVITE(msg)
msg:modifyHeader("To", "Host","10.1.1.1")
end
return M

 

This work or not?

Everyone's tags (4)
1 REPLY 1
Highlighted
VIP Advisor

I see two errors:

I see two errors:

1) You said "inbound" in your description, but your example is for an outbound INVITE.

2) You are providing three parameters to the modifyHeader function, but it only takes two

Alos, keep in mind that if you need to modify the IP address because of NAT, then you'll likely need to modify it in every single type of message (requests and responses), not just the inbound INVITEs.  Plus you'll need it in all headers (E.g., Via) which might contain the 10.9.5.8 address.

This is probably easier with a firewall which can do deep packet inspection and re-write the addresses for you automatically.

 

At any rate, to help you with your single INVITE request change on the To header, try this:

 

M = {}

function M.inbound_INVITE(msg)
    local orig_to = msg:getHeader("To")
    local new_to = orig_to:gsub("10.9.5.8", "10.1.1.1")
    msg:modifyHeader("To", new_to)
end

return M

 


Anthony Holloway
CreatePlease to create content
Content for Community-Ad
FusionCharts will render here