From e3752dd4963f7a4d0c821bc23442e9d3785b7d04 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 13 Jan 2016 19:57:42 +0000 Subject: [PATCH] Fix for numeric audio files in playback function in the agent API git-svn-id: svn://192.168.202.10@2467 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/agc/api.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/www/agc/api.php b/www/agc/api.php index 1b6173d6..3127dbc0 100644 --- a/www/agc/api.php +++ b/www/agc/api.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with the VICIDIAL Agent screen @@ -84,10 +84,11 @@ # 150512-2027 - Added filtering of hash sign on some input variables, Issue #851 # 150626-2120 - Modified mysqli_error() to mysqli_connect_error() where appropriate # 150928-1157 - Fix allowing for * and # in phone_number field +# 160113-0921 - Fix for numeric audio files in playback function # -$version = '2.12-50'; -$build = '150928-1157'; +$version = '2.12-51'; +$build = '160113-0921'; $startMS = microtime(); @@ -1328,6 +1329,8 @@ if ($function == 'audio_playback') if ( (strlen($VLAconf_exten) > 5) and (strlen($VLAserver_ip) > 5) ) { + $valueCIDfull = "\"$value\" <473782158521111>"; + $stmt = "select ext_context from servers where server_ip='$VLAserver_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -1360,7 +1363,7 @@ if ($function == 'audio_playback') $data = "$epoch"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - $stmtX="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$VLAserver_ip','','Originate','$value','Channel: Local\/47378216$VLAconf_exten@$ext_context','Context: $ext_context','Exten: 473782158521111','Priority: 1','CallerID: $value','','','','','');"; + $stmtX="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$VLAserver_ip','','Originate','$value','Channel: Local\/47378216$VLAconf_exten@$ext_context','Context: $ext_context','Exten: 473782158521111','Priority: 1','CallerID: $valueCIDfull','','','','','');"; } else { @@ -1374,7 +1377,7 @@ if ($function == 'audio_playback') } else { - $stmtX="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$VLAserver_ip','','Originate','$value','Channel: Local\/47378216$VLAconf_exten@$ext_context','Context: $ext_context','Exten: 473782158521111','Priority: 1','CallerID: $value','','','','','');"; + $stmtX="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$VLAserver_ip','','Originate','$value','Channel: Local\/47378216$VLAconf_exten@$ext_context','Context: $ext_context','Exten: 473782158521111','Priority: 1','CallerID: $valueCIDfull','','','','','');"; } } else