DMA OperationsGuide Preliminary/Postliminary Scripting
260 Polycom, Inc.
///////////////////////////////
// FILTER (Site)
// Do not allow callers from the atlanta site to use this rule.
// (Caller site == "atlanta") --> NEXT_RULE
if(CALLER_SITE_NAME == "atlanta")
{
return NEXT_RULE;
}
///////////////////////////////
// SITE BASED NUMERIC NICKNAMES
// Allow caller to omit country and area code when calling locally.
// Assumes that country and area codes are set in site topology.
// Assumes that all endpoints are registered with their full alias, including
// country and area code.
// 5551212 --> 14045551212
if(DIAL_STRING.length == CALLER_SITE_DIGITS)
{
DIAL_STRING = CALLER_SITE_COUNTRY_CODE + CALLER_SITE_AREA_CODE + DIAL_STRING;
}
else if(DIAL_STRING.length == ( parseInt(CALLER_SITE_AREA_CODE.length,10)
+ parseInt(CALLER_SITE_DIGITS,10)))
{
DIAL_STRING = CALLER_SITE_COUNTRY_CODE + DIAL_STRING;
}
///////////////////////////////
// SITE BASED NUMERIC NICKNAMES (SIP)
// Allow caller to omit country and area code when calling locally.
// Assumes that country and area codes are set in site topology.
// Assumes that all endpoints are registered with their full alias, including
// country and area code.
// sip:5551212@example.com --> sip:14045551212@example.com
if(DIAL_STRING.toLowerCase().match(/^sip:[^@]*@example\.com/))
{
user = DIAL_STRING.replace(/^sip:([^@]*)@.*/i,"$1");
if(user.length == CALLER_SITE_DIGITS)
{
user = CALLER_SITE_COUNTRY_CODE + CALLER_SITE_AREA_CODE + user;
}
else if(user.length == ( parseInt(CALLER_SITE_AREA_CODE.length,10)
+ parseInt(CALLER_SITE_DIGITS,10)))
{
user = CALLER_SITE_COUNTRY_CODE + user;
}
DIAL_STRING = "sip:" + user + "@example.com";
}