I am experimenting with dialing directly to our Oracle SBC's (instead of tandeming through another product that does translations for us). However, our Verizon SIP service requires the INVITE to have a specific domain in the INVITE message. Right now the invite from CUCM just has 5551112222@1.1.1.1. Verizon wants to see 5551112222@verizondomain.com. Does anyone have a LUA scrip that can accomplish this? I've seen a lot of scripts out there, but nothing that changes the INVITE domain. Thanks for any tips.
Robert
Hi Robert,
Are you saying you want to change the request URI or the To: header?
Mark
I guess it would be the request URI. The first first line in the invite.
2017-07-10 09:53:30.344
INVITE sip:5551112233@1.1.1.1;user=phone SIP/2.0
Robert
Hi Robert,
I thought that might be the case. You have to use the getRequestLine() and setRequestUri() functions to change that. Have a look at the below, it should get you started. You could also input the domain through a Normalization Script parameter, so you don't have to edit the script to change the domain.
Mark
local method, ruri, ver = msg:getRequestLine()
local nuri = sipUtils.parseUri(ruri)
if nuri
then
local nUser = nuri:getUser()
local nHost = nuri:getHost()
local newHost = "domain.com"
--create new Request URI
newRuri = string.format("sip:%s@%s", nUser, newHost)
msg:setRequestUri(newRuri)
end
Great. I'll give this a shot. Thank you very much!
Robert