Script
within session "ALL" //Looks into all the messages
{
/* Message should be a request "act on request" and the messages coming towards the SBCE should be considered, i.e. the destination of the message should be SBCE "%DIRECTION="INBOUND". The actions are invoked as soon as the message comes from the wire(%ENTRY_POINT="AFTER_NETWORK") */
act on request where %DIRECTION="INBOUND" and %ENTRY_POINT="AFTER_NETWORK"
{
/*Checks if the first P-Asserted-Identity header is present/exists in
the message. Each header is represented as %HEADERS[“<Header-name>”]
[<Header position>].For headers such as From and Contact, the Header
Position is always 1.For headers like Via and P-Asserted-Identity,
the positions can range from 1 to n*/
if(exists(%HEADERS["P-Asserted-Identity"][1]))then
{
remove(%HEADERS["P-Asserted-Identity"][1]); //Remove the header
}
/*If the P-Asserted-Identity header is not found in the message*/
else
{
/* Add a SIP and a telephone URI.*/
%HEADERS["P-Asserted-Identity"][1] = "12345<sip:12345@192.168.150.150>";
%HEADERS["P-Asserted-Identity"][2] = "tel:+14085264000";
}
}
}