Added webform_one-three variables to the update_campaign Non-Agent API function

Fix for displaying CID info on outbound calls that were blind transferred on the Admin Modify Lead page

git-svn-id: svn://192.168.202.10@3878 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-10-04 21:00:16 +00:00
parent 54d55ea291
commit 513ce92383
3 changed files with 148 additions and 20 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-08-24 NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-10-04
This document describes the functions of an API(Application Programming This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -227,6 +227,7 @@ Changes:
240718-1716 - Added fields to campaigns_list function output 240718-1716 - Added fields to campaigns_list function output
240730-1832 - Changes for PHP8 compatibility, Added copy_did function 240730-1832 - Changes for PHP8 compatibility, Added copy_did function
240824-1626 - Added user_details function 240824-1626 - Added user_details function
241004-1518 - Added webform_one-three variables to the update_campaign function
API Functions use the 'function' variable API Functions use the 'function' variable
@@ -2436,8 +2437,12 @@ xferconf_four - Transfer - Conf Number 4: 1-50 characters
xferconf_five - Transfer - Conf Number 5: 1-50 characters xferconf_five - Transfer - Conf Number 5: 1-50 characters
dispo_call_url - URL for the Dispo URL(If using a full non-local URL must include 'http://' or 'https://') Must be URL-encoded if sending request as a URL dispo_call_url - URL for the Dispo URL(If using a full non-local URL must include 'http://' or 'https://') Must be URL-encoded if sending request as a URL
EXAMPLE URL-ENCODED URL: "http://vicidial.org/query.php?var1=X&var2=y" = "http%3A%2F%2Fvicidial.org%2Fquery.php%3Fvar1%3DX%26var2%3Dy" EXAMPLE URL-ENCODED URL: "http://vicidial.org/query.php?var1=X&var2=y" = "http%3A%2F%2Fvicidial.org%2Fquery.php%3Fvar1%3DX%26var2%3Dy"
webform_one - URL for the Agent Screen Webform button(If using a full non-local URL must include 'http://' or 'https://') Must be URL-encoded if using a full URL
webform_two - URL for the Agent Screen Webform 2 button(If using a full non-local URL must include 'http://' or 'https://') Must be URL-encoded if using a full URL
webform_three - URL for the Agent Screen Webform 3 button(If using a full non-local URL must include 'http://' or 'https://') Must be URL-encoded if using a full URL
NOTES: NOTES:
- please use no special characters like apostrophes, quotes or amphersands - please use no special characters like apostrophes, quotes or amphersands
- for the last 9 fields above, you can set them to blank '' by using '--BLANK--' as the value(without the quotes)
Example URL strings for API calls: Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_campaign&campaign_id=TESTOUT&campaign_name=Updated+test+API+campaign&auto_dial_level=3.0 http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_campaign&campaign_id=TESTOUT&campaign_name=Updated+test+API+campaign&auto_dial_level=3.0
@@ -2479,6 +2484,10 @@ ERROR: update_campaign DIAL STATUS ADD FAILURE, TOO MANY EXISTING DIAL STATUSES,
ERROR: update_campaign DIAL STATUS REMOVE IS NOT VALID, THIS IS AN OPTIONAL FIELD - |6666|A1234567| ERROR: update_campaign DIAL STATUS REMOVE IS NOT VALID, THIS IS AN OPTIONAL FIELD - |6666|A1234567|
ERROR: update_campaign DIAL STATUS REMOVE FAILURE, NO EXISTING DIAL STATUSES SET, THIS IS AN OPTIONAL FIELD - |666666|A12345| ERROR: update_campaign DIAL STATUS REMOVE FAILURE, NO EXISTING DIAL STATUSES SET, THIS IS AN OPTIONAL FIELD - |666666|A12345|
ERROR: update_campaign DIAL STATUS REMOVE FAILURE, NOT AN EXISTING DIAL STATUS, THIS IS AN OPTIONAL FIELD - |666666|A12345| ERROR: update_campaign DIAL STATUS REMOVE FAILURE, NOT AN EXISTING DIAL STATUS, THIS IS AN OPTIONAL FIELD - |666666|A12345|
ERROR: update_campaign DISPO CALL URL IS NOT VALID, THIS IS AN OPTIONAL FIELD: |6666|XY
ERROR: update_campaign WENFORM 1 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD: |6666|XY
ERROR: update_campaign WENFORM 2 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD: |6666|XY
ERROR: update_campaign WENFORM 3 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD: |6666|XY
NOTICE: update_campaign NO UPDATES DEFINED - 6666| NOTICE: update_campaign NO UPDATES DEFINED - 6666|
NOTICE: update_campaign HOPPER HAS BEEN RESET - 6666|1101|324 NOTICE: update_campaign HOPPER HAS BEEN RESET - 6666|1101|324
SUCCESS: update_campaign CAMPAIGN HAS BEEN UPDATED - 6666|1101 SUCCESS: update_campaign CAMPAIGN HAS BEEN UPDATED - 6666|1101
@@ -118,6 +118,7 @@
# 231117-1920 - Added vicidial_3way_press_log display # 231117-1920 - Added vicidial_3way_press_log display
# 231126-2218 - Added vicidial_hci_log display # 231126-2218 - Added vicidial_hci_log display
# 240704-2329 - Added coldstorage log view option # 240704-2329 - Added coldstorage log view option
# 241002-0936 - Fix for displaying CID info on outbound calls that were blind transferred
# #
require("dbconnect_mysqli.php"); require("dbconnect_mysqli.php");
@@ -1870,6 +1871,8 @@ else
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$uniqueid = $row[0];
if (strlen($log_campaign)<1) {$log_campaign = $row[3];} if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
if (preg_match("/1$|3$|5$|7$|9$/i", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";} {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
@@ -1883,7 +1886,7 @@ else
$call_log .= "<td align=left><font size=2> $row[7]</td>\n"; $call_log .= "<td align=left><font size=2> $row[7]</td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') ) if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{ {
$call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log','$row[0]','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n"; $call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log','$uniqueid','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_log_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n"; $HTML_inline_script .= "vicidial_log_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n";
} }
else else
@@ -1898,9 +1901,10 @@ else
if ($CIDdisplay=="Yes") if ($CIDdisplay=="Yes")
{ {
$caller_code=''; $caller_code='';
$stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid='$row[0]' limit 1;"; $stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid='$uniqueid' limit 1;";
$rsltA=mysql_to_mysqli($stmtA, $link); $rsltA=mysql_to_mysqli($stmtA, $link);
$cc_to_print = mysqli_num_rows($rsltA); $cc_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cc_to_print|$stmtA|\n";}
if ($cc_to_print > 0) if ($cc_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -1908,9 +1912,20 @@ else
$VLEserver_ip = $rowA[1]; $VLEserver_ip = $rowA[1];
} }
$outbound_cid=''; $VDLcall_date='0'; $outbound_cid=''; $VDLcall_date='0';
$stmtA="SELECT outbound_cid,server_ip,call_date FROM vicidial_dial_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code' order by call_date limit 1;";
if (!preg_match("/^M|^V/",$caller_code))
{
$temp_uniqueid = explode('.',$uniqueid);
$temp_uniqueid_epoch = $temp_uniqueid[0];
$temp_uniqueid_before = ($temp_uniqueid[1] - 1);
$temp_uniqueid_after = ($temp_uniqueid[1] + 1);
$temp_uniqueidSQL = "'$temp_uniqueid_epoch.$temp_uniqueid_before','$uniqueid','$temp_uniqueid_epoch.$temp_uniqueid_after'";
$stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid IN($temp_uniqueidSQL) order by call_date limit 1;";
}
$rsltA=mysql_to_mysqli($stmtA, $link); $rsltA=mysql_to_mysqli($stmtA, $link);
$cid_to_print = mysqli_num_rows($rsltA); $cid_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cid_to_print|$stmtA|\n";}
if ($cid_to_print > 0) if ($cid_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -1918,6 +1933,8 @@ else
$outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid); $outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid);
$VDLserver_ip = $rowA[1]; $VDLserver_ip = $rowA[1];
$VDLcall_date = $rowA[2]; $VDLcall_date = $rowA[2];
if (strlen($rowA[3]) > 0) {$uniqueid = $rowA[3];}
$caller_code = $rowA[4];
} }
$outbound_cid_num=''; $outbound_cid_type=''; $outbound_cid_num=''; $outbound_cid_type='';
$stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;";
@@ -1933,11 +1950,11 @@ else
if ($SSsip_event_logging > 0) if ($SSsip_event_logging > 0)
{ {
$call_log .= "<td align=left nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=left nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
else else
{ {
$call_log .= "<td align=left nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=left nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
$AMDSTATUS=''; $AMDRESPONSE=''; $AMDSTATUS=''; $AMDRESPONSE='';
$stmtA="SELECT AMDSTATUS,AMDRESPONSE FROM vicidial_amd_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code';"; $stmtA="SELECT AMDSTATUS,AMDRESPONSE FROM vicidial_amd_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code';";
@@ -2138,6 +2155,7 @@ else
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$uniqueid = $row[0];
if (strlen($log_campaign)<1) {$log_campaign = $row[3];} if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
if (preg_match("/1$|3$|5$|7$|9$/i", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";} {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
@@ -2151,7 +2169,7 @@ else
$call_log .= "<td align=left><font size=2> $row[7]</td>\n"; $call_log .= "<td align=left><font size=2> $row[7]</td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') ) if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{ {
$call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_archive_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log_archive','$row[0]','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n"; $call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_archive_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log_archive','$uniqueid','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_log_archive_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n"; $HTML_inline_script .= "vicidial_log_archive_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n";
} }
else else
@@ -2166,9 +2184,10 @@ else
if ($CIDdisplay=="Yes") if ($CIDdisplay=="Yes")
{ {
$caller_code=''; $caller_code='';
$stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended_archive WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid='$row[0]';"; $stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended_archive WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid='$uniqueid';";
$rsltA=mysql_to_mysqli($stmtA, $link); $rsltA=mysql_to_mysqli($stmtA, $link);
$cc_to_print = mysqli_num_rows($rsltA); $cc_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cc_to_print|$stmtA|\n";}
if ($cc_to_print > 0) if ($cc_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -2176,9 +2195,20 @@ else
$VLEserver_ip = $rowA[1]; $VLEserver_ip = $rowA[1];
} }
$outbound_cid=''; $VDLcall_date='0'; $outbound_cid=''; $VDLcall_date='0';
$stmtA="SELECT outbound_cid,server_ip,call_date FROM vicidial_dial_log_archive WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log_archive WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code' order by call_date limit 1;";
if (!preg_match("/^M|^V/",$caller_code))
{
$temp_uniqueid = explode('.',$uniqueid);
$temp_uniqueid_epoch = $temp_uniqueid[0];
$temp_uniqueid_before = ($temp_uniqueid[1] - 1);
$temp_uniqueid_after = ($temp_uniqueid[1] + 1);
$temp_uniqueidSQL = "'$temp_uniqueid_epoch.$temp_uniqueid_before','$uniqueid','$temp_uniqueid_epoch.$temp_uniqueid_after'";
$stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid IN($temp_uniqueidSQL) order by call_date limit 1;";
}
$rsltA=mysql_to_mysqli($stmtA, $link); $rsltA=mysql_to_mysqli($stmtA, $link);
$cid_to_print = mysqli_num_rows($rsltA); $cid_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cid_to_print|$stmtA|\n";}
if ($cid_to_print > 0) if ($cid_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -2186,6 +2216,8 @@ else
$outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid); $outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid);
$VDLserver_ip = $rowA[1]; $VDLserver_ip = $rowA[1];
$VDLcall_date = $rowA[2]; $VDLcall_date = $rowA[2];
if (strlen($rowA[3]) > 0) {$uniqueid = $rowA[3];}
$caller_code = $rowA[4];
} }
$outbound_cid_num=''; $outbound_cid_type=''; $outbound_cid_num=''; $outbound_cid_type='';
$stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log_archive WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log_archive WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;";
@@ -2201,11 +2233,11 @@ else
if ($SSsip_event_logging > 0) if ($SSsip_event_logging > 0)
{ {
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
else else
{ {
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
} }
$call_log .= "</tr>\n"; $call_log .= "</tr>\n";
@@ -2369,7 +2401,7 @@ else
# $log_campaign = ''; # $log_campaign = '';
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt); $uniqueid = $row[0];
if (strlen($log_campaign)<1) {$log_campaign = $row[3];} if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
if (preg_match("/1$|3$|5$|7$|9$/i", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";} {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
@@ -2383,7 +2415,7 @@ else
$call_log .= "<td align=left><font size=2> $row[7]</td>\n"; $call_log .= "<td align=left><font size=2> $row[7]</td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') ) if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{ {
$call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_archive_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log_archive','$row[0]','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n"; $call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_archive_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log_archive','$uniqueid','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_log_archive_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n"; $HTML_inline_script .= "vicidial_log_archive_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n";
} }
else else
@@ -2398,9 +2430,10 @@ else
if ($CIDdisplay=="Yes") if ($CIDdisplay=="Yes")
{ {
$caller_code=''; $caller_code='';
$stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and uniqueid='$row[0]';"; $stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and uniqueid='$uniqueid';";
$rsltA=mysql_to_mysqli($stmtA, $linkCS); $rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cc_to_print = mysqli_num_rows($rsltA); $cc_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cc_to_print|$stmtA|\n";}
if ($cc_to_print > 0) if ($cc_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -2408,9 +2441,20 @@ else
$VLEserver_ip = $rowA[1]; $VLEserver_ip = $rowA[1];
} }
$outbound_cid=''; $VDLcall_date='0'; $outbound_cid=''; $VDLcall_date='0';
$stmtA="SELECT outbound_cid,server_ip,call_date FROM vicidial_dial_log_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and caller_code='$caller_code' order by call_date limit 1;";
if (!preg_match("/^M|^V/",$caller_code))
{
$temp_uniqueid = explode('.',$uniqueid);
$temp_uniqueid_epoch = $temp_uniqueid[0];
$temp_uniqueid_before = ($temp_uniqueid[1] - 1);
$temp_uniqueid_after = ($temp_uniqueid[1] + 1);
$temp_uniqueidSQL = "'$temp_uniqueid_epoch.$temp_uniqueid_before','$uniqueid','$temp_uniqueid_epoch.$temp_uniqueid_after'";
$stmtA="SELECT outbound_cid,server_ip,call_date,uniqueid,caller_code FROM vicidial_dial_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and uniqueid IN($temp_uniqueidSQL) order by call_date limit 1;";
}
$rsltA=mysql_to_mysqli($stmtA, $linkCS); $rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cid_to_print = mysqli_num_rows($rsltA); $cid_to_print = mysqli_num_rows($rsltA);
if ($DB) {echo "$cid_to_print|$stmtA|\n";}
if ($cid_to_print > 0) if ($cid_to_print > 0)
{ {
$rowA=mysqli_fetch_row($rsltA); $rowA=mysqli_fetch_row($rsltA);
@@ -2418,6 +2462,8 @@ else
$outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid); $outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid);
$VDLserver_ip = $rowA[1]; $VDLserver_ip = $rowA[1];
$VDLcall_date = $rowA[2]; $VDLcall_date = $rowA[2];
if (strlen($rowA[3]) > 0) {$uniqueid = $rowA[3];}
$caller_code = $rowA[4];
} }
$outbound_cid_num=''; $outbound_cid_type=''; $outbound_cid_num=''; $outbound_cid_type='';
$stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log_archive WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;"; $stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log_archive WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;";
@@ -2433,11 +2479,11 @@ else
if ($SSsip_event_logging > 0) if ($SSsip_event_logging > 0)
{ {
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
else else
{ {
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n"; $call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $uniqueid</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
} }
} }
$call_log .= "</tr>\n"; $call_log .= "</tr>\n";
+76 -3
View File
@@ -216,10 +216,11 @@
# 240718-1716 - Added fields to campaigns_list function output # 240718-1716 - Added fields to campaigns_list function output
# 240730-1832 - Changes for PHP8 compatibility, Added copy_did function # 240730-1832 - Changes for PHP8 compatibility, Added copy_did function
# 240824-1626 - Added user_details function # 240824-1626 - Added user_details function
# 241004-1518 - Added webform_one-three variables to the update_campaign function
# #
$version = '2.14-193'; $version = '2.14-194';
$build = '240824-1626'; $build = '241004-1518';
$php_script='non_agent_api.php'; $php_script='non_agent_api.php';
$api_url_log = 0; $api_url_log = 0;
$camp_lead_order_random=1; $camp_lead_order_random=1;
@@ -744,6 +745,12 @@ if (isset($_GET["source_did_pattern"])) {$source_did_pattern=$_GET["source_di
elseif (isset($_POST["source_did_pattern"])) {$source_did_pattern=$_POST["source_did_pattern"];} elseif (isset($_POST["source_did_pattern"])) {$source_did_pattern=$_POST["source_did_pattern"];}
if (isset($_GET["new_dids"])) {$new_dids=$_GET["new_dids"];} if (isset($_GET["new_dids"])) {$new_dids=$_GET["new_dids"];}
elseif (isset($_POST["new_dids"])) {$new_dids=$_POST["new_dids"];} elseif (isset($_POST["new_dids"])) {$new_dids=$_POST["new_dids"];}
if (isset($_GET["webform_one"])) {$webform_one=$_GET["webform_one"];}
elseif (isset($_POST["webform_one"])) {$webform_one=$_POST["webform_one"];}
if (isset($_GET["webform_two"])) {$webform_two=$_GET["webform_two"];}
elseif (isset($_POST["webform_two"])) {$webform_two=$_POST["webform_two"];}
if (isset($_GET["webform_three"])) {$webform_three=$_GET["webform_three"];}
elseif (isset($_POST["webform_three"])) {$webform_three=$_POST["webform_three"];}
$DB=preg_replace('/[^0-9]/','',$DB); $DB=preg_replace('/[^0-9]/','',$DB);
@@ -981,6 +988,9 @@ if ($non_latin < 1)
$web_form_address_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address_two); $web_form_address_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address_two);
$web_form_address_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address_three); $web_form_address_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address_three);
$dispo_call_url=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$dispo_call_url); $dispo_call_url=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$dispo_call_url);
$webform_one=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$webform_one);
$webform_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$webform_two);
$webform_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$webform_three);
$url_address=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$url_address); $url_address=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$url_address);
$uniqueid=preg_replace('/[^- \.\_0-9a-zA-Z]/','',$uniqueid); $uniqueid=preg_replace('/[^- \.\_0-9a-zA-Z]/','',$uniqueid);
$alias_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$alias_id); $alias_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$alias_id);
@@ -1137,6 +1147,9 @@ else
$web_form_address_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$web_form_address_two); $web_form_address_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$web_form_address_two);
$web_form_address_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$web_form_address_three); $web_form_address_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$web_form_address_three);
$dispo_call_url=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$dispo_call_url); $dispo_call_url=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$dispo_call_url);
$webform_one=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$webform_one);
$webform_two=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$webform_two);
$webform_three=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$webform_three);
$url_address=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$url_address); $url_address=preg_replace('/[^- %=\+\.\:\/\@\?\&\_0-9\p{L}]/u','',$url_address);
$uniqueid=preg_replace('/[^- \.\_0-9\p{L}]/u','',$uniqueid); $uniqueid=preg_replace('/[^- \.\_0-9\p{L}]/u','',$uniqueid);
$alias_id = preg_replace('/[^-\_0-9\p{L}]/u', '',$alias_id); $alias_id = preg_replace('/[^-\_0-9\p{L}]/u', '',$alias_id);
@@ -8600,6 +8613,9 @@ if ($function == 'update_campaign')
$list_order_randomizeSQL=''; $list_order_randomizeSQL='';
$list_order_secondarySQL=''; $list_order_secondarySQL='';
$dial_statusesSQL=''; $dial_statusesSQL='';
$webform_oneSQL='';
$webform_twoSQL='';
$webform_threeSQL='';
if (strlen($auto_dial_level) > 0) if (strlen($auto_dial_level) > 0)
{ {
@@ -8864,6 +8880,63 @@ if ($function == 'update_campaign')
{$dispo_call_urlSQL = " ,dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "'";} {$dispo_call_urlSQL = " ,dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "'";}
} }
} }
if (strlen($webform_one) > 0)
{
if ($webform_one == '--BLANK--')
{$webform_oneSQL = " ,web_form_address=''";}
else
{
if ( (strlen($webform_one) < 3) or (strlen($webform_one) > 65000) )
{
$result = 'ERROR';
$result_reason = "update_campaign WENFORM 1 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD";
$data = "$webform_one";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{$webform_oneSQL = " ,web_form_address='" . mysqli_real_escape_string($link, $webform_one) . "'";}
}
}
if (strlen($webform_two) > 0)
{
if ($webform_two == '--BLANK--')
{$webform_twoSQL = " ,web_form_address_two=''";}
else
{
if ( (strlen($webform_two) < 3) or (strlen($webform_two) > 65000) )
{
$result = 'ERROR';
$result_reason = "update_campaign WENFORM 2 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD";
$data = "$webform_two";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{$webform_twoSQL = " ,web_form_address_two='" . mysqli_real_escape_string($link, $webform_two) . "'";}
}
}
if (strlen($webform_three) > 0)
{
if ($webform_three == '--BLANK--')
{$webform_threeSQL = " ,web_form_address_three=''";}
else
{
if ( (strlen($webform_three) < 3) or (strlen($webform_three) > 65000) )
{
$result = 'ERROR';
$result_reason = "update_campaign WENFORM 3 URL IS NOT VALID, THIS IS AN OPTIONAL FIELD";
$data = "$webform_three";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{$webform_threeSQL = " ,web_form_address_three='" . mysqli_real_escape_string($link, $webform_three) . "'";}
}
}
if (strlen($list_order) > 0) if (strlen($list_order) > 0)
{ {
if ( ($camp_lead_order_random > 0) and (preg_match("/RANDOM/i",$list_order)) ) if ( ($camp_lead_order_random > 0) and (preg_match("/RANDOM/i",$list_order)) )
@@ -9030,7 +9103,7 @@ if ($function == 'update_campaign')
{$dial_statusesSQL = ",dial_statuses='$dial_statusesSQL'";} {$dial_statusesSQL = ",dial_statuses='$dial_statusesSQL'";}
$updateSQL = "$campaignnameSQL$activeSQL$dialtimeoutSQL$hopperlevelSQL$campaignvdadextenSQL$adaptivemaximumlevelSQL$dialmethodSQL$autodiallevelSQL$campaigncidSQL$campaignfilterSQL$xferconf_oneSQL$xferconf_twoSQL$xferconf_threeSQL$xferconf_fourSQL$xferconf_fiveSQL$list_orderSQL$list_order_randomizeSQL$list_order_secondarySQL$dial_statusesSQL$dispo_call_urlSQL"; $updateSQL = "$campaignnameSQL$activeSQL$dialtimeoutSQL$hopperlevelSQL$campaignvdadextenSQL$adaptivemaximumlevelSQL$dialmethodSQL$autodiallevelSQL$campaigncidSQL$campaignfilterSQL$xferconf_oneSQL$xferconf_twoSQL$xferconf_threeSQL$xferconf_fourSQL$xferconf_fiveSQL$list_orderSQL$list_order_randomizeSQL$list_order_secondarySQL$dial_statusesSQL$webform_oneSQL$webform_twoSQL$webform_threeSQL$dispo_call_urlSQL";
if (strlen($updateSQL)< 3) if (strlen($updateSQL)< 3)
{ {