Polycom DMA 7000 System Microscope & Magnifier User Manual


 
Sample Preliminary and Postliminary Scripts Call Server Configuration
Polycom, Inc. 239
///////////////////////////////
// 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";
}
See also:
“Dial Rules” on page 225
“Script Debugging Dialog Box for Preliminaries/Postliminaries” on
page 235
“External Gatekeeper” on page 91
“External SIP Peer” on page 96