From 0f7869146d50ec27af2972c7a721458654bf5508 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 24 Sep 2015 01:07:13 +0000 Subject: [PATCH] Added DID custom fields as webform and script variables in the agent screen git-svn-id: svn://192.168.202.10@2383 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 3 + docs/conf_examples/manager.conf.sample | 2 +- www/agc/dispo_send_email.php | 5 ++ www/agc/functions.php | 7 ++ www/agc/vdc_db_query.php | 63 ++++++++++++++++-- www/agc/vdc_form_display.php | 15 ++++- www/agc/vdc_script_display.php | 30 ++++++++- www/agc/vicidial.php | 59 +++++++++++++++-- www/vicidial/AST_chat_log_report.php | 9 +++ www/vicidial/AST_timeonVDADall.php | 90 ++++++++++++++++++++++---- 10 files changed, 257 insertions(+), 26 deletions(-) diff --git a/UPGRADE b/UPGRADE index e57080d2..8f6d88b5 100644 --- a/UPGRADE +++ b/UPGRADE @@ -150,6 +150,9 @@ OTHER CHANGES: and the admin modify lead pages to follow the database schema field lengths for the default lead fields. +34. Added DID custom fields as webform and script variables + (did_custom_one, did_custom_two,..., did_custom_five) + diff --git a/docs/conf_examples/manager.conf.sample b/docs/conf_examples/manager.conf.sample index 8760d41c..4d614630 100644 --- a/docs/conf_examples/manager.conf.sample +++ b/docs/conf_examples/manager.conf.sample @@ -15,7 +15,7 @@ write = command [listencron] secret = 1234 -read = system,call,log,verbose,command,agent,user +read = system,call,log,verbose,command,agent,user,dtmf write = command [sendcron] diff --git a/www/agc/dispo_send_email.php b/www/agc/dispo_send_email.php index 86086321..e8f55253 100644 --- a/www/agc/dispo_send_email.php +++ b/www/agc/dispo_send_email.php @@ -385,6 +385,11 @@ if ($match_found > 0) $email_subject = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$email_subject); $email_subject = preg_replace('/--A--recording_id--B--/i',"$recording_id",$email_subject); $email_subject = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$email_subject); + $email_subject = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($did_custom_one)),$email_subject); + $email_subject = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($did_custom_two)),$email_subject); + $email_subject = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($did_custom_three)),$email_subject); + $email_subject = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($did_custom_four)),$email_subject); + $email_subject = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($did_custom_five)),$email_subject); $email_subject = urldecode($email_subject); } diff --git a/www/agc/functions.php b/www/agc/functions.php index 3dd2c800..c7179f1f 100644 --- a/www/agc/functions.php +++ b/www/agc/functions.php @@ -28,6 +28,7 @@ # 150111-1541 - Added lists option: local call time(Issue #812) # 150512-0615 - Fix for non-latin customer data # 150724-0843 - Added vicidial_ajax_log function +# 150923-2017 - Added DID custom fields # # $mysql_queries = 20 @@ -877,6 +878,12 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) $CFoutput = preg_replace('/--A--agent_log_id--B--/i',"$agent_log_id",$CFoutput); $CFoutput = preg_replace('/--A--call_id--B--/i',"$call_id",$CFoutput); $CFoutput = preg_replace('/--A--called_count--B--/i',"$called_count",$CFoutput); + $CFoutput = preg_replace('/--A--did_custom_one--B--/i',"$did_custom_one",$CFoutput); + $CFoutput = preg_replace('/--A--did_custom_two--B--/i',"$did_custom_two",$CFoutput); + $CFoutput = preg_replace('/--A--did_custom_three--B--/i',"$did_custom_three",$CFoutput); + $CFoutput = preg_replace('/--A--did_custom_four--B--/i',"$did_custom_four",$CFoutput); + $CFoutput = preg_replace('/--A--did_custom_five--B--/i',"$did_custom_five",$CFoutput); + $CFoutput = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$CFoutput); # custom fields replacement diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 4f5992fd..8b48885d 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -388,10 +388,11 @@ # 150727-0910 - Added default_language # 150728-1049 - Added option for secondary sorting by vendor_lead_code, Issue #833 # 150814-1057 - Added compatibility for custom fields data option +# 150923-2013 - Added DID custom variables to call data transmission # -$version = '2.12-283'; -$build = '150814-1057'; +$version = '2.12-284'; +$build = '150923-2013'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=616; @@ -7225,7 +7226,7 @@ if ($ACTION == 'VDADcheckINCOMING') $DID_id = $row[0]; $DID_extension = $row[1]; - $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00338',$user,$server_ip,$session_name,$one_mysql_log);} @@ -7235,6 +7236,11 @@ if ($ACTION == 'VDADcheckINCOMING') $row=mysqli_fetch_row($rslt); $DID_pattern = $row[0]; $DID_description = $row[1]; + $DID_custom_one = $row[2]; + $DID_custom_two= $row[3]; + $DID_custom_three= $row[4]; + $DID_custom_four= $row[5]; + $DID_custom_five= $row[6]; } } @@ -7386,6 +7392,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $entry_date . "\n"; + $LeaD_InfO .= $DID_custom_one . "\n"; + $LeaD_InfO .= $DID_custom_two . "\n"; + $LeaD_InfO .= $DID_custom_three . "\n"; + $LeaD_InfO .= $DID_custom_four . "\n"; + $LeaD_InfO .= $DID_custom_five . "\n"; echo $LeaD_InfO; @@ -7558,6 +7569,11 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$VDCL_start_call_url); if (strlen($custom_field_names)>2) { @@ -8290,7 +8306,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail') $DID_id = $row[0]; $DID_extension = $row[1]; - $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00510',$user,$server_ip,$session_name,$one_mysql_log);} @@ -8300,6 +8316,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail') $row=mysqli_fetch_row($rslt); $DID_pattern = $row[0]; $DID_description = $row[1]; + $DID_custom_one = $row[2]; + $DID_custom_two= $row[3]; + $DID_custom_three= $row[4]; + $DID_custom_four= $row[5]; + $DID_custom_five= $row[6]; } } @@ -8420,6 +8441,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail') $LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $entry_date . "\n"; + $LeaD_InfO .= $DID_custom_one . "\n"; + $LeaD_InfO .= $DID_custom_two . "\n"; + $LeaD_InfO .= $DID_custom_three . "\n"; + $LeaD_InfO .= $DID_custom_four . "\n"; + $LeaD_InfO .= $DID_custom_five . "\n"; echo $LeaD_InfO; @@ -8591,6 +8617,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail') $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$VDCL_start_call_url); + $VDCL_start_call_url = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$VDCL_start_call_url); if (strlen($custom_field_names)>2) { @@ -9321,7 +9352,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE') $DID_id = $row[0]; $DID_extension = $row[1]; - $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00475',$user,$server_ip,$session_name,$one_mysql_log);} @@ -9331,6 +9362,11 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE') $row=mysqli_fetch_row($rslt); $DID_pattern = $row[0]; $DID_description = $row[1]; + $DID_custom_one = $row[2]; + $DID_custom_two= $row[3]; + $DID_custom_three= $row[4]; + $DID_custom_four= $row[5]; + $DID_custom_five= $row[6]; } } @@ -9493,6 +9529,11 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE') $LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $entry_date . "\n"; + $LeaD_InfO .= $DID_custom_one . "\n"; + $LeaD_InfO .= $DID_custom_two . "\n"; + $LeaD_InfO .= $DID_custom_three . "\n"; + $LeaD_InfO .= $DID_custom_four . "\n"; + $LeaD_InfO .= $DID_custom_five . "\n"; echo $LeaD_InfO; @@ -10891,7 +10932,7 @@ if ($ACTION == 'updateDISPO') $DID_id = $row[0]; $DID_extension = $row[1]; - $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00347',$user,$server_ip,$session_name,$one_mysql_log);} @@ -10901,6 +10942,11 @@ if ($ACTION == 'updateDISPO') $row=mysqli_fetch_row($rslt); $DID_pattern = urlencode(trim($row[0])); $DID_description = urlencode(trim($row[1])); + $DID_custom_one = urlencode(trim($row[2])); + $DID_custom_two= urlencode(trim($row[3])); + $DID_custom_three= urlencode(trim($row[4])); + $DID_custom_four= urlencode(trim($row[5])); + $DID_custom_five= urlencode(trim($row[6])); } } } @@ -11062,6 +11108,11 @@ if ($ACTION == 'updateDISPO') $dispo_call_urlARY[$j] = preg_replace('/--A--recording_id--B--/i',"$recording_id",$dispo_call_urlARY[$j]); $dispo_call_urlARY[$j] = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$dispo_call_urlARY[$j]); $dispo_call_urlARY[$j] = preg_replace('/--A--entry_date--B--/i',"$entry_date",$dispo_call_urlARY[$j]); + $dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$dispo_call_urlARY[$j]); + $dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$dispo_call_urlARY[$j]); + $dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$dispo_call_urlARY[$j]); + $dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$dispo_call_urlARY[$j]); + $dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$dispo_call_urlARY[$j]); if (strlen($FORMcustom_field_names)>2) { diff --git a/www/agc/vdc_form_display.php b/www/agc/vdc_form_display.php index c42b5445..a4f7a97e 100644 --- a/www/agc/vdc_form_display.php +++ b/www/agc/vdc_form_display.php @@ -33,10 +33,11 @@ # 150418-1751 - Added fixed fields to submit output, issue #842 # 150512-0617 - Fix for non-latin customer data # 150609-1923 - Added list_description variable +# 150923-2027 - Added DID custom variables # -$version = '2.12-24'; -$build = '150609-1923'; +$version = '2.12-25'; +$build = '150923-2027'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -176,6 +177,16 @@ if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];} elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];} +if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];} + elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];} +if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];} + elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];} +if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];} + elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];} +if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];} + elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];} +if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];} + elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];} if ($bcrypt == 'OFF') {$bcrypt=0;} diff --git a/www/agc/vdc_script_display.php b/www/agc/vdc_script_display.php index 715f1aa0..6cf8b6f6 100644 --- a/www/agc/vdc_script_display.php +++ b/www/agc/vdc_script_display.php @@ -31,10 +31,11 @@ # 141216-2121 - Added language settings lookups and user/pass variable standardization # 150703-2034 - Added option to fully urlencode variables if IFRAME is used in script Issue #864 # 150725-1622 - Added entry_date variable +# 150923-2028 - Added DID custom variables # -$version = '2.12-25'; -$build = '150725-1622'; +$version = '2.12-26'; +$build = '150923-2028'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -220,6 +221,16 @@ if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];} elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];} +if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];} + elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];} +if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];} + elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];} +if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];} + elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];} +if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];} + elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];} +if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];} + elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];} header ("Content-type: text/html; charset=utf-8"); @@ -445,6 +456,11 @@ if (preg_match("/iframe\ssrc/i",$script_text)) $called_count = urlencode(trim($called_count)); $session_name = urlencode(trim($session_name)); $entry_date = urlencode(trim($entry_date)); + $did_custom_one = urlencode(trim($did_custom_one)); + $did_custom_two = urlencode(trim($did_custom_two)); + $did_custom_three = urlencode(trim($did_custom_three)); + $did_custom_four = urlencode(trim($did_custom_four)); + $did_custom_five = urlencode(trim($did_custom_five)); $web_vars = urlencode(trim($web_vars)); } else @@ -528,6 +544,11 @@ if (preg_match("/iframe\ssrc/i",$script_text)) $called_count = preg_replace('/\s/i','+',$called_count); $session_name = preg_replace('/\s/i','+',$session_name); $entry_date = preg_replace('/\s/i','+',$entry_date); + $did_custom_one = preg_replace('/\s/i','+',$did_custom_one); + $did_custom_two = preg_replace('/\s/i','+',$did_custom_two); + $did_custom_three = preg_replace('/\s/i','+',$did_custom_three); + $did_custom_four = preg_replace('/\s/i','+',$did_custom_four); + $did_custom_five = preg_replace('/\s/i','+',$did_custom_five); $web_vars = preg_replace('/\s/i','+',$web_vars); } } @@ -620,6 +641,11 @@ $script_text = preg_replace('/--A--user_group--B--/i',"$user_group",$script_text $script_text = preg_replace('/--A--called_count--B--/i',"$called_count",$script_text); $script_text = preg_replace('/--A--session_name--B--/i',"$session_name",$script_text); $script_text = preg_replace('/--A--entry_date--B--/i',"$entry_date",$script_text); +$script_text = preg_replace('/--A--did_custom_one--B--/i',"$did_custom_one",$script_text); +$script_text = preg_replace('/--A--did_custom_two--B--/i',"$did_custom_two",$script_text); +$script_text = preg_replace('/--A--did_custom_three--B--/i',"$did_custom_three",$script_text); +$script_text = preg_replace('/--A--did_custom_four--B--/i',"$did_custom_four",$script_text); +$script_text = preg_replace('/--A--did_custom_five--B--/i',"$did_custom_five",$script_text); $script_text = preg_replace('/--A--web_vars--B--/i',"$web_vars",$script_text); if ($CF_uses_custom_fields=='Y') diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 9f482c6e..1b63d0ea 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -499,10 +499,11 @@ # 150808-1439 - Added compatibility for custom fields data option # 150909-0212 - Fixed MDlogEPOCH variable issue #882 # 150917-0926 - Added dynamic default field maxlengths based on DB schema +# 150923-1952 - Added DID custum fields as web and form variables # -$version = '2.12-471c'; -$build = '150917-0926'; +$version = '2.12-472c'; +$build = '150923-1952'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -4130,6 +4131,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var did_id=''; var did_extension=''; var did_description=''; + var did_custom_one=''; + var did_custom_two=''; + var did_custom_three=''; + var did_custom_four=''; + var did_custom_five=''; var closecallid=''; var xfercallid=''; var custom_field_names=''; @@ -7046,6 +7052,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // script color - 57 document.vicidial_form.list_description.value = change_array[58]; entry_date = change_array[59]; + did_custom_one = change_array[60]; + did_custom_two = change_array[61]; + did_custom_three = change_array[62]; + did_custom_four = change_array[63]; + did_custom_five = change_array[64]; if (agent_display_fields.match(adfREGentry_date)) {document.getElementById("entry_dateDISP").innerHTML = entry_date;} @@ -9368,6 +9379,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) CalL_ScripT_color = check_VDIC_array[57]; document.vicidial_form.list_description.value = check_VDIC_array[58]; entry_date = check_VDIC_array[59]; + did_custom_one = check_VDIC_array[60]; + did_custom_two = check_VDIC_array[61]; + did_custom_three = check_VDIC_array[62]; + did_custom_four = check_VDIC_array[63]; + did_custom_five = check_VDIC_array[64]; if (agent_display_fields.match(adfREGentry_date)) {document.getElementById("entry_dateDISP").innerHTML = entry_date;} @@ -9955,6 +9971,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // script color - 53 document.vicidial_form.list_description.value = check_VDIC_array[54]; entry_date = check_VDIC_array[55]; + did_custom_one = check_VDIC_array[56]; + did_custom_two = check_VDIC_array[57]; + did_custom_three = check_VDIC_array[58]; + did_custom_four = check_VDIC_array[59]; + did_custom_five = check_VDIC_array[60]; if (agent_display_fields.match(adfREGentry_date)) {document.getElementById("entry_dateDISP").innerHTML = entry_date;} @@ -11653,6 +11674,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) did_id=''; did_extension=''; did_description=''; + did_custom_one=''; + did_custom_two=''; + did_custom_three=''; + did_custom_four=''; + did_custom_five=''; closecallid=''; xfercallid=''; custom_field_names=''; @@ -13133,6 +13159,11 @@ else "&list_name=" + encodeURIComponent(document.vicidial_form.list_name.value) + "&list_description=" + encodeURIComponent(document.vicidial_form.list_description.value) + "&entry_date=" + entry_date + '' + + "&did_custom_one=" + did_custom_one + '' + + "&did_custom_two=" + did_custom_two + '' + + "&did_custom_three=" + did_custom_three + '' + + "&did_custom_four=" + did_custom_four + '' + + "&did_custom_five=" + did_custom_five + '' + "&web_vars=" + LIVE_web_vars + '' + webform_session; @@ -13356,6 +13387,11 @@ else var SCuser_group = VU_user_group; var SCagent_log_id = agent_log_id; var SCentry_date = entry_date; + var SCdid_custom_one = did_custom_one; + var SCdid_custom_two = did_custom_two; + var SCdid_custom_three = did_custom_three; + var SCdid_custom_four = did_custom_four; + var SCdid_custom_five = did_custom_five; var SCweb_vars = LIVE_web_vars; if (encoded.match(RGiframe)) @@ -13433,6 +13469,11 @@ else SCcall_id = SCcall_id.replace(RGplus,'+'); SCuser_group = SCuser_group.replace(RGplus,'+'); SCentry_date = SCentry_date.replace(RGplus,'+'); + SCdid_custom_one = SCdid_custom_one.replace(RGplus,'+'); + SCdid_custom_two = SCdid_custom_two.replace(RGplus,'+'); + SCdid_custom_three = SCdid_custom_three.replace(RGplus,'+'); + SCdid_custom_four = SCdid_custom_four.replace(RGplus,'+'); + SCdid_custom_five = SCdid_custom_five.replace(RGplus,'+'); SCweb_vars = SCweb_vars.replace(RGplus,'+'); } @@ -13514,6 +13555,11 @@ else var RGcall_id = new RegExp("--A--call_id--B--","g"); var RGuser_group = new RegExp("--A--user_group--B--","g"); var RGentry_date = new RegExp("--A--entry_date--B--","g"); + var RGdid_custom_one = new RegExp("--A--did_custom_one--B--","g"); + var RGdid_custom_two = new RegExp("--A--did_custom_two--B--","g"); + var RGdid_custom_three = new RegExp("--A--did_custom_three--B--","g"); + var RGdid_custom_four = new RegExp("--A--did_custom_four--B--","g"); + var RGdid_custom_five = new RegExp("--A--did_custom_five--B--","g"); var RGweb_vars = new RegExp("--A--web_vars--B--","g"); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); @@ -13594,6 +13640,11 @@ else encoded = encoded.replace(RGcall_id, SCcall_id); encoded = encoded.replace(RGuser_group, SCuser_group); encoded = encoded.replace(RGentry_date, SCentry_date); + encoded = encoded.replace(RGdid_custom_one,SCdid_custom_one); + encoded = encoded.replace(RGdid_custom_two,SCdid_custom_two); + encoded = encoded.replace(RGdid_custom_three,SCdid_custom_three); + encoded = encoded.replace(RGdid_custom_four,SCdid_custom_four); + encoded = encoded.replace(RGdid_custom_five,SCdid_custom_five); encoded = encoded.replace(RGweb_vars, SCweb_vars); } @@ -14431,7 +14482,7 @@ function phone_number_format(formatphone) { var form_entry_list_id = document.vicidial_form.entry_list_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('vcFormIFrame').src='./?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + "&called_count=" + document.vicidial_form.called_count.value + '' +"&web_vars=" + LIVE_web_vars + ''; + document.getElementById('vcFormIFrame').src='./?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + "&called_count=" + document.vicidial_form.called_count.value + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + ''; form_list_id = ''; form_entry_list_id = ''; } @@ -14446,7 +14497,7 @@ function phone_number_format(formatphone) { var form_entry_list_id = document.vicidial_form.entry_list_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' +"&web_vars=" + LIVE_web_vars + ''; + document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + ''; form_list_id = ''; form_entry_list_id = ''; } diff --git a/www/vicidial/AST_chat_log_report.php b/www/vicidial/AST_chat_log_report.php index 2e1deb31..1ccba761 100644 --- a/www/vicidial/AST_chat_log_report.php +++ b/www/vicidial/AST_chat_log_report.php @@ -3,6 +3,10 @@ # # Copyright (C) 2015 Matt Florell , Joe Johnson LICENSE: AGPLv2 # +# This is the report page where you can view report informatio of any of the dialer's chats. The web page will +# display the information about the chat, including the start time and participants, and will also provide links +# allowing you to download transcripts of any chat you wish, based on your account permissions. +# # CHANGES # # 150608-0647 First build @@ -833,6 +837,11 @@ else $GRAPH_text.=" "._QXZ("MESSAGE TIME").""._QXZ("CHAT MEMBER NAME").""._QXZ("MESSAGE")." "; while ($sub_row=mysqli_fetch_array($sub_rslt)) { + $pos=strpos($sub_row["message"], "\n"); + if ($pos) + { + $sub_row["message"]=substr($sub_row["message"],0,$pos)."..."; + } if (strlen($sub_row["message"])>50) {$message=substr($sub_row["message"],0,50)."...";} else {$message=$sub_row["message"];} $ASCII_text.=" | ".$sub_row["message_time"]." "; $ASCII_text.="| ".sprintf("%-28s", substr("$sub_row[chat_member_name]", 0, 28))." "; diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index d5c5e79a..ffa1bb69 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -93,6 +93,7 @@ # 150211-2342 - Added hopper link, issue #825 # 150307-0825 - small cosmetic fix # 150804-0956 - Added WHISPER option agent monitoring +# 150919-0238 - Added display for chats in queue # $version = '2.12-82'; @@ -179,7 +180,7 @@ $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled,allow_chats FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -193,6 +194,7 @@ if ($qm_conf_ct > 0) $SSenable_languages = $row[4]; $SSlanguage_method = $row[5]; $agent_whisper_enabled = $row[6]; + $allow_chats = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2012,16 +2014,33 @@ else { $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $group_SQLand order by queue_priority desc,campaign_id,call_time;"; } + + if ($CALLSdisplay > 0) { $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority,agent_only"; + + ## JCJ Display chats + if ($allow_chats) + { + $chat_stmtA="SELECT vlc.status,group_id as campaign_id,if(length(v.phone_number)=0 or v.phone_number is null, v.phone_number, '**NO PHONE**') as phone_number, '' as server_ip,UNIX_TIMESTAMP(chat_start_time), 'CHAT' as call_type, '' as queue_priority, '' as agent_only"; + } } else { $stmtA = "SELECT status"; + + ## JCJ Display chats + if ($allow_chats) + { + $chat_stmtA="SELECT vlc.status"; + } } + + + $k=0; $agentonlycount=0; $stmt = "$stmtA $stmtB"; @@ -2138,6 +2157,48 @@ if ($parked_to_print > 0) } +if ($allow_chats) + { + $chat_stmtB=" from vicidial_live_chats vlc, vicidial_list v where vlc.status='WAITING' and group_id IN($closer_campaignsSQL) and vlc.lead_id=v.lead_id "; + $chat_stmt="$chat_stmtA $chat_stmtB"; + #$stmt="$chat_stmt UNION $stmtA $stmtB"; + $chat_rslt=mysql_to_mysqli($chat_stmt, $link); + $waiting_to_chat = mysqli_num_rows($chat_rslt); + if ($waiting_to_chat > 0) + { + $i=0; + $chats_waiting=0; + while ($i < $waiting_to_chat) + { + $chat_row=mysqli_fetch_row($chat_rslt); + $chats_waiting++; + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $chat_row[0]; + $CDcampaign_id[$k] = $chat_row[1]; + $CDphone_number[$k] = $chat_row[2]; + $CDserver_ip[$k] = $chat_row[3]; + $CDcall_time[$k] = $chat_row[4]; + $CDcall_type[$k] = $chat_row[5]; + $CDqueue_priority[$k] = $chat_row[6]; + $CDagent_only[$k] = $chat_row[7]; + if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;} + $k++; + } + $i++; + } + if ($chats_waiting > 0) {$F=''; $FG='';} + if ($chats_waiting > 4) {$F=''; $FG='';} + if ($chats_waiting > 9) {$F=''; $FG='';} + if ($chats_waiting > 14) {$F=''; $FG='';} + echo "       $NFB$F  $chats_waiting $FG$NFE "._QXZ("chats waiting for agents")."       \n"; + } + else + { + echo _QXZ(" NO LIVE CHATS WAITING ")." \n"; + } + } + ################################################################################### ###### CALLS WAITING @@ -2147,14 +2208,14 @@ if ($agentonlycount > 0) {$agentonlyheader = _QXZ("AGENTONLY");} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| "._QXZ("STATUS",6)." | "._QXZ("CAMPAIGN",20)." | "._QXZ("PHONE NUMBER",12)." | "._QXZ("SERVER IP",15)." | "._QXZ("DIALTIME",8)."| "._QXZ("CALL TYPE",10)." | "._QXZ("PRIORITY",8)." | $agentonlyheader\n"; -$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| "._QXZ("STATUS",7)." | "._QXZ("CAMPAIGN",20)." | "._QXZ("PHONE NUMBER",12)." | "._QXZ("SERVER IP",15)." | "._QXZ("DIALTIME",8)."| "._QXZ("CALL TYPE",10)." | "._QXZ("PRIORITY",8)." | $agentonlyheader\n"; +$Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { - $Cstatus = sprintf("%-6s", _QXZ("$CDstatus[$p]",6)); #TRANSLATE + $Cstatus = sprintf("%-7s", _QXZ("$CDstatus[$p]",6)); #TRANSLATE $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); # Do not translate $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); # Do not translate $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); # Do not translate @@ -2167,7 +2228,7 @@ while($p<$k) $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); $G = ''; $EG = ''; - if ($CDcall_type[$p] == 'IN') + if ($CDcall_type[$p] == 'IN' || $CDcall_type[$p] == 'CHAT') { $G=""; $EG=''; $Ccampaign_id="$Ccampaign_id"; @@ -2181,7 +2242,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -2680,10 +2741,15 @@ $talking_to_print = mysqli_num_rows($rslt); $G = ''; $EG = ''; if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) { - if ($call_time_S >= 10) {$G=''; $EG='';} - if ($call_time_S >= 60) {$G=''; $EG='';} - if ($call_time_S >= 300) {$G=''; $EG='';} - # if ($call_time_S >= 600) {$G=''; $EG='';} + if ($comments == 'CHAT') {$G=''; $EG=''; $status='CHAT';} + else if ($comments == 'EMAIL') {$G=''; $EG=''; $status='EMAIL';} + else + { + if ($call_time_S >= 10) {$G=''; $EG='';} + if ($call_time_S >= 60) {$G=''; $EG='';} + if ($call_time_S >= 300) {$G=''; $EG='';} + # if ($call_time_S >= 600) {$G=''; $EG='';} + } } if ($Lstatus=='3-WAY') { @@ -2822,6 +2888,8 @@ $talking_to_print = mysqli_num_rows($rslt); $Aecho .= " "._QXZ("System Load Average").": $load_ave   $db_source\n\n"; # $Aecho .= " - "._QXZ("Balanced call")."\n"; + $Aecho .= " - "._QXZ("Agent chatting")."\n"; + $Aecho .= " - "._QXZ("Agent in email")."\n"; $Aecho .= " - "._QXZ("Agent waiting for call")."\n"; $Aecho .= " - "._QXZ("Agent waiting for call > 1 minute")."\n"; $Aecho .= " - "._QXZ("Agent waiting for call > 5 minutes")."\n";