//New Functionality Added in Vicidial Dialer
1) Campaign Caller ID Change [03-03-2023]
a) Admin will have a select field for every users to enable caller id change for agent, in user modification page with name 'eti_cli_change_enable_flag';
field :
MYSQL Query for adding this column:
########################################################## MYSQL Query ###############################################################################
ALTER TABLE vicidial_users ADD COLUMN (eti_cli_change_enable_flag enum('Y','N') NOT NULL DEFAULT 'N');
########################################################################################################################################################
Add below written code, at the end of the user modification page "$ADD==3", just before submit button
########################################################################################################################################################
Additional Functionality Providing to Agent
########################################################################################################################################################
b) Change in mysql query according to new field added. (Table : vicidial_users) {$ADD = [3,4, '4A', '4B']}
c) Agent : add related field in mysql according to requirements.(Table : vicidial_users)
d) Add the below code to html in index.php for agent, just before 'dialControl' button [Reference : 'You are paused']
########################################################################################################################################################
Change Campaign CLI
########################################################################################################################################################
e) i)Add a function 'eti_cli_change_function' for the select field declared above
########################################################### Javascript Function ########################################################################
function eti_cli_change_function(element)
{
var eti_agent_selected_caller_id = '';
var eti_agent_new_caller_id = $(element).val();
var confirm_box_text = "You are trying to change Caller ID to ";
if(eti_agent_new_caller_id != '')
{
confirm_box_text += " '"+eti_agent_new_caller_id+"' ";
}
else
{
confirm_box_text += "Default Caller ID set by campaign.";
}
if(confirm(confirm_box_text) === true)
{
$(element).val(eti_agent_new_caller_id);
$.ajax({
url : 'eti_agent_custom_api.php',
data : {user : user, caller_id : eti_agent_new_caller_id},
method : "POST",
success:function(response)
{
console.log(response);
}
});
}
else
{
$(element).val(eti_agent_selected_caller_id);
}
}
########################################################################################################################################################
ii) Add an entry in function start_all_refresh() :-
########################################################################################################################################################
$("#eti_cli_change_block").hide();
########################################################################################################################################################
f) Add the following code in agent/index.php, at the end of the block [if($auth>0)]
########################################################################################################################################################
$stmt = "SELECT caller_id FROM eti_agent_caller_id WHERE user = '".$VD_login."' ";
$rslt = mysql_to_mysqli($stmt, $link);
if($rslt)
{
if(mysqli_num_rows($rslt) > 0)
{
$row = mysqli_fetch_row($rslt);
$eti_agent_selected_caller_id = $row[0];
}
else
{
$eti_agent_selected_caller_id = '';
}
}
$stmt = "SELECT d.did_id,d.did_pattern,c.id FROM eti_agent_caller_id_group g INNER JOIN vicidial_inbound_dids d ON d.did_id = g.did_id LEFT JOIN eti_agent_caller_id c ON c.caller_id = d.did_pattern WHERE g.campaign_id = '".$VD_campaign."' ";
$rslt = mysql_to_mysqli($stmt, $link);
if(mysqli_num_rows($rslt) > 0)
{
$eti_callerID = array();
while($row = mysqli_fetch_assoc($rslt))
{
$eti_callerID[] = $row;
}
}
else
{
$eti_callerID = array();
}
########################################################################################################################################################
g) MYSQL Queries For creating the above declared tables
CREATE TABLE `eti_agent_caller_id` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`user` varchar(45) NOT NULL,
`caller_id` varchar(40) NOT NULL,
`create_time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `eti_agent_caller_id_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`campaign_id` int(11) NOT NULL,
`did_id` int(11) NOT NULL,
`active_did` tinyint(1) NOT NULL DEFAULT '0',
`time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `eti_agent_caller_id_history` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`user` varchar(45) NOT NULL,
`log` text NOT NULL,
`create_time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
h) MYSQL Query for add help info for the field created in admin/index.php file
Query : INSERT INTO help_documentation (help_id, help_title, help_text) VALUES('users-eti_cli_change_enable_flag','CLI Change','This field enable or disable CLI change option for agent, on agent screen. Default is NO.');
*! Note :
1) copy files from './required_files_for_cli_change' Location and paste them at '/var/lib/asterisk/agi-bin' with -777 Permission
2) Add the following code in carrier in admin. [$ADD == 140000000000]
################################################################ Carrier ####################################################################################
exten => _6632X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _6632X.,n,AGI(eti_callerid.sh,"${CHANNEL}","${CALLERID(ani)}")
exten => _6632X.,n,Verbose(result is: ${result})
exten => _6632X.,n,Set(CALLERID(ani)=${result})
exten => _6632X.,n,Set(CALLERID(num)=${result})
exten => _6632X.,n,Dial(${DYNAMICM-3266}/${EXTEN:4},,tTo)
exten => _6632X.,n,Hangup()
############################################################### Change it according to your requirements ##########################################################