Script
within session "INVITE"
{
/*Look for REFER messages only. This is specified with the extra condition %METHOD="REFER" in the "where" clause*/
act on request where %DIRECTION="INBOUND" and %ENTRY_POINT="AFTER_NETWORK" and %METHOD="REFER"
{
/* The User portion of the URI in the "Refer-To" header is checked to see if it starts with the prefix 011. If it does, then it is replaced with an empty string. If URI.USER does not match the regex, then the action is ignored and the message is left intact.*/
%HEADERS["Refer-To"][1].URI.USER.regex_replace("^011","");
}
}