Skip to main content

Vicidial Enable Contact on Agent Screen and Transfer on Mobile

Enable Contact in System Settings

Changes in Campaign:-

Enable Transfer Preset : CONTACTS

Custom 3-Way Button Transfer : VIEW_CONTACTS






Changes required for like search





_____________________________________________________
in /agc/vdc_db_query.php file modification.



############################################################################################################################################################
### SEARCHCONTACTSRESULTSview - display search results for contacts search // Added by Manish date 15-03-2022 LIKE SEARCH RESULTSview for forest department
############################################################################################################################################################
if ($ACTION == 'SEARCHCONTACTSRESULTSview')
{
if (strlen($stage) < 3)
{$stage = '670';}

$stmt="SELECT agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00431',$user,$server_ip,$session_name,$one_mysql_log);}
$camps_to_print = mysqli_num_rows($rslt);
if ($camps_to_print > 0)
{
$row=mysqli_fetch_row($rslt);
$agent_lead_search_method = $row[0];
$manual_dial_list_id = $row[1];

$searchSQL='';
$searchmethodSQL='';

$last_name = preg_replace("/\'|\"|\\\\|;/","",$last_name);
$first_name = preg_replace("/\'|\"|\\\\|;/","",$first_name);
$phone_number = preg_replace("/\'|\"|\\\\|;/","",$phone_number);
$bu_name = preg_replace("/\'|\"|\\\\|;/","",$bu_name);
$department = preg_replace("/\'|\"|\\\\|;/","",$department);
$group_name = preg_replace("/\'|\"|\\\\|;/","",$group_name);
$job_title = preg_replace("/\'|\"|\\\\|;/","",$job_title);
$location = preg_replace("/\'|\"|\\\\|;/","",$location);

if (strlen($phone_number) >= 2)
{
$searchSQL .= "office_num LIKE '$%phone_number%'";
}
elseif (strlen($last_name) > 0)
{
$searchSQL = "last_name LIKE \"%$last_name%\"";
if (strlen($first_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "first_name LIKE \"$first_name\"";
}
if (strlen($bu_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "bu_name LIKE \"%$bu_name%\"";
}
if (strlen($department) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "department LIKE \"%$department%\"";
}
if (strlen($group_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "group_name LIKE \"%$group_name%\"";
}
if (strlen($job_title) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "job_title LIKE \"%$job_title%\"";
}
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($first_name) > 0)
{
$searchSQL = "first_name LIKE \"%$first_name%\"";
if (strlen($bu_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "bu_name LIKE \"%$bu_name%\"";
}
if (strlen($department) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "department LIKE \"%$department%\"";
}
if (strlen($group_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "group_name LIKE \"%$group_name%\"";
}
if (strlen($job_title) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "job_title LIKE \"%$job_title%\"";
}
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($bu_name) > 0)
{
$searchSQL = "bu_name LIKE \"$bu_name\"";
if (strlen($department) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "department LIKE \"%$department%\"";
}
if (strlen($group_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "group_name LIKE \"%$group_name%\"";
}
if (strlen($job_title) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "job_title LIKE \"%$job_title%\"";
}
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($department) > 0)
{
$searchSQL = "department LIKE \"%$department%\"";
if (strlen($group_name) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "group_name LIKE \"%$group_name%\"";
}
if (strlen($job_title) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "job_title LIKE \"%$job_title%\"";
}
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($group_name) > 0)
{
$searchSQL = "group_name LIKE \"%$group_name%\"";
if (strlen($job_title) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "job_title LIKE \"%$job_title%\"";
}
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($job_title) > 0)
{
$searchSQL = "job_title LIKE \"%$job_title%\"";
if (strlen($location) > 0)
{
if (strlen($searchSQL) > 10) {$searchSQL .= " and ";}
$searchSQL .= "location LIKE \"%$location%\"";
}
}
elseif (strlen($location) > 0)
{
$searchSQL = "location LIKE \"%$location%\"";
}
else
{
echo _QXZ("ERROR").": "._QXZ("You must enter in search terms, one of these must be populated: office number, last name, first name")."\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}

$ALLsort = array();
$ALLfirst = array();
$ALLlast = array();
$ALLoffice_num = array();
$ALLcell_num = array();
$ALLother_num1 = array();
$ALLother_num2 = array();
$ALLbu_name = array();
$ALLdepartment = array();
$ALLgroup_name = array();
$ALLjob_title = array();
$ALLlocation = array();

##### BEGIN search queries and output #####
$stmt="SELECT count(*) from contact_information where $searchSQL;";

### LOG INSERTION Search Log Table ###
$SQL_log = "$stmt|";
$SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$user', source='agent', results='0', search_query=\"$SQL_log\";";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_to_mysqli($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtL,'00432',$user,$server_ip,$session_name,$one_mysql_log);}
$search_log_id = mysqli_insert_id($link);

if ( (preg_match("/contact_information/",$tables_use_alt_log_db)) and (strlen($alt_log_server_ip)>4) and (strlen($alt_log_dbname)>0) )
{
$linkALT=mysqli_connect("$alt_log_server_ip", "$alt_log_login", "$alt_log_pass");
if (!$linkALT) {die(_QXZ("Could not connect: ")."$alt_log_server_ip|$alt_log_login" . mysqli_connect_error());}
mysqli_select_db($linkALT, "$alt_log_dbname");
}
else
{$linkALT = $link;}

$rsltALT=mysql_to_mysqli($stmt, $linkALT);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00433',$user,$server_ip,$session_name,$one_mysql_log);}
$counts_to_print = mysqli_num_rows($rsltALT);
if ($counts_to_print > 0)
{
$row=mysqli_fetch_row($rsltALT);
$search_result_count = $row[0];

$end_process_time = date("U");
$search_seconds = ($end_process_time - $StarTtime);

$stmtL="UPDATE vicidial_lead_search_log set results='$search_result_count',seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_to_mysqli($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtL,'00434',$user,$server_ip,$session_name,$one_mysql_log);}

echo "<CENTER>\n";
echo "<font style=\"font-size:14px;font-family:sans-serif;\"><B>";
echo _QXZ("Results Found:")." $search_result_count";
echo "</B></font>\n";
echo "<BR>\n";
echo "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=$stage>";
echo "<TR>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:10px;font-family:sans-serif;\"><B> &nbsp; # &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("FIRST NAME")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("LAST NAME")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("OFFICE")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("MOBILE")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("OTHER 1")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("OTHER 2")." &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; "._QXZ("BU NAME")." &nbsp; </font></TD>";
echo "</TR>";

if ($search_result_count)
{
$stmt="SELECT first_name,last_name,office_num,cell_num,other_num1,other_num2,bu_name,department,group_name,job_title,location from contact_information where $searchSQL order by first_name,last_name desc limit 1000;";
$rsltALT=mysql_to_mysqli($stmt, $linkALT);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkALT,$mel,$stmt,'00435',$user,$server_ip,$session_name,$one_mysql_log);}
$out_logs_to_print = mysqli_num_rows($rsltALT);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}

$g=0;
$u=0;
while ($out_logs_to_print > $u)
{
$row=mysqli_fetch_row($rsltALT);
$ALLsort[$g] = "$row[0]-----$g";
$ALLfirst[$g] = $row[0];
$ALLlast[$g] = $row[1];
$ALLoffice_num[$g] = $row[2];
$ALLcell_num[$g] = $row[3];
$ALLother_num1[$g] = $row[4];
$ALLother_num2[$g] = $row[5];
$ALLbu_name[$g] = $row[6];
$ALLdepartment[$g] = $row[7];
$ALLgroup_name[$g] = $row[8];
$ALLjob_title[$g] = $row[9];
$ALLlocation[$g] = $row[10];

$g++;
$u++;
}

if ($g < 1)
{echo "<tr bgcolor=white><td colspan=10 align=center>"._QXZ("No results found")."</td></tr>";}

$u=0;
while ($g > $u)
{
$sort_split = explode("-----",$ALLsort[$u]);
$i = $sort_split[1];

if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}

$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u </td>";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\">$ALLfirst[$i] </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\">$ALLlast[$i] </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\"> &nbsp; <a href=\"#\" onclick=\"PresetSelect_submit('$ALLfirst[$i] $ALLlast[$i]','$ALLoffice_num[$i]','','N','Y');return false;\">$ALLoffice_num[$i]</a> </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\"> &nbsp; <a href=\"#\" onclick=\"PresetSelect_submit('$ALLfirst[$i] $ALLlast[$i]','$ALLcell_num[$i]','','N','Y');return false;\">$ALLcell_num[$i]</a> </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\"> &nbsp; <a href=\"#\" onclick=\"PresetSelect_submit('$ALLfirst[$i] $ALLlast[$i]','$ALLother_num1[$i]','','N','Y');return false;\">$ALLother_num1[$i]</a> </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\"> &nbsp; <a href=\"#\" onclick=\"PresetSelect_submit('$ALLfirst[$i] $ALLlast[$i]','$ALLother_num2[$i]','','N','Y');return false;\">$ALLother_num2[$i]</a> </td>\n";
echo "<td align=left> <font size=3 face=\"Arial, Helvetica, sans-serif\">$ALLbu_name[$i] </td>\n";
echo "</tr>\n";
echo "<tr $bgcolor>";
echo "<td colspan=8><font class='sh_text'> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <B>"._QXZ("Dept:")."</B> $ALLdepartment[$i] &nbsp; &nbsp; &nbsp; <B>"._QXZ("Group").":</B> $ALLgroup_name[$i] &nbsp; &nbsp; &nbsp; <B>"._QXZ("Job:")."</B> $ALLjob_title[$i] &nbsp; &nbsp; &nbsp; <B>"._QXZ("Location:")."</B> $ALLlocation[$i]</td>";
echo "</tr>\n";
}

$end_process_time = date("U");
$search_seconds = ($end_process_time - $StarTtime);

$stmtL="UPDATE vicidial_lead_search_log set seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_to_mysqli($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtL,'00436',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{echo "<tr bgcolor=white><td colspan=10 align=center>"._QXZ("No results found")."</td></tr>";}

echo "</TABLE>";
echo "<BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
}
else
{
echo _QXZ("ERROR").": "._QXZ("There was a problem with your search terms")."\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
##### END search queries and output #####
}
else
{
echo _QXZ("ERROR").": "._QXZ("Campaign not found")."\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}




 

Comments

Popular posts from this blog

voice broadcast in vicidial Step by Step Guide

 Follow all below mention steps:- 1.  Open https://ttsmp3.com/   2.  Select Voice Indian English 3.  Type whatever you want to convert into voice.   4.  Read and confirm and then download as a MP3.   5.  Open downloaded file with wavepad and convert into 16bit Mono 8k PCM WAV. or you can use online audio converter from below mention link. site support .wav file only so you need to convert MP3 file to wav using below mention site. https://g711.org/   6.  Upload file to vicidial audio store.   7.  Manual copy file into /var/lib/asterisk/sound/ folder using winscp software. https://winscp.net/download/WinSCP-5.21.6-Portable.zip   8.  Copy campaign from existing Broadcast camp.   9.  Click on created camp and select details view then click on survey     select Survey First Audio File:- as audio file which we created in step 1 and submit.   10. Create list and select campaign as Newly created campaign broadcast, and change routing extensions.   11. Create user with same name of remote agent

Debian 11 Vicidial scratch install dynamic portal

  Step by step guide to scratch install the vidial dynamic portal in Debian 11 or ubuntu based vicidial scratch installations. If you have installed vicidial using scratch installation instead of using the default vicibox iso then you need to manually install and configure the dynamic portal , follow this blog tutorial to scratch install the vicidial dynamic portal . Here's the steps to install and configure the vicidial dynamic portal in scratch installations. Steps to install vicidial dynamic portal cd /usr/src git clone https://github.com/manish23k/vicidial-dynamicportal.git cd vicidial-dynamicportal chmod +x vici_dynportal.sh ./vici_dynportal.sh or you can install manually. Follow the below steps to install and configure the vicidial dynamic portal in your scratch installations, Step 1: Install the firewalld and ipset apt install firewalld apt  install ipset Step 2: Download the Dynamic portal files from my Github cd /usr/src/ mkdir dynamicportal cd dynamicportal wget ht

Vicidial Scratch installation Debian 11 with Asterisk 16, WebRTC and Dynamic Portal

  Vicidial Scratch installation Debian 11  Asterisk 16, WebRTC and Dynamic Portal apt update apt upgrade apt-get install git nano wget cd /usr/src/ git clone https://github.com/manish23k/Vici_Install_Scripts_Deb_11.git cd Vici_Install_Scripts_Deb_11/ chmod +x *.sh Run ./vici_install_deb_ast16.sh Install WebRTC ./vicidial-install-webrtc.sh Once Done with Configuration Secure Server with Vici Dynamic Portal Run ./vici_dynportal.sh