Fix for Asterisk 1.8
git-svn-id: svn://192.168.202.10@2504 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# SCRIPT_multirecording.php - script page that stops/starts recordings being made over a forced-recording (ALLFORCE) call
|
||||
#
|
||||
# Copyright (C) 2012 Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2016 Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
|
||||
# - works in conjunction with SCRIPT_multirecording_AJAX.php to allow reps the ability to make their own recordings over the course of a call while the entire call is being recorded into its own file, as in ALLFORCE recording.
|
||||
#
|
||||
# Implementation is done by creating a script in the Scripts section that calls this page within an <iframe> tag which passes several essential dialer variables to the page
|
||||
@@ -14,6 +14,7 @@
|
||||
#
|
||||
# CHANGELOG
|
||||
# 120227-1512 - First Build
|
||||
# 160401-0026 - HTML formatting fixes
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -35,6 +36,8 @@ if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code
|
||||
elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>script multirecording button page</title>
|
||||
<style type="text/css">
|
||||
input.red_btn{
|
||||
color:#FFFFFF;
|
||||
@@ -112,7 +115,7 @@ function RecordingAction(campaign, lead_id, phone_number, user, session_id, serv
|
||||
}
|
||||
else if (recording_response=="HANGUP SUCCESSFUL")
|
||||
{
|
||||
document.getElementById("recording_button_span").innerHTML = "<input type=\"button\" class=\"green_btn\" onClick=\"RecordingAction(<?php echo "'$campaign', '$lead_id', '$phone_number', '$user', '$session_id', '$server_ip', '$vendor_lead_code', '$uniqueid'"; ?>, 'START')\" value=\"START RECORDING\">";
|
||||
document.getElementById("recording_button_span").innerHTML = "<input type=\"button\" class=\"green_btn\" onClick=\"RecordingAction(<?php echo "'$campaign', '$lead_id', '$phone_number', '$user', '$session_id', '$server_ip', '$vendor_lead_code', '$uniqueid'"; ?>, 'START');\" value=\"START RECORDING\">";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +123,7 @@ function RecordingAction(campaign, lead_id, phone_number, user, session_id, serv
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<?php echo $PHP_SELF; ?>" method="post" target="_self">
|
||||
<center>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# SCRIPT_multirecording_AJAX.php - script that stops/starts recordings being made over a forced-recording (ALLFORCE) call
|
||||
#
|
||||
# Copyright (C) 2013 Joe Johnson, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2016 Joe Johnson, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Other scripts that this application depends on:
|
||||
# - SCRIPT_multirecording.php: Gives agents ability to stop and start recordings over a forced-recording (ALLFORCE) call
|
||||
@@ -9,6 +9,7 @@
|
||||
# CHANGELOG
|
||||
# 120224-2240 - First Build
|
||||
# 130328-0009 - Converted ereg to preg functions
|
||||
# 160401-0026 - Fix for Asterisk 1.8
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -70,7 +71,7 @@ if ($rec_action=="START")
|
||||
} else {
|
||||
######################## START RECORDING ##########################
|
||||
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";";
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and (channel LIKE \"%,1\" or channel LIKE \"%;1\");";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$channel_SQL=" and channel not in (";
|
||||
while($row=mysql_fetch_array($rslt))
|
||||
@@ -93,7 +94,7 @@ if ($rec_action=="START")
|
||||
usleep(2000000);
|
||||
$recording_id = mysql_insert_id($link);
|
||||
$current_rec_filename=$filename;
|
||||
$channel_stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\" $channel_SQL;";
|
||||
$channel_stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and (channel LIKE \"%,1\" or channel LIKE \"%;1\") $channel_SQL;";
|
||||
$channel_rslt=mysql_query($channel_stmt, $link);
|
||||
if (mysql_num_rows($channel_rslt)==1)
|
||||
{
|
||||
@@ -158,7 +159,7 @@ else
|
||||
}
|
||||
|
||||
# find and hang up the recording
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$recording_channel%\" and channel LIKE \"%,1\";";
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$recording_channel%\" and (channel LIKE \"%,1\" or channel LIKE \"%;1\");";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
$h=0;
|
||||
|
||||
Reference in New Issue
Block a user