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 firstname.lastname@example.org. Verizon wants to see email@example.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.
I guess it would be the request URI. The first first line in the invite.
INVITE sip:firstname.lastname@example.org;user=phone SIP/2.0
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.
local method, ruri, ver = msg:getRequestLine()
local nuri = sipUtils.parseUri(ruri)
local nUser = nuri:getUser()
local nHost = nuri:getHost()
local newHost = "domain.com"
--create new Request URI
newRuri = string.format("sip:%s@%s", nUser, newHost)