Separated vicidial-auto dialplan entries into different contexts

Added phone_context as option in bulk phone insert script

git-svn-id: svn://192.168.202.10@1783 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2012-02-09 21:03:36 +00:00
parent bfa4db86c1
commit bddbae3886
5 changed files with 69 additions and 9 deletions
+10
View File
@@ -794,6 +794,16 @@ OTHER CHANGES:
crontab after-hours to gather the statistics (this example is 7:01am):
1 7 * * * /usr/share/astguiclient/AST_dialer_inventory_snapshot.pl -q --override-24hours
182. Separated the auto-generated dialplan into different contexts to allow for
easier segmentation of dialing permissions using the Phone Context and
custom Call Menus. Here is a list of the new contexts that are now below
the vicidial-auto context:
vicidial-auto-system-setting-custom
vicidial-auto-server-custom
vicidial-auto-external
vicidial-auto-internal
vicidial-auto-phones
+38 -5
View File
@@ -69,6 +69,7 @@
# 111004-2333 - Added Call Menu option for update of fields
# 111221-1454 - Added resetting of max stats records at timeclock end of day
# 120124-1032 - Added Answer to all call menus at the top
# 120209-1525 - Separated all vicidial-auto dialplan contexts into their own contexts to allow for more control of dialing access through phones
#
$DB=0; # Debug flag
@@ -2514,16 +2515,48 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
print ext "; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST\n";
print ext "$ext\n";
print ext "$call_menu_ext\n";
print ext "\n";
if (length($SScustom_dialplan_entry)>5)
{
print ext "[vicidial-auto-system-setting-custom]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "; System Setting Custom Dialplan\n$SScustom_dialplan_entry\n\n";
}
if (length($SERVERcustom_dialplan_entry)>5)
{
print ext "[vicidial-auto-server-custom]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "; Server Custom Dialplan\n$SERVERcustom_dialplan_entry\n\n";
}
print ext "[vicidial-auto-external]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "$Lext\n";
print ext "[vicidial-auto-internal]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "$Vext\n";
print ext "[vicidial-auto-phones]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "$Pext\n";
print ext "[vicidial-auto]\n";
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
print ext "\n";
print ext "\n";
if (length($SScustom_dialplan_entry)>5)
{print ext "; System Setting Custom Dialplan\n$SScustom_dialplan_entry\n\n";}
{print ext "include => vicidial-auto-system-setting-custom\n";}
if (length($SERVERcustom_dialplan_entry)>5)
{print ext "; Server Custom Dialplan\n$SERVERcustom_dialplan_entry\n\n";}
print ext "$Lext\n";
print ext "$Vext\n";
print ext "$Pext\n";
{print ext "include => vicidial-auto-server-custom\n";}
print ext "include => vicidial-auto-external\n";
print ext "include => vicidial-auto-internal\n";
print ext "include => vicidial-auto-phones\n";
print ext "\n";
print ext "\n; END OF FILE\n";
print iax "; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST\n";
+3
View File
@@ -23,6 +23,9 @@ As of 2009-11-23, DID and IVR logging through QueueMetrics queue_log is now part
As of 2010-03-09, queuemetrics_loginout system settings option was added to allow for slightly different logging of logins and logouts. STANDARD will use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently.
NOTE: having a large number of calls in queue can lead to significant load issues on the QM database server
Entries you should have in your crontab on one server:
### fix the vicidial_agent_log once every hour and the full day run at night
@@ -2721,8 +2721,10 @@ INSERT INTO vicidial_drop_rate_groups SET group_id='110';
INSERT INTO vicidial_process_triggers SET trigger_id='LOAD_LEADS',server_ip='10.10.10.15',trigger_name='Load Leads',trigger_time='2009-01-01 00:00:00',trigger_run='0',trigger_lines='/usr/share/astguiclient/VICIDIAL_IN_new_leads_file.pl';
INSERT INTO vicidial_call_menu SET menu_id='defaultlog',menu_name='logging of all outbound calls from agent phones',menu_prompt='sip-silence',menu_timeout='20',menu_timeout_prompt='NONE',menu_invalid_prompt='NONE',menu_repeat='0',menu_time_check='0',call_time_id='',track_in_vdac='0',custom_dialplan_entry='exten => _X.,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y)\nexten => _X.,n,Goto(default,${EXTEN},1)',tracking_group='';
INSERT INTO vicidial_call_menu SET menu_id='default---agent',menu_name='agent phones restricted to only internal extensions',menu_prompt='sip-silence',menu_timeout='20',menu_timeout_prompt='NONE',menu_invalid_prompt='NONE',menu_repeat='0',menu_time_check='0',call_time_id='',track_in_vdac='0',custom_dialplan_entry='include => vicidial-auto-internal\ninclude => vicidial-auto-phones\n',tracking_group='';
INSERT INTO vicidial_call_menu_options SET menu_id='defaultlog',option_value='TIMEOUT',option_description='hangup',option_route='HANGUP',option_route_value='vm-goodbye',option_route_value_context='';
INSERT INTO vicidial_call_menu_options SET menu_id='default---agent',option_value='TIMEOUT',option_description='hangup',option_route='HANGUP',option_route_value='vm-goodbye',option_route_value_context='';
INSERT INTO vicidial_scripts (script_id,script_name,script_comments,active,script_text) values('CALLNOTES','Call Notes and Appointment Setting','','Y','<iframe src=\"../agc/vdc_script_notes.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--\" style=\"background-color:transparent;\" scrolling=\"auto\" frameborder=\"0\" allowtransparency=\"true\" id=\"popupFrame\" name=\"popupFrame\" width=\"--A--script_width--B--\" height=\"--A--script_height--B--\" STYLE=\"z-index:17\"> </iframe>');
@@ -9,10 +9,11 @@
# 101230-0501 - First Build
# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP
# 120104-2023 - Added webphone options
# 120209-1545 - Added phone context option
#
$admin_version = '2.4-3';
$build = '120104-2023';
$admin_version = '2.4-4';
$build = '120209-1545';
require("dbconnect.php");
@@ -50,6 +51,8 @@ if (isset($_GET["webphone_auto_answer"])) {$webphone_auto_answer=$_GET["webpho
elseif (isset($_POST["webphone_auto_answer"])) {$webphone_auto_answer=$_POST["webphone_auto_answer"];}
if (isset($_GET["use_external_server_ip"])) {$use_external_server_ip=$_GET["use_external_server_ip"];}
elseif (isset($_POST["use_external_server_ip"])){$use_external_server_ip=$_POST["use_external_server_ip"];}
if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];}
elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];}
if (strlen($action) < 2)
@@ -71,11 +74,12 @@ if ($non_latin < 1)
$alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option);
$alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix);
$protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol);
$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt);
$local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt);
$is_webphone = ereg_replace("[^NY]","",$is_webphone);
$webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad);
$webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer);
$use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip);
$phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context);
} # end of non_latin
else
{
@@ -215,6 +219,11 @@ if ($action == "HELP")
<B>Local GMT -</B> This is the time zone that all of the phones will be created with.
<BR><BR>
<A NAME="phone_context">
<BR>
<B>Phone Context -</B> This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default.
<BR><BR>
<BR>
<A NAME="is_webphone">
<BR>
@@ -306,6 +315,7 @@ if ($action == "BLANK")
echo "<tr bgcolor=#B6D3FC><td align=right>Alias Suffix: </td><td align=left><input type=text name=alias_suffix size=2 maxlength=4> $NWB#alias_suffix$NWE </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Client Protocol: </td><td align=left><select size=1 name=protocol><option>SIP</option><option>Zap</option><option>IAX2</option><option>EXTERNAL</option></select> $NWB#protocol$NWE </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local GMT: </td><td align=left><select size=1 name=local_gmt><option>12.75</option><option>12.00</option><option>11.00</option><option>10.00</option><option>9.50</option><option>9.00</option><option>8.00</option><option>7.00</option><option>6.50</option><option>6.00</option><option>5.75</option><option>5.50</option><option>5.00</option><option>4.50</option><option>4.00</option><option>3.50</option><option>3.00</option><option>2.00</option><option>1.00</option><option>0.00</option><option>-1.00</option><option>-2.00</option><option>-3.00</option><option>-3.50</option><option>-4.00</option><option selected>-5.00</option><option>-6.00</option><option>-7.00</option><option>-8.00</option><option>-9.00</option><option>-10.00</option><option>-11.00</option><option>-12.00</option></select> (Do NOT Adjust for DST) $NWB#gmt$NWE </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Context: </td><td align=left><input type=text name=phone_context size=20 maxlength=20> $NWB#phone_context$NWE </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Set As Webphone: </td><td align=left><select size=1 name=is_webphone><option>Y</option><option selected>N</option></select>$NWB#is_webphone$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone Dialpad: </td><td align=left><select size=1 name=webphone_dialpad><option selected>Y</option><option>N</option><option>TOGGLE</option><option>TOGGLE_OFF</option></select>$NWB#webphone_dialpad$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Webphone Auto-Answer: </td><td align=left><select size=1 name=webphone_auto_answer><option selected>Y</option><option>N</option></select>$NWB#webphone_auto_answer$NWE</td></tr>\n";
@@ -424,6 +434,8 @@ if ($action == "ADD_PHONES_SUBMIT")
{$dialplan_number = "$dialplan_prefix$PN[$p]";}
else
{$dialplan_number = "$PN[$p]";}
if (strlen($phone_context) < 1)
{$phone_context = 'default';}
$dialplan_number = preg_replace('/\D/', '', $dialplan_number);
$voicemail_id = $PN[$p]; $voicemail_id = preg_replace('/\D/', '', $voicemail_id);
$phone_server_ip = $SN[$s];
@@ -431,7 +443,7 @@ if ($action == "ADD_PHONES_SUBMIT")
$phone_type = "CCagent";
$fullname = "ext $PN[$p]";
$stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip');";
$stmt = "INSERT INTO phones (extension,dialplan_number,voicemail_id,server_ip,login,pass,status,active,phone_type,fullname,protocol,local_gmt,outbound_cid,conf_secret,is_webphone,webphone_dialpad,webphone_auto_answer,use_external_server_ip,phone_context) values('$extension','$dialplan_number','$voicemail_id','$phone_server_ip','$login','$pass','ACTIVE','Y','$phone_type','$fullname','$protocol','$local_gmt','0000000000','$conf_secret','$is_webphone','$webphone_dialpad','$webphone_auto_answer','$use_external_server_ip','$phone_context');";
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ($DB > 0) {echo "$s|$p|$SN[$s]|$PN[$p]|$affected_rows|$stmt\n<BR>";}