Preliminary/Postliminary Scripting Call Server Configuration
Polycom, Inc. 259
///////////////////////////////
// SUBSTITUTE DOMAIN (SIP)
// If the dial string is a SIP URI, change the domain part to "example.com"
// SIP:1234@abc.com --> sip:1234@example.com
DIAL_STRING = DIAL_STRING.replace(/^sip:([^@]*)@(.*)/i,"sip:$1@example.com");
///////////////////////////////
// FILTER
// If the dial string has prefix 99, do not match on this rule. Skip to the next rule.
// 991234 --> NEXT_RULE
if(DIAL_STRING.match(/^99/))
{
return NEXT_RULE;
}
///////////////////////////////
// FILTER (Inverted)
// Do not match on this rule unless the dial string has prefix 99.
// 1234 --> NEXT_RULE
if(!DIAL_STRING.match(/^99/))
{
return NEXT_RULE;
}
///////////////////////////////
// FILTER (SIP)
// If the dial string is a SIP URI with domain "example.com", do not match on this rule.
// Skip to the next rule.
// sip:1234@example.com --> NEXT_RULE
if(DIAL_STRING.toLowerCase().match(/^sip:[^@]*@example\.com/))
{
return NEXT_RULE;
}
///////////////////////////////
// PRINTLN
// Print out the information available to the script for this call.
//
println("DIAL_STRING: " + DIAL_STRING);
println("CALLER_SITE_NAME: " + CALLER_SITE_NAME);
println("CALLER_SITE_COUNTRY_CODE: " + CALLER_SITE_COUNTRY_CODE);
println("CALLER_SITE_AREA_CODE: " + CALLER_SITE_AREA_CODE);
println("CALLER_SITE_DIGITS: " + CALLER_SITE_DIGITS);
println("CALLER_H323ID: " + CALLER_H323ID);
println("CALLER_E164: " + CALLER_E164);
println("CALLER_TEL_URI: " + CALLER_TEL_URI);
println("CALLER_SIP_URI: " + CALLER_SIP_URI);