Skip to main content

Vicidial Enable Contact Phonebook and Transfer on Mobile

Vicidial Enable Contact (Phone book) and Transfer on Mobile

 Step 1

Enable Contact in System Settings 


Step 2 

Changes in Campaign:

 

Add Below mention changed in file in /agc/vdc_db_query.php file modification for %LIKE% search.




############################################################################################################################################################
### SEARCHCONTACTSRESULTSview - display search results for contacts search // Added by Manish date 15-03-2022 LIKE SEARCH RESULTSview
############################################################################################################################################################
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

Install OpenVPN 2.4 and 2.6 on Alma / Rocky Linux

 To install OpenVPN on AlmaLinux 9.5, you can follow these steps: 1. Update the System : Before installing any software, it's a good idea to update your system: sudo dnf update -y 2. Install EPEL Repository : OpenVPN is available in the EPEL (Extra Packages for Enterprise Linux) repository. First, install the EPEL repository: sudo dnf install epel-release -y 3. Install OpenVPN : After enabling the EPEL repository, install OpenVPN: sudo dnf install openvpn -y 4. Install NetworkManager (Optional) : If you are using NetworkManager for managing network connections, you can install the OpenVPN plugin for NetworkManager: sudo dnf install NetworkManager-openvpn -y 5. Configure OpenVPN : Once installed, you need to configure OpenVPN by copying your .ovpn configuration file to the /etc/openvpn/ directory: sudo cp /path/to/your/config.ovpn /etc/openvpn/ 6. Start OpenVPN : You can start OpenVPN by specifying the configuration file directly: sudo openvpn --config /etc...

Vicidial Scratch installation Alma -9/10

Step 1 – Download the dependencies   hostnamectl set-hostname xxxxxx.xxxxx.xxx ### Use YOUR SubDomain vi /etc/hosts ##Change domain name for actual server ip (xxx.xxx.xxx.xxx   complete domain name    subdomain only) timedatectl set-timezone Asia/Kolkata yum check-update yum update -y yum -y install epel-release yum update -y yum install git -y yum install -y kernel* sudo dnf install kernel-devel-$(uname -r) -y # Install english language pack dnf install -y glibc-langpack-en # Configure new locale. This basically just edits /etc/locale.conf localectl set-locale en_US.UTF-8 #Disable SELINUX sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config     reboot Step 2 – Run the Script cd /usr/src/ git clone https://github.com/manish23k/vicidial-install-scripts cd vicidial-install-scripts ####For PHP 7.4 use this script. chmod +x alma-rocky9-ast16.sh ./alma-rocky9-ast16.sh Or the Asterisk 18 version: chmod +x alma-rocky9-ast18.sh ./alma-rock...

How to Format and Mount a New 1TB HDD

🖥 How to Format and Mount a New 1TB HDD to /var/www/recordings on Linux If you’ve added a new HDD to your Linux server and want to use it as a dedicated storage location — for example, to store Asterisk or web server recordings — you’ll need to partition, format, mount, and configure it to auto-mount at boot . In this guide, we’ll walk through the process of wiping the drive (careful — data will be lost!), creating a single ext4 partition , and mounting it permanently. Step 1: Identify Your New Disk Run: lsblk Example output: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8 : 0 0 931.5 G 0 disk ├─sda1 8 : 1 0 50 M 0 part ├─sda2 8 : 2 0 540.8 G 0 part └─sda3 8 : 3 0 390.6 G 0 part In our case, /dev/sda is the new 1TB disk. ⚠ Warning: Double-check you’ve picked the right disk! Formatting the wrong one will destroy data. Step 2: Unmount Any Mounted Partitions sudo umount /dev/sda* 2>/dev/null Step 3: Wipe Old Partitions and Create One ...