Hi Everyone.
Hope you all are doing well.
I was just learning about SIP Normalization Script in my Lab Environment . I have two phone with extension 6001 and 6002 . I want to manipulate FROM header , where if i call from 6002 , it should show 60225588 . I wrote the below script and it worked.
M={}
function M.outbound_INVITE(msg)
local from = msg:getHeader("From") --Get FROM Header
local b = string.gsub(from, "02@", "225588@") --New FROM Header
msg:modifyHeader("From", b) --Replace FROM Header
end
return M
But instead of this I want that when any call comes from 60xx , it will remove xx will be replaced by a new value. So after post normalization the from number should be 60225588 only. How would I write the script ?
I know using transformation we can implement but just for learning I am looking into it.
Thanks in advance.
@cucmadmin