From 8b192b433f70cf104aa03abaca70d84a446212b0 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 6 Dec 2009 05:53:23 +0000 Subject: [PATCH] Added Consultative checkbox to a newly redesigned transfer-conf panel in vicidial.php Added Delete Voicemail After Email option to voicemail accounts git-svn-id: svn://192.168.202.10@1272 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 9 + agi/agi-VDAD_ALL_inbound.agi | 38 +- bin/ADMIN_keepalive_ALL.pl | 109 +- docs/ALTERNATE_NUMBER_DIALING.txt | 5 +- docs/ASTERISK_CONF-GEN.txt | 4 +- docs/Inbound_VDAC_IVR.txt | 2 +- docs/conf_examples/extensions.conf.sample-1.4 | 2 +- docs/conf_examples/voicemail.conf.sample | 1 + extras/MySQL_AST_CREATE_tables.sql | 6 +- extras/upgrade_2.2.0.sql | 6 + .../TO_BE_TRANSLATED_2.2.0.txt | 3 + www/agc/manager_send.php | 1007 ++++++----------- www/agc/vdc_db_query.php | 32 +- www/agc/vicidial.php | 177 ++- www/vicidial/admin.php | 60 +- 15 files changed, 637 insertions(+), 824 deletions(-) diff --git a/UPGRADE b/UPGRADE index 1cd670eb..4832da11 100644 --- a/UPGRADE +++ b/UPGRADE @@ -321,6 +321,15 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom ALLFORCE for script on auto-launch. Also, added a refresh link for the script tab to reload content at will. +76. Redesigned the Transfer-Conference frame in the agent interface and added + a CONSULTATIVE checkbox to allow for easier consultative 3-way calls + with other ViciDial agents with customer information. This also allows + for AGENTDIRECT consultative transfers. CXFER is no longer needed to do + consultative transfers + +77. Added "Delete Voicemail After Email" options to delete messages on the + server after they have been emailed + diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 67520af5..cd366629 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -115,7 +115,7 @@ $start_moh=1; $at='@'; $S='*'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=112; +$mysql_log_count=119; $one_mysql_log=0; @@ -214,13 +214,13 @@ $rec_count=0; while ($sthArows > $rec_count) { $AGILOG = '0'; - @aryA = $sthA->fetchrow_array; - $DBagi_output = "$aryA[0]"; - $local_gmt = "$aryA[0]"; - if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';} - if ($DBagi_output =~ /FILE/) {$AGILOG = '2';} - if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';} - $rec_count++; + @aryA = $sthA->fetchrow_array; + $DBagi_output = "$aryA[0]"; + $local_gmt = "$aryA[0]"; + if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';} + if ($DBagi_output =~ /FILE/) {$AGILOG = '2';} + if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';} + $rec_count++; } $sthA->finish(); @@ -331,7 +331,7 @@ if ($extension =~ /^999\d\d\*/) } if ($call_handle_method =~ /^CLOSER/) -{ + { ### allow for internal PRI/IAX/SIP transfer data string "90009*CL_uk3survy_*8301*10000123*universal*7275551212*1234*" if ($extension =~ /^900\d\d\*|^9900\d\d\*/) { @@ -359,15 +359,15 @@ if ($call_handle_method =~ /^CLOSER/) checkresult($result); if ($AGILOG) {$agi_string = "callerID changed: $JqueryCID"; &agi_output;} } -} + } if ($call_handle_method =~ /^CID/) -{ + { if (length($callerid)>0) {$phone_number = $callerid;} else {$phone_number = '';} if (length($calleridname)>0) {$VLcomments = $calleridname;} else {$VLcomments = '';} -} + } # if ($channel =~ /^SIP/) {$channel =~ s/-.*//gi;} # if ($channel =~ /^Zap\//) {$channel =~ s/-\d$//gi;} @@ -752,7 +752,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + $dbhP=$dbhA; $mysql_count='02113'; $MEL_aff_rows=$sthArows; &mysql_error_logging; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; @@ -911,7 +911,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + $dbhP=$dbhA; $mysql_count='02114'; $MEL_aff_rows=$sthArows; &mysql_error_logging; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; @@ -1206,7 +1206,7 @@ if ($enable_queuemetrics_logging > 0) $stmtB = "UPDATE queue_log SET call_id='$YqueryCID' where time_id > '$QL_last_day' and call_id='$uniqueid' and queue='NONE' and agent='NONE' and verb='INFO' and data1 IN('DID','IVR');"; $Baffected_rows = $dbhB->do($stmtB); if ($AGILOG) {$agi_string = "$Baffected_rows|$stmtB|"; &agi_output;} - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02115'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; $dbhB->disconnect(); } @@ -1536,7 +1536,7 @@ if ( ($agent_search_method =~ /^SO|^LO/) && ($skipLOSO < 1) ) $stmtB = "DELETE FROM queue_log where call_id='$YqueryCID' and verb='ABANDON';"; if ($AGILOG) {$agi_string = "Removing ABANDON queue_log entries for call $QLabandon|$YqueryCID"; &agi_output;} $Baffected_rows = $dbhB->do($stmtB); - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02116'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; } $dbhB->disconnect(); @@ -1908,7 +1908,7 @@ if ($agent_search_method =~ /^LO|^LB/) $stmtB = "DELETE FROM queue_log where call_id='$YqueryCID' and verb='ABANDON';"; if ($AGILOG) {$agi_string = "Removing ABANDON queue_log entries for call $QLabandon|$YqueryCID"; &agi_output;} $Baffected_rows = $dbhB->do($stmtB); - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02117'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; } $dbhB->disconnect(); @@ -2434,7 +2434,7 @@ if ($hold_time_option =~ /EXTENSION/) $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + $dbhP=$dbhA; $mysql_count='02119'; $MEL_aff_rows=$sthArows; &mysql_error_logging; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; @@ -2777,7 +2777,7 @@ if ($drop_action =~ /MESSAGE|EXTEN/) $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + $dbhP=$dbhA; $mysql_count='02118'; $MEL_aff_rows=$sthArows; &mysql_error_logging; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index 533e6874..32a67148 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -46,6 +46,7 @@ # 91031-1258 - Added carrier description comments # 91109-1205 - Added requirecalltoken=no as IAX setting for newer Asterisk 1.4 versions # 91125-0709 - Added conf_secret to servers conf +# 91205-2315 - Added delete_vm_after_email option to voicemail conf generation # $DB=0; # Debug flag @@ -746,8 +747,8 @@ $sthArows=$sthA->rows; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $sounds_central_control_active = "$aryA[0]"; - $active_voicemail_server = "$aryA[1]"; + $sounds_central_control_active = $aryA[0]; + $active_voicemail_server = $aryA[1]; } $sthA->finish(); if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) ) @@ -852,7 +853,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $server_id = "$aryA[0]"; + $server_id = $aryA[0]; $vicidial_recording_limit = (60 * $aryA[1]); $i++; } @@ -1096,7 +1097,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r ##### BEGIN Generate the IAX phone entries ##### - $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;"; + $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1105,20 +1106,21 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArows > $i) { @aryA = $sthA->fetchrow_array; - $extension[$i] = "$aryA[0]"; - $dialplan[$i] = "$aryA[1]"; - $voicemail[$i] = "$aryA[2]"; - $pass[$i] = "$aryA[3]"; - $template_id[$i] = "$aryA[4]"; - $conf_override[$i] = "$aryA[5]"; - $email[$i] = "$aryA[6]"; - $template_id[$i] = "$aryA[7]"; - $conf_override[$i] = "$aryA[8]"; - $outbound_cid[$i] = "$aryA[9]"; - $fullname[$i] = "$aryA[10]"; - $phone_context[$i] = "$aryA[11]"; - $phone_ring_timeout[$i] = "$aryA[12]"; - $conf_secret[$i] = "$aryA[13]"; + $extension[$i] = $aryA[0]; + $dialplan[$i] = $aryA[1]; + $voicemail[$i] = $aryA[2]; + $pass[$i] = $aryA[3]; + $template_id[$i] = $aryA[4]; + $conf_override[$i] = $aryA[5]; + $email[$i] = $aryA[6]; + $template_id[$i] = $aryA[7]; + $conf_override[$i] = $aryA[8]; + $outbound_cid[$i] = $aryA[9]; + $fullname[$i] = $aryA[10]; + $phone_context[$i] = $aryA[11]; + $phone_ring_timeout[$i] = $aryA[12]; + $conf_secret[$i] = $aryA[13]; + $delete_vm_after_email[$i] = $aryA[14]; $i++; } $sthA->finish(); @@ -1172,7 +1174,10 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r $Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i]|$phone_ring_timeout[$i]|)\n"; $Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n"; - $vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n"; + if ($delete_vm_after_email[$i] =~ /Y/) + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";} + else + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";} $i++; } @@ -1181,7 +1186,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r ##### BEGIN Generate the SIP phone entries ##### - $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;"; + $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1190,20 +1195,21 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArows > $i) { @aryA = $sthA->fetchrow_array; - $extension[$i] = "$aryA[0]"; - $dialplan[$i] = "$aryA[1]"; - $voicemail[$i] = "$aryA[2]"; - $pass[$i] = "$aryA[3]"; - $template_id[$i] = "$aryA[4]"; - $conf_override[$i] = "$aryA[5]"; - $email[$i] = "$aryA[6]"; - $template_id[$i] = "$aryA[7]"; - $conf_override[$i] = "$aryA[8]"; - $outbound_cid[$i] = "$aryA[9]"; - $fullname[$i] = "$aryA[10]"; - $phone_context[$i] = "$aryA[11]"; - $phone_ring_timeout[$i] = "$aryA[12]"; - $conf_secret[$i] = "$aryA[13]"; + $extension[$i] = $aryA[0]; + $dialplan[$i] = $aryA[1]; + $voicemail[$i] = $aryA[2]; + $pass[$i] = $aryA[3]; + $template_id[$i] = $aryA[4]; + $conf_override[$i] = $aryA[5]; + $email[$i] = $aryA[6]; + $template_id[$i] = $aryA[7]; + $conf_override[$i] = $aryA[8]; + $outbound_cid[$i] = $aryA[9]; + $fullname[$i] = $aryA[10]; + $phone_context[$i] = $aryA[11]; + $phone_ring_timeout[$i] = $aryA[12]; + $conf_secret[$i] = $aryA[13]; + $delete_vm_after_email[$i] = $aryA[14]; $i++; } $sthA->finish(); @@ -1255,7 +1261,10 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r $Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i]|$phone_ring_timeout[$i]|)\n"; $Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n"; - $vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n"; + if ($delete_vm_after_email[$i] =~ /Y/) + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";} + else + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";} $i++; } @@ -1622,7 +1631,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArows > $i) { ##### Get the distinct phone entries ##### - $stmtA = "SELECT extension,pass,email FROM phones where active='Y' and voicemail_id='$voicemail[$i]';"; + $stmtA = "SELECT extension,pass,email,delete_vm_after_email FROM phones where active='Y' and voicemail_id='$voicemail[$i]';"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1630,19 +1639,23 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r if ($sthArowsX > 0) { @aryA = $sthA->fetchrow_array; - $extension[$i] = "$aryA[0]"; - $pass[$i] = "$aryA[1]"; - $email[$i] = "$aryA[2]"; + $extension[$i] = $aryA[0]; + $pass[$i] = $aryA[1]; + $email[$i] = $aryA[2]; + $delete_vm_after_email[$i] = $aryA[3]; } $sthA->finish(); - $vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n"; + if ($delete_vm_after_email[$i] =~ /Y/) + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";} + else + {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";} $i++; } ##### Get the other voicemail box entries ##### - $stmtA = "SELECT voicemail_id,fullname,pass,email FROM vicidial_voicemail where active='Y';"; + $stmtA = "SELECT voicemail_id,fullname,pass,email,delete_vm_after_email FROM vicidial_voicemail where active='Y';"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1656,12 +1669,16 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArows > $i) { @aryA = $sthA->fetchrow_array; - $voicemail_id[$i] = $aryA[0]; - $fullname[$i] = $aryA[1]; - $pass[$i] = $aryA[2]; - $email[$i] = $aryA[3]; + $voicemail_id[$i] = $aryA[0]; + $fullname[$i] = $aryA[1]; + $pass[$i] = $aryA[2]; + $email[$i] = $aryA[3]; + $delete_vm_after_email[$i] = $aryA[4]; - $vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i]\n"; + if ($delete_vm_after_email[$i] =~ /Y/) + {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=yes\n";} + else + {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i]\n";} $i++; } diff --git a/docs/ALTERNATE_NUMBER_DIALING.txt b/docs/ALTERNATE_NUMBER_DIALING.txt index 9ee5674a..901781f4 100644 --- a/docs/ALTERNATE_NUMBER_DIALING.txt +++ b/docs/ALTERNATE_NUMBER_DIALING.txt @@ -4,6 +4,9 @@ ALTERNATE NUMBER DIALING Redesign 2008-08-20 *** FOR INFORMATION ON THE 2.0.3 AND 2.0.4 VERSION OF ALT NUMBER DIALING LOOK BELOW THIS SECTION *** +As of the 2.2.0 version a lot of bugs have been fixed, and DNC statuses can now be used as auto-alt-dial triggering statuses + + In order to allow for more alt-numbers per lead to dial we built a new method of storing and dialing alt-numbers for leads. CLI lead loader will be changed to allow for the importation of upto 65,000 phone numbers per lead. The new file format is shown below. @@ -12,7 +15,7 @@ vicidial.php agent screen and vdc_db_query.php scripts have been changed to allo AST_VDauto_dial.pl, AST_VDauto_dial_FILL.pl and the VDhangup process in FastAGI_log.pl have all been modified to work with the new alt number data structure. -non_agent_api.php needs to be changed to accept new multiple-alt-numbers per inserted lead. +non_agent_api.php has been changed in 2.2.0 to accept new multiple-alt-numbers per inserted lead(see the NON_AGENT_API.txt doc for more information) File structure for CLI lead loader goes here: diff --git a/docs/ASTERISK_CONF-GEN.txt b/docs/ASTERISK_CONF-GEN.txt index db143418..ecdd31b9 100644 --- a/docs/ASTERISK_CONF-GEN.txt +++ b/docs/ASTERISK_CONF-GEN.txt @@ -7,6 +7,8 @@ The conf files that are generated are: /etc/asterisk/iax-vicidial.conf /etc/asterisk/sip-vicidial.conf /etc/asterisk/voicemail-vicidial.conf + /etc/asterisk/meetme-vicidial.conf + /etc/asterisk/musiconhold-vicidial.conf All of the above files are included in their respective conf files by #include links that you can see if you look at the sample conf files in the docs directory. @@ -14,7 +16,7 @@ IMPORTANT!!! - Files will only be generated for SIP and IAX phones and carriers - Files will only be generated on servers where the server record is set to active_asterisk_server='Y' and generate_vicidial_conf='Y' - The automatic reloading of new conf files by the system is only possible if you started Asterisk with the start_asterisk_boot.pl script, or if Asterisk is running in a screen session named 'asterisk'. -After any phone, server or carrier entry is edited in the admin interface, a flag(rebuild_conf_files='Y') will be set to have the ADMIN_keepalive_ALL.pl script(that should be running once a minute in the crontab) run and generate new conf files and reload Asterisk. +After any phone, server, carrier, musiconhold, call menu or voicemail entry is edited in the admin interface, a flag(rebuild_conf_files='Y') will be set to have the ADMIN_keepalive_ALL.pl script(that should be running once a minute in the crontab) run and generate new conf files and reload Asterisk. Phones are defined in the admin.php -> Admin -> Show Phones Carriers are defined in the admin.php -> Admin -> Servers -> Show Carriers diff --git a/docs/Inbound_VDAC_IVR.txt b/docs/Inbound_VDAC_IVR.txt index e0d40a7f..28628e56 100644 --- a/docs/Inbound_VDAC_IVR.txt +++ b/docs/Inbound_VDAC_IVR.txt @@ -1,7 +1,7 @@ Inbound VDAC IVR process 2008-05-25 -NOTE: the Call Menu feature has been recently added that will enable you to create and maintain IVRs, such as those mentioned in this document, using only the web-based interface. For more information about Call Menus, take a look at the In-Groups -> Call Menu section of the Administration website or look at the ASTERISK_CONF-GEN.txt document +NOTE: the Call Menu feature has been recently added in 2.2.0 that enables you to create and maintain IVRs, such as those mentioned in this document, using only the web-based Administration interface. For more information about Call Menus, take a look at the In-Groups -> Call Menu section of the Administration website or look at the ASTERISK_CONF-GEN.txt document diff --git a/docs/conf_examples/extensions.conf.sample-1.4 b/docs/conf_examples/extensions.conf.sample-1.4 index 487a0623..2706b50e 100644 --- a/docs/conf_examples/extensions.conf.sample-1.4 +++ b/docs/conf_examples/extensions.conf.sample-1.4 @@ -282,7 +282,7 @@ exten => 8889990011112,1,Goto(loopback-no-log,9990011112,1) exten => _90009.,1,Answer ; Answer the line exten => _90009.,2,Dial(${TRUNKloop}/9${EXTEN},,to) exten => _90009.,3,Hangup -exten => _990009.,1,Answer ; Answer the line +exten => _990009.,1,Answer ; Answer the line, Sometimes needs to be removed exten => _990009.,2,AGI(agi-VDAD_ALL_inbound.agi,CLOSER-----LB-----CL_TESTCAMP-----7275551212-----Closer-----park----------999-----1) exten => _990009.,3,Hangup ; DID forwarded calls diff --git a/docs/conf_examples/voicemail.conf.sample b/docs/conf_examples/voicemail.conf.sample index 84d3554f..dd255165 100644 --- a/docs/conf_examples/voicemail.conf.sample +++ b/docs/conf_examples/voicemail.conf.sample @@ -6,6 +6,7 @@ skipms=3000 maxsilence=10 silencethreshold=128 maxlogins=3 +maxmsg=300 [zonemessages] eastern=America/New_York|'vm-received' Q 'digits/at' IMp diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 2017a29b..214c310d 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -72,6 +72,7 @@ conf_override TEXT, phone_context VARCHAR(20) default 'default', phone_ring_timeout SMALLINT(3) default '60', conf_secret VARCHAR(20) default 'test', +delete_vm_after_email ENUM('N','Y') default 'N', index (server_ip), unique index extenserver (extension, server_ip) ); @@ -1821,7 +1822,8 @@ pass VARCHAR(10) NOT NULL, fullname VARCHAR(100) NOT NULL, messages INT(4) default '0', old_messages INT(4) default '0', -email VARCHAR(100) +email VARCHAR(100), +delete_vm_after_email ENUM('N','Y') default 'N' ); CREATE TABLE vicidial_user_territory_log ( @@ -1978,7 +1980,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number); CREATE INDEX date_user on vicidial_closer_log (call_date,user); CREATE INDEX comment_a on live_inbound_log (comment_a); -UPDATE system_settings SET db_schema_version='1184',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1185',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.2.0.sql b/extras/upgrade_2.2.0.sql index 22ff2359..ee4f1942 100644 --- a/extras/upgrade_2.2.0.sql +++ b/extras/upgrade_2.2.0.sql @@ -645,3 +645,9 @@ index (campaign_id) ); UPDATE system_settings SET db_schema_version='1184',db_schema_update_date=NOW(); + +ALTER TABLE phones ADD delete_vm_after_email ENUM('N','Y') default 'N'; + +ALTER TABLE vicidial_voicemail ADD delete_vm_after_email ENUM('N','Y') default 'N'; + +UPDATE system_settings SET db_schema_version='1185',db_schema_update_date=NOW(); diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt index 87fc8f51..5bb54501 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt @@ -346,6 +346,8 @@ Carrier Description|| This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters|| CAMPAIGNS ALLOWING THIS IN-GROUP|| This is the secret, or password, for the server in the iax auto-generated conf file for this server on other servers. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test|| +Delete Voicemail After Email|| +This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N|| add-file: user_territories.php @@ -366,6 +368,7 @@ Calls in Queue View Disabled for this campaign|| YOU MUST BE PAUSED TO GRAB CALLS IN QUEUE|| Manager || has selected your in-group choices|| +CONSULTATIVE|| add-file: vdc_script_display.php diff --git a/www/agc/manager_send.php b/www/agc/manager_send.php index 6c0723fb..3b354e94 100644 --- a/www/agc/manager_send.php +++ b/www/agc/manager_send.php @@ -92,10 +92,11 @@ # 90916-1830 - Added nodeletevdac # 90924-1555 - Added am_message_exten_override for list_id option # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup +# 91205-2103 - Code cleanup # -$version = '2.2.0-44'; -$build = '91112-1110'; +$version = '2.2.0-45'; +$build = '91205-2103'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -192,15 +193,13 @@ header ("Pragma: no-cache"); // HTTP/1.0 ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -436,16 +435,16 @@ if ($ACTION=="Originate") # ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up ###################### if ($ACTION=="HangupConfDial") -{ + { $row=''; $rowx=''; $channel_live=1; if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { + { $channel_live=0; echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } + } else - { + { $local_DEF = 'Local/'; $local_AMP = '@'; $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; @@ -456,7 +455,7 @@ if ($ACTION=="HangupConfDial") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) - { + { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -465,9 +464,9 @@ if ($ACTION=="HangupConfDial") $channel=$rowx[0]; $ACTION="Hangup"; $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW... + } } } -} @@ -475,10 +474,10 @@ if ($ACTION=="HangupConfDial") # ACTION=Hangup - insert Hangup Manager statement ###################### if ($ACTION=="Hangup") -{ -$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); + { + $stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);} $row=''; $rowx=''; @@ -497,17 +496,17 @@ $rslt=mysql_query($stmt, $link); # $rslt=mysql_query($stmt, $link); # $row=mysql_fetch_row($rslt); # if ($row[0]==0) -# { +# { # $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; # if ($format=='debug') {echo "\n";} # $rslt=mysql_query($stmt, $link); # $rowx=mysql_fetch_row($rslt); # if ($rowx[0]==0) -# { +# { # $channel_live=0; # echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } +# } +# } if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 0)) { $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; @@ -678,7 +677,7 @@ $rslt=mysql_query($stmt, $link); echo "Hangup command sent for Channel $channel on $call_server_ip\n"; } } -} + } @@ -800,9 +799,9 @@ if ($ACTION=="RedirectToPark") } if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) { + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) + { $channel_live=0; echo "One of these variables is not valid:\n"; echo "Channel $channel must be greater than 2 characters\n"; @@ -811,22 +810,22 @@ if ($ACTION=="RedirectFromPark") echo "ext_context $ext_context must be set\n"; echo "ext_priority $ext_priority must be set\n"; echo "\nRedirectFromPark Action not sent\n"; - } + } else - { + { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; + } } -} if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) { + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) + { $channel_live=0; echo "One of these variables is not valid:\n"; echo "Channel $channel must be greater than 2 characters\n"; @@ -835,27 +834,27 @@ if ($ACTION=="RedirectName") echo "ext_context $ext_context must be set\n"; echo "ext_priority $ext_priority must be set\n"; echo "\nRedirectName Action not sent\n"; - } + } else - { + { $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; + { + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + $ACTION="Redirect"; + } } } -} if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) { + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) + { $channel_live=0; echo "One of these variables is not valid:\n"; echo "Channel $channel must be greater than 2 characters\n"; @@ -865,22 +864,22 @@ if ($ACTION=="RedirectNameVmail") echo "ext_context $ext_context must be set\n"; echo "ext_priority $ext_priority must be set\n"; echo "\nRedirectNameVmail Action not sent\n"; - } + } else - { + { $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);} $name_count = mysql_num_rows($rslt); if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; + { + $row=mysql_fetch_row($rslt); + $exten = "$exten$row[0]"; + $ACTION="Redirect"; + } } } -} @@ -888,13 +887,13 @@ if ($ACTION=="RedirectNameVmail") if ($ACTION=="RedirectXtraCXNeW") -{ + { $DBout=''; $row=''; $rowx=''; $channel_liveX=1; $channel_liveY=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) - { + { $channel_liveX=0; $channel_liveY=0; echo "One of these variables is not valid:\n"; @@ -914,9 +913,9 @@ if ($ACTION=="RedirectXtraCXNeW") fclose($fp); } } - } + } else - { + { if (ereg("NEXTAVAILABLE",$exten)) { $stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; @@ -997,53 +996,53 @@ if ($ACTION=="RedirectXtraCXNeW") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_liveX=0; echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } + } + } $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_liveY=0; echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } + } + } if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { + { $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0] < 1) - { + { $channel_liveY=0; echo "No Local agent to send call to, Redirect command not inserted\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} - } + } else - { + { $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -1077,29 +1076,28 @@ if ($ACTION=="RedirectXtraCXNeW") echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel on $call_server_ip, Hungup $extrachannel on $server_ip";} + } } - } else - { + { if ($channel_liveX==1) {$ACTION="Redirect"; $server_ip = $call_server_ip;} if ($channel_liveY==1) {$ACTION="Redirect"; $channel=$extrachannel;} if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel on $server_ip";} - } + } - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) + if (ereg("SECOND|FIRST|DEBUG",$filename)) { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); + fclose($fp); + } } } - } -} @@ -1111,16 +1109,16 @@ if ($ACTION=="RedirectXtraCXNeW") if ($ACTION=="RedirectXtraNeW") -{ + { if ($channel=="$extrachannel") {$ACTION="Redirect";} else - { + { $row=''; $rowx=''; $channel_liveX=1; $channel_liveY=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) ) - { + { $channel_liveX=0; $channel_liveY=0; echo "One of these variables is not valid:\n"; @@ -1141,73 +1139,73 @@ if ($ACTION=="RedirectXtraNeW") fclose($fp); } } - } - else - { - if (ereg("NEXTAVAILABLE",$exten)) + } + else { - $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} - $row=mysql_fetch_row($rslt); - if ($row[0] > 1) + if (ereg("NEXTAVAILABLE",$exten)) { - $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; + $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} - - $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $exten = $row[0]; - - $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} - - $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} - - $queryCID = "CXAR23$NOWnum"; - $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmtB, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} - - $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} - - if ($auto_dial_level < 1) + if ($row[0] > 1) { - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $exten = $row[0]; + + $stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);} + + $queryCID = "CXAR23$NOWnum"; + $stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmtB, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($auto_dial_level < 1) + { + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "NeWSessioN|$exten|\n"; + echo "|$stmtB|\n"; + + exit; + } + else + { + $channel_liveX=0; + echo "Cannot find empty vicidial_conference on $server_ip, Redirect command not inserted\n|$stmt|"; + if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";} } - - echo "NeWSessioN|$exten|\n"; - echo "|$stmtB|\n"; - - exit; } - else - { - $channel_liveX=0; - echo "Cannot find empty vicidial_conference on $server_ip, Redirect command not inserted\n|$stmt|"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";} - } - } - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} @@ -1215,42 +1213,42 @@ if ($ACTION=="RedirectXtraNeW") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_liveX=0; echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } + } + } $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_liveY=0; echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } + } + } if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) { + if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) + { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -1258,9 +1256,9 @@ if ($ACTION=="RedirectXtraNeW") echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";} - } + } else - { + { $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} @@ -1285,332 +1283,38 @@ if ($ACTION=="RedirectXtraNeW") echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} + } } - } else - { + { if ($channel_liveX==1) {$ACTION="Redirect"; $server_ip = $call_server_ip;} if ($channel_liveY==1) {$ACTION="Redirect"; $channel=$extrachannel;} - - } - - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); } - } - } - } -} - - - - - - - -/* -if ($ACTION=="RedirectXtraCX") -{ - $DBout=''; - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); - fclose($fp); - } - } - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0] < 1) - { - $channel_liveY=0; - echo "No Local agent to send call to, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";} - } - else - { - $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $dest_server_ip = $rowx[0]; - $dest_session_id = $rowx[1]; - $dest_user = $rowx[2]; - $S='*'; - - $D_s_ip = explode('.', $dest_server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel on $call_server_ip, Hungup $extrachannel on $server_ip";} - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel on $server_ip";} - } - - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); - } - } - - } -} - - - -###### BEGIN OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; if (ereg("SECOND|FIRST|DEBUG",$filename)) { if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); fclose($fp); } } - } - else - { - if (ereg("NEXTAVAILABLE",$exten)) - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";} - } } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";} - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0]==0) && (!ereg("SECOND",$filename)) ) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";} - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";} - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";} - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - - if (ereg("SECOND|FIRST|DEBUG",$filename)) - { - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$DBout|\n"); - fclose($fp); - } - } - } } -} -###### END OLD LEAVE-3-WAY FOR EXTERNAL CALLS - DEPRICATED AND WILL BE DELETED SOON ##### -*/ + + + + if ($ACTION=="Redirect") -{ + { ### for manual dial VICIDIAL calls send the second attempt to transfer the call if ($stage=="2NDXfeR") - { + { $local_DEF = 'Local/'; $local_AMP = '@'; $hangup_channel_prefix = "$local_DEF$session_id$local_AMP$ext_context"; @@ -1621,7 +1325,7 @@ if ($ACTION=="Redirect") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row > 0) - { + { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -1630,13 +1334,13 @@ if ($ACTION=="Redirect") $channel=$rowx[0]; $channel = eregi_replace("1$","2",$channel); $queryCID = eregi_replace("^.","Q",$queryCID); + } } - } $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { + { $channel_live=0; echo "One of these variables is not valid:\n"; echo "Channel $channel must be greater than 2 characters\n"; @@ -1645,9 +1349,9 @@ if ($ACTION=="Redirect") echo "ext_context $ext_context must be set\n"; echo "ext_priority $ext_priority must be set\n"; echo "\nRedirect Action not sent\n"; - } + } else - { + { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} @@ -1655,29 +1359,29 @@ if ($ACTION=="Redirect") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_live=0; echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } + } + } if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);} - echo "Redirect command sent for Channel $channel on $server_ip\n"; + echo "Redirect command sent for Channel $channel on $server_ip\n"; + } } } -} @@ -1685,7 +1389,7 @@ if ($ACTION=="Redirect") # ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel ###################### if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ + { if ($ACTION=="StopMonitor") {$SQLfile = "";} else @@ -1694,78 +1398,77 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $row=''; $rowx=''; $channel_live=1; if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) ) - { + { $channel_live=0; echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } + } else - { + { $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); if ($row[0]==0) - { + { $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);} $rowx=mysql_fetch_row($rslt); if ($rowx[0]==0) - { + { $channel_live=0; echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } + } + } if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} - - if ($ACTION=="Monitor") { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) + if ($ACTION=="Monitor") { + $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} } + else + { + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $rec_count = mysql_num_rows($rslt); + if ($rec_count>0) + { + $row=mysql_fetch_row($rslt); + $recording_id = $row[0]; + $start_time = $row[1]; + $length_in_sec = ($StarTtime - $start_time); + $length_in_min = ($length_in_sec / 60); + $length_in_min = sprintf("%8.2f", $length_in_min); + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; } } -} @@ -1776,153 +1479,151 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) # ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference ###################### if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ + { $row=''; $rowx=''; $channel_live=1; $uniqueidSQL=''; if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) ) - { + { $channel_live=0; echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } + } else - { - - $VDvicidial_id=''; - - if ($ACTION=="MonitorConf") { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} + $VDvicidial_id=''; - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} - $RLaffected_rows = mysql_affected_rows($link); - if ($RLaffected_rows > 0) + if ($ACTION=="MonitorConf") { - $recording_id = mysql_insert_id($link); + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);} + $RLaffected_rows = mysql_affected_rows($link); + if ($RLaffected_rows > 0) + { + $recording_id = mysql_insert_id($link); + } + + if ($FROMvdc=='YES') + { + ##### get call type from vicidial_live_agents table + $VLA_inOUT='NONE'; + $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VLA_inOUT_ct = mysql_num_rows($rslt); + if ($VLA_inOUT_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VLA_inOUT = $row[0]; + } + if ($VLA_inOUT == 'INBOUND') + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + + ##### look for the vicidial ID in the vicidial_closer_log table + $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + } + else + { + ##### look for the vicidial ID in the vicidial_log table + $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + } + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDvicidial_id = $row[0]; + + $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} + } + } } - if ($FROMvdc=='YES') + ##### StopMonitorConf steps ##### + else { - ##### get call type from vicidial_live_agents table - $VLA_inOUT='NONE'; - $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VLA_inOUT_ct = mysql_num_rows($rslt); - if ($VLA_inOUT_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VLA_inOUT = $row[0]; - } - if ($VLA_inOUT == 'INBOUND') + if ($uniqueid=='IN') { $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); - ##### look for the vicidial ID in the vicidial_closer_log table - $stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + ### find the value to put in the vicidial_id field if this was an inbound call + $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $uniqueidSQL = ",vicidial_id='$row[0]'"; + } } else { - ##### look for the vicidial ID in the vicidial_log table - $stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + if (strlen($uniqueid) > 8) + {$uniqueidSQL = ",vicidial_id='$uniqueid'";} } + + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDvicidial_id = $row[0]; - - $stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);} - } - } - } - - ##### StopMonitorConf steps ##### - else - { - if ($uniqueid=='IN') - { - $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); - - ### find the value to put in the vicidial_id field if this was an inbound call - $stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);} - $VAC_qm_ct = mysql_num_rows($rslt); - if ($VAC_qm_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueidSQL = ",vicidial_id='$row[0]'"; - } - } - else - { - if (strlen($uniqueid) > 8) - {$uniqueidSQL = ",vicidial_id='$uniqueid'";} - } - - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); + $rec_count = mysql_num_rows($rslt); if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); + { + $row=mysql_fetch_row($rslt); + $recording_id = $row[0]; + $start_time = $row[1]; + $length_in_sec = ($StarTtime - $start_time); + $length_in_min = ($length_in_sec / 60); + $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} - } + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} + } - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; + # find and hang up all recordings going on in this conference # and extension = '$exten' + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} - $i++; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);} + # $rec_count = intval(mysql_num_rows($rslt) / 2); + $rec_count = mysql_num_rows($rslt); + $h=0; + while ($rec_count>$h) + { + $rowx=mysql_fetch_row($rslt); + $HUchannel[$h] = $rowx[0]; + $h++; + } + $i=0; + while ($h>$i) + { + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);} + $i++; + } } - + echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; } -} @@ -1932,29 +1633,29 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) # ACTION=VolumeControl - raise or lower the volume of a meetme participant ###################### if ($ACTION=="VolumeControl") -{ + { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($stage)<1) or (strlen($queryCID)<1) ) - { + { echo "Conference $exten, Stage $stage is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } + } else - { - $participant_number='XXYYXXYYXXYYXX'; - if (eregi('UP',$stage)) {$vol_prefix='4';} - if (eregi('DOWN',$stage)) {$vol_prefix='3';} - if (eregi('UNMUTE',$stage)) {$vol_prefix='2';} - if (eregi('MUTING',$stage)) {$vol_prefix='1';} - $local_DEF = 'Local/'; - $local_AMP = '@'; - $volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context"; + { + $participant_number='XXYYXXYYXXYYXX'; + if (eregi('UP',$stage)) {$vol_prefix='4';} + if (eregi('DOWN',$stage)) {$vol_prefix='3';} + if (eregi('UNMUTE',$stage)) {$vol_prefix='2';} + if (eregi('MUTING',$stage)) {$vol_prefix='1';} + $local_DEF = 'Local/'; + $local_AMP = '@'; + $volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context"; - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} - echo "Volume command sent for Conference $exten, Stage $stage Channel $channel on $server_ip\n"; + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} + echo "Volume command sent for Conference $exten, Stage $stage Channel $channel on $server_ip\n"; + } } -} @@ -1977,23 +1678,23 @@ exit; ##### MySQL Error Logging ##### function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) -{ -$NOW_TIME = date("Y-m-d H:i:s"); -# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); -$errno=''; $error=''; -if ( ($mel > 0) or ($one_mysql_log > 0) ) { - $errno = mysql_errno($link); - if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + $NOW_TIME = date("Y-m-d H:i:s"); + # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); + $errno=''; $error=''; + if ( ($mel > 0) or ($one_mysql_log > 0) ) { - $error = mysql_error($link); - $efp = fopen ("./vicidial_mysql_errors.txt", "a"); - fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); - fclose($efp); + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } } + $one_mysql_log=0; + return $errno; } -$one_mysql_log=0; -return $errno; -} ?> diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 597d5589..2c83b601 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -228,7 +228,7 @@ $version = '2.2.0-132'; $build = '91204-1937'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=256; +$mysql_log_count=271; $one_mysql_log=0; require("dbconnect.php"); @@ -918,7 +918,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_campaigns vc WHERE campaign_id='$campaign' and vs.script_id=vc.campaign_script and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00257',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -1443,7 +1443,7 @@ if ($ACTION == 'manDiaLnextCaLL') $agent_territories=''; $stmt="SELECT agent_territories FROM vicidial_live_agents where user='$user';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00258',$user,$server_ip,$session_name,$one_mysql_log);} $userterrVLA_ct = mysql_num_rows($rslt); if ($DB) {echo "$userterrVLA_ct|$stmt\n";} if ($userterrVLA_ct > 0) @@ -1811,7 +1811,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00259',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vls_vc_ct = mysql_num_rows($rslt); if ($vls_vc_ct > 0) @@ -1823,7 +1823,7 @@ if ($ACTION == 'manDiaLnextCaLL') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00260',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -3611,7 +3611,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### grab number of calls today in this campaign and increment $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_campaigns vc WHERE campaign_id='$campaign' and vs.script_id=vc.campaign_script and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00261',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -3689,7 +3689,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_inbound_groups vig WHERE group_id='$VDADchannel_group' and vs.script_id=vig.ingroup_script and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00262',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -3748,7 +3748,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_campaigns vc WHERE campaign_id='$campaign' and vs.script_id=vc.campaign_script and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00263',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -3815,7 +3815,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_campaigns vc WHERE campaign_id='$VDADchannel_group' and vs.script_id=vc.campaign_script and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00264',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -3872,7 +3872,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00265',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vls_vc_ct = mysql_num_rows($rslt); if ($vls_vc_ct > 0) @@ -3884,7 +3884,7 @@ if ($ACTION == 'VDADcheckINCOMING') ##### find if script contains recording fields $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00266',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vs_vc_ct = mysql_num_rows($rslt); if ($vs_vc_ct > 0) @@ -4550,7 +4550,7 @@ if ($ACTION == 'updateDISPO') $vh_phone=''; $stmt="SELECT phone_number FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00267',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $ud_record_ct = mysql_num_rows($rslt); if ($ud_record_ct > 0) @@ -4570,7 +4570,7 @@ if ($ACTION == 'updateDISPO') else {$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$vh_phone';";} $rslt=mysql_query($stmtA, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00268',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $ud_record_ct = mysql_num_rows($rslt); if ($ud_record_ct > 0) @@ -4591,7 +4591,7 @@ if ($ACTION == 'updateDISPO') else {$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$vh_phone' and campaign_id='$campaign';";} $rslt=mysql_query($stmtA, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00269',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $ud_record_ct = mysql_num_rows($rslt); if ($ud_record_ct > 0) @@ -5799,7 +5799,7 @@ if ($ACTION == 'CALLSINQUEUEgrab') { $stmt="SELECT call_time,campaign_id,uniqueid,phone_number,lead_id,queue_priority,call_type from vicidial_auto_calls where auto_call_id='$stage';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00270',$user,$server_ip,$session_name,$one_mysql_log);} if ($rslt) {$vac_count = mysql_num_rows($rslt);} if ($vac_count > 0) { @@ -5815,7 +5815,7 @@ if ($ACTION == 'CALLSINQUEUEgrab') $stmt="INSERT INTO vicidial_grab_call_log SET auto_call_id='$stage',user='$user',event_date='$NOW_TIME',call_time='$GCcall_time',campaign_id='$GCcampaign_id',uniqueid='$GCuniqueid',phone_number='$GCphone_number',lead_id='$GClead_id',queue_priority='$GCqueue_priority',call_type='$GCcall_type';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00271',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); } diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 69e2e1a8..8e7843a9 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -262,12 +262,13 @@ # 91123-1801 - Added code for outbound_autodial field # 91130-2021 - Added code for manager override of in-group selection # 91204-1638 - Added recording_filename and recording_id script variables and script refresh link +# 91205-2055 - Added CONSULTATIVE checkbox in a redesigned Transfer-Conf frame # -$version = '2.2.0-240'; -$build = '91204-1638'; +$version = '2.2.0-241'; +$build = '91205-2055'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=61; +$mysql_log_count=63; $one_mysql_log=0; require("dbconnect.php"); @@ -1312,7 +1313,7 @@ $VDloginDISPLAY=0; { $stmt="SELECT territory from vicidial_user_territories where user='$VD_login';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01062',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $territory_ct = mysql_num_rows($rslt); $territoryCT=0; @@ -2073,7 +2074,7 @@ else $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01063',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($linkB); echo "\n"; @@ -2869,9 +2870,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} agent_dialed_number='1'; agent_dialed_type='XFER_3WAY'; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); @@ -2928,18 +2929,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) { var usegroupalias=0; + var consultativexfer_checked = 0; + if (document.vicidial_form.consultativexfer.checked==true) + {consultativexfer_checked = 1;} var regCXFvars = new RegExp("CXFER","g"); var tasknum_string = tasknum.toString(); - if (tasknum_string.match(regCXFvars)) + if ( (tasknum_string.match(regCXFvars)) || (consultativexfer_checked > 0) ) { - var Ctasknum = tasknum_string.replace(regCXFvars, ''); - if (Ctasknum.length < 2) - {Ctasknum = '990009';} + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var agentdirect = ''; + } + else + { + Ctasknum = '990009'; + var agentdirect = tasknum_string; + } var XfeRSelecT = document.getElementById("XfeRGrouP"); - tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*'; + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + agentdirect + '*'; CustomerData_update(); - } var regAXFvars = new RegExp("AXFER","g"); if (tasknum_string.match(regAXFvars)) @@ -3366,7 +3378,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAcontent_match=0; agentphonelive=0; var conv_start=-1; - var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
>>"; + var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
#REMOTE CHANNELHANGUPVOLUME
>>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -3639,6 +3651,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow) { blind_transfer=1; + var consultativexfer_checked = 0; + if (document.vicidial_form.consultativexfer.checked==true) + {consultativexfer_checked = 1;} + // conf_dialed=1; if (auto_dial_level == 0) {RedirecTxFEr = 1;} var xmlhttpXF=false; @@ -3763,11 +3779,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirecttype_test = document.vicidial_form.xfernumber.value; var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); - if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) - // {var redirecttype = 'RedirectXtraCX';} + if ( ( (redirecttype_test.match(regRXFvars)) || (consultativexfer_checked > 0) ) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCXNeW';} else - // {var redirecttype = 'RedirectXtra';} {var redirecttype = 'RedirectXtraNeW';} DispO3waychannel = redirectvalue; DispO3wayXtrAchannel = redirectXTRAvalue; @@ -4433,15 +4447,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Called 3rd party: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"LEAVE"; + document.getElementById("Leave3WayCall").innerHTML ="\"LEAVE"; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; - document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; + document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; xferchannellive=1; XDcheck = ''; @@ -4482,11 +4496,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; document.getElementById("VolumeDownSpan").innerHTML = ""; @@ -5916,11 +5930,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; if (quick_transfer_button == 'IN_GROUP') { @@ -6729,9 +6743,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("ParkControl").innerHTML = "\"Park"; document.getElementById("HangupControl").innerHTML = "\"Hangup"; document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; document.getElementById("VolumeDownSpan").innerHTML = ""; @@ -6913,13 +6927,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // document.getElementById("Leave3WayCall").innerHTML ="\"LEAVE"; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; - document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; + document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; } } @@ -7156,9 +7170,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; var DispoChoice = document.vicidial_form.DispoSelection.value; @@ -7198,9 +7212,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.callchannel.value = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; var DispoChoice = document.vicidial_form.DispoSelection.value; @@ -9778,35 +9792,74 @@ Your Status:
Calls Dialing: px;z-index:32;" id="TransferMain"> -
#REMOTE CHANNELHANGUPVOLUME
> -
+ + > + + diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 4bc0ed5e..e9efae9f 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1133,6 +1133,8 @@ if (isset($_GET["agent_choose_territories"])) {$agent_choose_territories=$_GET elseif (isset($_POST["agent_choose_territories"])) {$agent_choose_territories=$_POST["agent_choose_territories"];} if (isset($_GET["carrier_description"])) {$carrier_description=$_GET["carrier_description"];} elseif (isset($_POST["carrier_description"])) {$carrier_description=$_POST["carrier_description"];} +if (isset($_GET["delete_vm_after_email"])) {$delete_vm_after_email=$_GET["delete_vm_after_email"];} + elseif (isset($_POST["delete_vm_after_email"])) {$delete_vm_after_email=$_POST["delete_vm_after_email"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1400,6 +1402,7 @@ if ($non_latin < 1) $rebuild_music_on_hold = ereg_replace("[^NY]","",$rebuild_music_on_hold); $active_agent_login_server = ereg_replace("[^NY]","",$active_agent_login_server); $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); + $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1990,11 +1993,12 @@ else # 91121-0334 - Limited list called count display to 100+ # 91125-0628 - Added conf_secret for servers # 91204-1652 - Added recording_filename and recording_id as script variables +# 91205-2231 - Added delete_vm_after_email voicemail option to phones and extra voicemail sections # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-225'; -$build = '91204-1652'; +$admin_version = '2.2.0-226'; +$build = '91205-2231'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2046,15 +2050,13 @@ $stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_cust $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -4873,6 +4875,10 @@ if ($ADD==99999) Email - This optional setting allows you to have the voicemail messages sent to an email account, if your system is set up to send out email. If this field is empty then no emails will be sent out. +
+
+ Delete Voicemail After Email - This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N. + @@ -4997,6 +5003,15 @@ if ($ADD==99999)
Company - Purely for administrative notes. +
+
+
+ Phones Email - The email address associated with this phone entry. This is used for voicemail settings. + +
+
+ Delete Voicemail After Email - This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N. +

@@ -5292,11 +5307,6 @@ if ($ADD==99999)
Phones Logins List - The comma separated list of phone logins used when an agent logs in using phone load balanced logins. The Agent application will find the active server with the fewest agents logged into it and place a call from that server to the agent upon login. -
-
-
- Phones Email - The email address associated with this phone entry. This is used for voicemail settings. -

@@ -12571,7 +12581,7 @@ if ($ADD==41111111111) { echo "
PHONE MODIFIED: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -13022,7 +13032,7 @@ if ($ADD==471111111111) {echo "
VOICEMAIL BOX NOT MODIFIED - Please go back and look at the data you entered\n";} else { - $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email' where voicemail_id='$voicemail_id';"; + $stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email' where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $stmt="SELECT active_voicemail_server from system_settings;"; @@ -20741,7 +20751,7 @@ if ($ADD==31111111111) echo "
- Transfer - Conference            
+ Transfer - Conference            
+ + + + + + - LOCAL CLOSER - Hangup Xfer Line - Hangup Both Lines + + + + + -
- - Number to call   + + + + + -
+ + + + +
+ + LOCAL CLOSER     + + Hangup Xfer Line +
+ seconds +   + channel + + CONSULTATIVE   + + Hangup Both Lines +
+ Number to call +   +   - DIAL OVERRIDE   - LEAVE 3-WAY CALL - Dial Blind Transfer - D1 - D2 + + DIAL OVERRIDE + + LEAVE 3-WAY CALL +
+ Dial Blind Transfer +   + Dial With Customer +   + Park Customer Dial +   + + D1 + D2 + +   + Blind Transfer VMail Message +
- seconds   - channel - Dial With Customer - Park Customer Dial - Blind Transfer VMail Message
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -20768,6 +20779,7 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21630,16 +21642,17 @@ if ($ADD==371111111111) echo "
\n"; echo ""; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -20753,6 +20763,7 @@ if ($ADD==31111111111) echo "
Phone extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Voicemail Box: $NWB#phones-delete_vm_after_email$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Email: $NWB#phones-email$NWE
Delete Voicemail After Email: $NWB#phones-delete_vm_after_email$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -23607,7 +23621,7 @@ if ($ADD==170000000000) echo "
\n"; echo ""; - $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages from vicidial_voicemail where voicemail_id='$voicemail_id';"; + $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $voicemail_id = $row[0]; - $pass = $row[1]; - $fullname = $row[2]; - $active = $row[3]; - $email = $row[4]; - $messages = $row[5]; - $old_messages = $row[6]; + $voicemail_id = $row[0]; + $pass = $row[1]; + $fullname = $row[2]; + $active = $row[3]; + $email = $row[4]; + $messages = $row[5]; + $old_messages = $row[6]; + $delete_vm_after_email = $row[7]; echo "
MODIFY A VOICEMAIL BOX: $tts_id
\n"; echo "\n"; @@ -21651,6 +21664,7 @@ if ($ADD==371111111111) echo "
Name: $NWB#vicidial_voicemail-fullname$NWE
Email: $NWB#vicidial_voicemail-email$NWE
Active: $NWB#vicidial_voicemail-active$NWE
Delete Voicemail After Email: $NWB#vicidial_voicemail-delete_vm_after_email$NWE
New Messages: $messages
Old Messages: $old_messages
"; echo ""; echo ""; + echo ""; echo "\n"; $o=0; @@ -23635,6 +23650,7 @@ if ($ADD==170000000000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; }
\n"; echo ""; - $stmt="SELECT voicemail_id,fullname,active,messages,old_messages from vicidial_voicemail order by voicemail_id"; + $stmt="SELECT voicemail_id,fullname,active,messages,old_messages,delete_vm_after_email from vicidial_voicemail order by voicemail_id"; $rslt=mysql_query($stmt, $link); $vm_to_print = mysql_num_rows($rslt); @@ -23619,6 +23633,7 @@ if ($ADD==170000000000) echo "ActiveNew MessagesOld MessagesDeleteMODIFY
$row[2]$row[3]$row[4]$row[5]MODIFY