I need to modify this script to change this header. Can any one pls help me on this.
From
Remote-Party-ID "London Test" ;party=calling;screen=yes;privacy=off
To
Remote-Party-ID "London Test" ;party=calling;screen=yes;privacy=full
The script is
M = {}
function M.outbound_INVITE(msg)
local fromtag = msg:getHeaderValueParameter("From", "tag")
local pai = msg:getHeader("P-Asserted-Identity")
local uri = string.match(pai, "(<sip:%+4420.+>)")
local uri2 = string.match(pai, "(<sip:%+441785.+>)")
if uri or uri2
then
msg:modifyHeader("From", "Anonymous <sip:anonymous@anonymous.invalid>")
msg:addHeaderValueParameter("From", "tag", fromtag)
msg:addHeader("Privacy", "id")
end
end
return M
tried
function M.outbound_INVITE(msg)
local remote = msg:getHeader("Remote-Party-ID")
local privacy = string.find(remote, "off")
local target = string.sub(remote, privacy)
local replace = string.gsub(target, "full")
msg:modifyHeader("Remote-Party-ID", replace)
end
return M
but failed