cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
655
Views
0
Helpful
0
Replies

SIP normalization script

Michael Schmidt
Level 1
Level 1

Hi,

 

I need a SIP normatlization script which change "Unavailable" into "anonymos" and set "Privacy=none" to "Privacy=on"

 

How the SIP normalization script should look like for this?

 

OLD:

From: “Anonymous “ <sip:Unavailable@93.122.123.101>
P-Asserted-Identity: <sip:<phonenumber>@domain_1.com:5060;user=phone?Privacy=none>
Diversion: <sip:<phonenumber>@domain_2.com:5060;user=phone>;reason=unknown;counter=1;privacy=off

NEW:

From: “Anonymous “ <sip:anonymos@93.122.123.101>
P-Asserted-Identity: <sip:<phonenumber>@domain_1.com:5060;user=phone?Privacy=on>
Diversion: <sip:<phonenumber>@domain_2.com:5060;user=phone>;reason=unknown;counter=1;privacy=off

 

The "problem" also is that there already is on existing SIP normalization script which should be combined with the first one.

 

Existing script:

 

M = {}
function M.inbound_200_INVITE(msg)
local contact = msg:getHeader("Contact")
local pai = msg:getHeader("P-Asserted-Identity")
local contact2 = string.match(contact, "<.*@")
contact2 = contact2:gsub("@", "")
local pai2 = string.match(pai, "@.*")
local newpai = contact2 .. pai2
msg:modifyHeader("P-Asserted-Identity", newpai)
end
return M

 

 

 

 

BR

Michael

0 Replies 0