From 8bdfd4f1249857efb50d0c76eeca89be28e2e972 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 26 Dec 2007 16:26:25 +0000 Subject: [PATCH] added hard-code option to kick all calls from conference in vicidial.php in 2.0.4 branch git-svn-id: svn://192.168.202.10@752 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../docs/conf_examples/extensions.conf.sample | 2 + .../conf_examples/extensions.conf.sample-1.4 | 2 + .../agc_2.0.4/www/agc/vdc_db_query.php | 40 ++++++++++++++----- .../branches/agc_2.0.4/www/agc/vicidial.php | 12 ++++-- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample b/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample index 3902f7b0..a8890c64 100644 --- a/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample +++ b/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample @@ -324,6 +324,7 @@ exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; - CID - CID received, add record with phone number ; - CIDLOOKUP - Lookup CID to find record in whole system ; - CIDLOOKUPRL - Restrict lookup to one list +; - CIDLOOKUPRC - Restrict lookup to one campaign's lists ; - CLOSER - Closer calls from VICIDIAL fronters ; - ANI - ANI received, add record with phone number ; - ANILOOKUP - Lookup ANI to find record in whole system @@ -343,6 +344,7 @@ exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; 7. the status of the call initially(usually not used) ; 8. the list_id to insert the new lead under if it is new (and CID/ANI available) ; 9. the phone dialing code to insert with the new lead if new (and CID/ANI available) +; 10. the campaign_id to search within lists if CIDLOOKUPRC ; inbound VICIDIAL call with CID delivery through T1 PRI exten => 1234,1,Answer ; Answer the line exten => 1234,2,AGI(agi-VDAD_ALL_inbound.agi,CID-----LB-----CL_GALLERIA-----7274515134-----Closer-----park----------999-----1) diff --git a/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample-1.4 b/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample-1.4 index 7cc5b008..9fa08fd5 100644 --- a/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample-1.4 +++ b/agc_2-X/branches/agc_2.0.4/docs/conf_examples/extensions.conf.sample-1.4 @@ -323,6 +323,7 @@ exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; - CID - CID received, add record with phone number ; - CIDLOOKUP - Lookup CID to find record in whole system ; - CIDLOOKUPRL - Restrict lookup to one list +; - CIDLOOKUPRC - Restrict lookup to one campaign's lists ; - CLOSER - Closer calls from VICIDIAL fronters ; - ANI - ANI received, add record with phone number ; - ANILOOKUP - Lookup ANI to find record in whole system @@ -342,6 +343,7 @@ exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; 7. the status of the call initially(usually not used) ; 8. the list_id to insert the new lead under if it is new (and CID/ANI available) ; 9. the phone dialing code to insert with the new lead if new (and CID/ANI available) +; 10. the campaign_id to search within lists if CIDLOOKUPRC ; inbound VICIDIAL call with CID delivery through T1 PRI exten => 1234,1,Answer ; Answer the line exten => 1234,2,AGI(agi-VDAD_ALL_inbound.agi,CID-----LB-----CL_GALLERIA-----7274515134-----Closer-----park----------999-----1) diff --git a/agc_2-X/branches/agc_2.0.4/www/agc/vdc_db_query.php b/agc_2-X/branches/agc_2.0.4/www/agc/vdc_db_query.php index 9c15f395..2a65ad5a 100644 --- a/agc_2-X/branches/agc_2.0.4/www/agc/vdc_db_query.php +++ b/agc_2-X/branches/agc_2.0.4/www/agc/vdc_db_query.php @@ -69,6 +69,7 @@ # - $use_internal_dnc - ('Y','N') # - $omit_phone_code - ('Y','N') # - $no_delete_sessions - ('0','1') +# - $LogouTKicKAlL - ('0','1'); # CHANGELOG: # 50629-1044 - First build of script @@ -138,10 +139,11 @@ # 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login # 71125-1751 - Added inbound-group default inbound group sending to vicidial.php # 71129-2025 - restricted callbacks count and list to campaign only +# 71226-1117 - added option to kick all calls from conference upon logout # -$version = '2.0.4-65'; -$build = '71129-2025'; +$version = '2.0.4-66'; +$build = '71226-1117'; require("dbconnect.php"); @@ -274,6 +276,8 @@ if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["e elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} + elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -1934,19 +1938,33 @@ else $rslt=mysql_query($stmt, $link); $wcs_delete = mysql_affected_rows($link); - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) + if ($LogouTKicKAlL > 0) { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; + $local_DEF = 'Local/5555'; + $local_AMP = '@'; + $kick_local_channel = "$local_DEF$conf_exten$local_AMP$ext_context"; + $queryCID = "ULGH3458$StarTtime"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + else + { + ##### Hangup the client phone + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($rslt) + { + $row=mysql_fetch_row($rslt); + $agent_channel = "$row[0]"; + if ($format=='debug') {echo "\n";} + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','ULGH3459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + } $pause_sec=0; $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; diff --git a/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php b/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php index 8558b0d1..d04773b4 100644 --- a/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php +++ b/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php @@ -171,10 +171,11 @@ # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only +# 71226-1117 - added option to kick all calls from conference upon logout # -$version = '2.0.4-142'; -$build = '71129-2025'; +$version = '2.0.4-143'; +$build = '71226-1117'; require("dbconnect.php"); @@ -261,6 +262,7 @@ $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of chann $PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets $LogiNAJAX = '1'; # set to 1 to do lookups $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" +$LogouTKicKAlL = '0'; # set to 1 to hangup all calls in session upon agent logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -1828,6 +1830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; var HidEMonitoRSessionS = ''; + var LogouTKicKAlL = ''; var flag_channels = ''; var flag_string = ''; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; @@ -5254,7 +5257,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -5262,7 +5265,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + alert(VDlogout_query); + alert(xmlhttp.responseText); } } delete xmlhttp;