Added recording filename Agent API append option

git-svn-id: svn://192.168.202.10@2096 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2014-04-03 22:55:06 +00:00
parent 88164ea11e
commit e8fbb52338
3 changed files with 35 additions and 18 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2014-03-01
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2014-04-03
This document describes the functions of an API(Application Programming Interface)
for the VICIDIAL Agent screen. This functionality will be rather limited at first
@@ -696,11 +696,14 @@ VALUES:
(this will stop all active recordings onthe agent screen)
STATUS - displays results of active recording and agent session information
(returns: user|recording_id|filename|server|start_time|agent_server|session|agent_status)
stage -
OPTIONAL, value to append to the recording filename, limited to 14 characters, if more it will truncate. Only works with START value
EXAMPLE URLS:
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=recording&value=START
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=recording&value=STOP
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=recording&value=STATUS
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=recording&value=START&stage=_MIDCALL
RESPONSES:
ERROR: no user found - 6666
@@ -708,6 +711,7 @@ ERROR: agent_user is not logged in - 6666
ERROR: stop recording error - 6666|||||192.168.1.5|8600051|PAUSED
SUCCESS: recording function sent - 6666|STOP||||192.168.1.5|8600051|PAUSED
SUCCESS: recording function sent - 6666|START||||192.168.1.5|8600051|PAUSED
SUCCESS: recording function sent - 6666|START_MIDCALL||||192.168.1.5|8600051|PAUSED
NOTICE: not recording - 6666|||||192.168.1.5|8600051|PAUSED
NOTICE: recording active - 6666|121242|20120810-012008__6666_|192.168.1.5|2012-08-10 01:20:10|192.168.1.5|8600051|PAUSED
+10 -5
View File
@@ -72,10 +72,11 @@
# 140126-0701 - Added pause_code function
# 140214-1736 - Added preview_dial_action function
# 140301-2046 - Added options to dial next number and search for lead phone number
# 140403-1738 - Added option to append filename on recording start
#
$version = '2.8-38';
$build = '140301-2046';
$version = '2.8-39';
$build = '140403-1738';
$startMS = microtime();
@@ -788,7 +789,7 @@ if ($function == 'logout')
################################################################################
if ($function == 'recording')
{
if ( ( ($value!='START') and ($value!='STOP') and ($value!='STATUS') ) or ( (strlen($agent_user)<1) and (strlen($alt_user)<2) ) )
if ( ( (!preg_match("/START/",$value)) and (!preg_match("/STOP/",$value)) and (!preg_match("/STATUS/",$value)) ) or ( (strlen($agent_user)<1) and (strlen($alt_user)<2) ) )
{
$result = 'ERROR';
$result_reason = "recording not valid";
@@ -867,7 +868,7 @@ if ($function == 'recording')
}
else
{
if ( ($value=='STOP') and ( ($recording_id=='STOP') or ($recording_id < 1) ) )
if ( (preg_match("/STOP/",$value)) and ( ($recording_id=='STOP') or ($recording_id < 1) ) )
{
$result = 'ERROR';
$result_reason = "stop recording error";
@@ -876,7 +877,11 @@ if ($function == 'recording')
exit;
}
if ( (strlen($stage)>0) and (preg_match("/START/",$value)) )
{
while (strlen($stage)>14) {$stage = preg_replace("/.$/",'',$stage);}
$value = "$value$stage";
}
$stmt="UPDATE vicidial_live_agents set external_recording='$value' where user='$agent_user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
+20 -12
View File
@@ -423,10 +423,11 @@
# 140301-2059 - Added API functions options for SEARCH for phone within lead_id and Dial Next Number
# 140302-1018 - Changes to allow for & and + in standard fields
# 140312-2109 - Added CALLID as recording filename variable
# 140403-1731 - Added recording filename API append option
#
$version = '2.8-392c';
$build = '140312-2109';
$version = '2.8-393c';
$build = '140403-1731';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=79;
$one_mysql_log=0;
@@ -4710,9 +4711,16 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
PauseCodeSelect_submit(api_pause_code);
}
}
if (api_recording=='START')
var regAPIrec = new RegExp("START","g");
if (api_recording.match(regAPIrec))
{
conf_send_recording('MonitorConf', session_id,'','1');
var APIrec_append = api_recording;
if (APIrec_append.length > 5)
{APIrec_append = APIrec_append.replace(regAPIrec, '');}
else
{APIrec_append='';}
conf_send_recording('MonitorConf', session_id,'','1', APIrec_append);
}
if (api_recording=='STOP')
{
@@ -5201,7 +5209,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// ################################################################################
// Send MonitorConf/StopMonitorConf command for recording of conferences
function conf_send_recording(taskconfrectype,taskconfrec,taskconffile,taskfromapi)
function conf_send_recording(taskconfrectype,taskconfrec,taskconffile,taskfromapi,taskapiappend)
{
if (inOUT == 'OUT')
{
@@ -5252,7 +5260,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var REGrecVENDORLEADCODE = new RegExp("VENDORLEADCODE","g");
var REGrecLEADID = new RegExp("LEADID","g");
var REGrecCALLID = new RegExp("CALLID","g");
filename = LIVE_campaign_rec_filename;
filename = LIVE_campaign_rec_filename + '' + taskapiappend;
filename = filename.replace(REGrecCAMPAIGN, campaign);
filename = filename.replace(REGrecINGROUP, VDCL_group_id);
filename = filename.replace(REGrecCUSTPHONE, lead_dial_number);
@@ -5276,13 +5284,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;
}
}
}
if (taskconfrectype == 'StopMonitorConf')
{
filename = taskconffile;
var query_recording_exten = session_id;
var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context;
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + taskconfrec + "','');return false;\"><img src=\"./images/vdc_LB_startrecording.gif\" border=\"0\" alt=\"Start Recording\" /></a>";
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + taskconfrec + "','','','');return false;\"><img src=\"./images/vdc_LB_startrecording.gif\" border=\"0\" alt=\"Start Recording\" /></a>";
if (LIVE_campaign_recording == 'ALLFORCE')
{
document.getElementById("RecorDControl").innerHTML = "<img src=\"./images/vdc_LB_startrecording_OFF.gif\" border=\"0\" alt=\"Start Recording\" />";
@@ -5896,7 +5904,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// alert("VICIDIAL Call log entered:\n" + document.vicidial_form.uniqueid.value);
if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) )
{
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + session_id + "','');return false;\"><img src=\"./images/vdc_LB_startrecording.gif\" border=\"0\" alt=\"Start Recording\" /></a>";
var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + session_id + "','','','');return false;\"><img src=\"./images/vdc_LB_startrecording.gif\" border=\"0\" alt=\"Start Recording\" /></a>";
if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') )
{
document.getElementById("RecorDControl").innerHTML = "<img src=\"./images/vdc_LB_startrecording_OFF.gif\" border=\"0\" alt=\"Start Recording\" />";
@@ -13922,7 +13930,7 @@ function phone_number_format(formatphone) {
{all_record_count++;}
else
{
conf_send_recording('MonitorConf',session_id ,'');
conf_send_recording('MonitorConf',session_id ,'','','');
all_record = 'NO';
all_record_count=0;
}
@@ -14689,8 +14697,8 @@ $zi=2;
<font class="body_tiny"><span id="RecorDingFilename"></span></font><br />
RECORD ID: <font class="body_small"><span id="RecorDID"></span></font><br />
<center>
<!-- <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + head_conf + "','');return false;\">Record</a> -->
<span style="background-color: <?php echo $MAIN_COLOR ?>" id="RecorDControl"><a href="#" onclick="conf_send_recording('MonitorConf',session_id,'');return false;"><img src="./images/vdc_LB_startrecording.gif" border="0" alt="Start Recording" /></a></span><br />
<!-- <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + head_conf + "','','','');return false;\">Record</a> -->
<span style="background-color: <?php echo $MAIN_COLOR ?>" id="RecorDControl"><a href="#" onclick="conf_send_recording('MonitorConf',session_id,'','','');return false;"><img src="./images/vdc_LB_startrecording.gif" border="0" alt="Start Recording" /></a></span><br />
<span id="SpacerSpanA"><img src="./images/blank.gif" width="145px" height="16px" border="0" /></span><br />
<span style="background-color: #FFFFFF" id="WebFormSpan"><img src="./images/vdc_LB_webform_OFF.gif" border="0" alt="Web Form" /></span><br />
<?php