Hello. I'm looking to remove and replace the FROM header as the invite ingresses from Skype for Business into CUCM. Would the below script accomplish this? The invite currently just says "first.last@test.com:10.1.1.1". I'm looking to replace it with a phone number so its routable. Any help is appreciated.
Robert
M={}
function M.outbound_INVITE(msg)
local from = msg:getHeader("FROM") --Get FROM Header
local b = string.gsub(from, "(<sip:.+@)", "<sip:5551112222") --New FROM Header
msg:modifyHeader("From", b) --Replace FROM Header
end
return M
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Robert,
Have moved your question under UC Manager SIP community. Please refer this url for related information
https://communities.cisco.com/thread/73584?start=0&tstart=0
Thanks and Regards,
Geevarghese
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Robert,
Since the SIP INVITE is being received by Unified CM from S4B, it is an "inbound_INVITE" from the perspective of SIP Normalization.
BTW, There's a couple other minor tweaks I would make to your above...
M={}
function M.outbound_INVITE(msg)
local from = msg:getHeader("From") --Get FROM Header
local b = string.gsub(from, "<sip:.+@", "<sip:5551112222@") --New FROM Header
msg:modifyHeader("From", b) --Replace FROM Header
end
return M
I always use header names using a format of "From" rather than "FROM".
Since you aren't trying to 'capture' what you matched, the () in your match string aren't needed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK, thank you very much!
Robert
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.