Changed CIDname for 3way calls
git-svn-id: svn://192.168.202.10@1556 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#
|
||||
# changes:
|
||||
# 101118-1409 - First build
|
||||
# 101125-2115 - Added parsing for 3-way calls
|
||||
#
|
||||
|
||||
$script = 'agi-set_variables.agi';
|
||||
@@ -151,7 +152,7 @@ if ( (length($callerid)>20) && ($callerid =~ /\"\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S
|
||||
}
|
||||
if ( (
|
||||
(length($calleridname)>5) && ( (!$callerid) or ($callerid =~ /unknown|private|00000000/i) or ($callerid =~ /5551212/) )
|
||||
) or ( (length($calleridname)>17) && ($calleridname =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) ) )
|
||||
) or ( (length($calleridname)>17) && ($calleridname =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) ) or ( (length($calleridname)>17) && ($calleridname =~ /\d\d\d\d\d\dW\d\d\d\d\d\d\d\d\d\dW$/) ) )
|
||||
{
|
||||
$callerid = $calleridname;
|
||||
# ### set the callerid to the ACQS value(calleridname)
|
||||
@@ -178,7 +179,15 @@ $VDADphone_code='';
|
||||
$callerid =~ s/\"//gi;
|
||||
$callerid =~ s/ .*//gi;
|
||||
$CIDlead_id = $callerid;
|
||||
$CIDlead_id = substr($CIDlead_id, 10, 10);
|
||||
if ($CIDlead_id =~ /W\d\d\d\d\d\d\d\d\d\dW$/)
|
||||
{
|
||||
@CIDlead_id_array = split(/W/, $CIDlead_id);
|
||||
$CIDlead_id = $CIDlead_id_array[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$CIDlead_id = substr($CIDlead_id, 10, 10);
|
||||
}
|
||||
$CIDlead_id = ($CIDlead_id + 0);
|
||||
if ( ($CLIlead_id > 0) && ($CIDlead_id < 1) ) {$CIDlead_id = $CLIlead_id;}
|
||||
$VD_lead_id = $CIDlead_id;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# 100811-2119 - First build, based upon AST_conf_update.pl script
|
||||
# 100928-1506 - Changed from hard-coded 60 minute limit to servers.vicidial_recording_limit
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -137,7 +138,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
### Grab Server values from the database
|
||||
$stmtA = "SELECT telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,max_vicidial_trunks,answer_transfer_agent,local_gmt,ext_context FROM servers where server_ip = '$server_ip';";
|
||||
$stmtA = "SELECT telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,max_vicidial_trunks,answer_transfer_agent,local_gmt,ext_context,vicidial_recording_limit FROM servers where server_ip = '$server_ip';";
|
||||
if ($DB) {print "|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -157,6 +158,7 @@ if ($sthArows > 0)
|
||||
$DBanswer_transfer_agent= $aryA[8];
|
||||
$DBSERVER_GMT = $aryA[9];
|
||||
$DBext_context = $aryA[10];
|
||||
$vicidial_recording_limit = $aryA[11];
|
||||
if ($DBtelnet_host) {$telnet_host = $DBtelnet_host;}
|
||||
if ($DBtelnet_port) {$telnet_port = $DBtelnet_port;}
|
||||
if ($DBASTmgrUSERNAME) {$ASTmgrUSERNAME = $DBASTmgrUSERNAME;}
|
||||
@@ -168,6 +170,7 @@ if ($sthArows > 0)
|
||||
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
|
||||
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
|
||||
if ($DBext_context) {$ext_context = $DBext_context;}
|
||||
if ($vicidial_recording_limit < 60) {$vicidial_recording_limit=60;}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
@@ -195,7 +198,7 @@ while ($loops > $loop_counter)
|
||||
|
||||
##### Find date-time one hour in the past
|
||||
$secX = time();
|
||||
$TDtarget = ($secX - 3600);
|
||||
$TDtarget = ($secX - ($vicidial_recording_limit * 60));
|
||||
($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget);
|
||||
$Tyear = ($Tyear + 1900);
|
||||
$Tmon++;
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
# - $nodeletevdac - ('0','1')
|
||||
# - $alertCID - ('0','1')
|
||||
# - $preset_name = ('TESTING PRESET',...)
|
||||
# - $call_variables = ('Variable: vendor_lead_code=1234|campaign=TESTCAMP|...')
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 50401-1002 - First build of script, Hangup function only
|
||||
@@ -103,10 +104,10 @@
|
||||
# 101004-1345 - Added Ivr park functions
|
||||
# 101024-1638 - Added park_log logging for parked calls
|
||||
# 101107-2331 - Added CALLERONHOLD/CALLEROFFHOLD queue_log entries
|
||||
#
|
||||
# 101125-1018 - Added call_variables Originate variables
|
||||
|
||||
$version = '2.4-53';
|
||||
$build = '101107-2331';
|
||||
$version = '2.4-54';
|
||||
$build = '101125-1018';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=115;
|
||||
$one_mysql_log=0;
|
||||
@@ -198,6 +199,8 @@ if (isset($_GET["alertCID"])) {$alertCID=$_GET["alertCID"];}
|
||||
elseif (isset($_POST["alertCID"])) {$alertCID=$_POST["alertCID"];}
|
||||
if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];}
|
||||
elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];}
|
||||
if (isset($_GET["call_variables"])) {$call_variables=$_GET["call_variables"];}
|
||||
elseif (isset($_POST["call_variables"])) {$call_variables=$_POST["call_variables"];}
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -438,10 +441,12 @@ if ($ACTION=="Originate")
|
||||
{
|
||||
$RAWaccount = $account;
|
||||
$account = "Account: $account";
|
||||
$variable = "Variable: usegroupalias=1";
|
||||
$variable = "Variable: _usegroupalias=1";
|
||||
if (strlen($call_variables)>9)
|
||||
{$variable = "Variable: _usegroupalias=1";} # |$call_variables
|
||||
}
|
||||
else
|
||||
{$account=''; $variable='';}
|
||||
{$variable=''; $account="Variable: $call_variables";}
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
+55
-8
@@ -322,10 +322,11 @@
|
||||
# 101024-1639 - Added parked call counter
|
||||
# 101108-0110 - Added ADDMEMBER option for queue_log
|
||||
# 101124-0436 - Added manual dial queue and manual dial call time check features
|
||||
# 101125-2151 - Changed CIDname for 3way calls
|
||||
#
|
||||
|
||||
$version = '2.4-299';
|
||||
$build = '101124-0436';
|
||||
$version = '2.4-300';
|
||||
$build = '101125-2151';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=69;
|
||||
$one_mysql_log=0;
|
||||
@@ -3158,6 +3159,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var WaitingForNextStep=0;
|
||||
var AllowManualQueueCalls='<?php echo $AllowManualQueueCalls ?>';
|
||||
var AllowManualQueueCallsChoice='<?php echo $AllowManualQueueCallsChoice ?>';
|
||||
var call_variables='';
|
||||
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\" Pause \"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
@@ -3483,19 +3485,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
else
|
||||
{agent_dialed_type='XFER_OVERRIDE';}
|
||||
// due to a bug in Asterisk, these call variables do not actually work
|
||||
call_variables = '__vendor_lead_code=' + document.vicidial_form.vendor_lead_code.value + ',__lead_id=' + document.vicidial_form.lead_id.value;
|
||||
}
|
||||
var sending_preset_name = document.vicidial_form.xfername.value;
|
||||
if (taskFromConf == 'YES')
|
||||
{basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias,'',sending_preset_name);}
|
||||
{basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias,'',sending_preset_name,call_variables);}
|
||||
else
|
||||
{basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias,sending_preset_name);}
|
||||
{basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias,sending_preset_name,call_variables);}
|
||||
|
||||
MD_ring_secondS=0;
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
// Send Originate command to manager to place a phone call
|
||||
function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias,taskalert,taskpresetname)
|
||||
function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias,taskalert,taskpresetname,taskvariables)
|
||||
{
|
||||
if (taskalert == '1')
|
||||
{
|
||||
@@ -3602,10 +3606,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
var originatevalue = protodial + "/" + extendial;
|
||||
}
|
||||
|
||||
var leadCID = document.vicidial_form.lead_id.value;
|
||||
var epochCID = epoch_sec;
|
||||
if (leadCID.length < 1)
|
||||
{leadCID = user_abb;}
|
||||
leadCID = set_length(leadCID,'10','left');
|
||||
epochCID = set_length(epochCID,'6','right');
|
||||
if (taskconfxfer == 'YES')
|
||||
{var queryCID = "DCagcW" + epoch_sec + user_abb;}
|
||||
{var queryCID = "DC" + epochCID + 'W' + leadCID + 'W';}
|
||||
else
|
||||
{var queryCID = "DVagcW" + epoch_sec + user_abb;}
|
||||
{var queryCID = "DV" + epochCID + 'W' + leadCID + 'W';}
|
||||
|
||||
// if (taskconfxfer == 'YES')
|
||||
// {var queryCID = "DCagcW" + epoch_sec + user_abb;}
|
||||
// else
|
||||
// {var queryCID = "DVagcW" + epoch_sec + user_abb;}
|
||||
|
||||
if (taskalert == '1')
|
||||
{
|
||||
@@ -3625,7 +3641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{var call_cid = campaign_cid;}
|
||||
}
|
||||
|
||||
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery;
|
||||
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery + "&call_variables=" + taskvariables;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(VMCoriginate_query);
|
||||
@@ -3660,9 +3676,40 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
agent_dialed_number='';
|
||||
agent_dialed_type='';
|
||||
CalL_ScripT_id='';
|
||||
call_variables='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// zero-pad numbers or chop them to get to the desired length
|
||||
function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
{
|
||||
var SLnumber = SLnumber + '';
|
||||
var begin_point=0;
|
||||
var number_length = SLnumber.length;
|
||||
if (number_length > SLlength_goal)
|
||||
{
|
||||
if (SLdirection == 'right')
|
||||
{
|
||||
begin_point = (number_length - SLlength_goal);
|
||||
SLnumber = SLnumber.substr(begin_point,SLlength_goal);
|
||||
}
|
||||
else
|
||||
{
|
||||
SLnumber = SLnumber.substr(0,SLlength_goal);
|
||||
}
|
||||
}
|
||||
// alert(SLnumber + '|' + SLlength_goal + '|' + begin_point + '|' + SLdirection + '|' + SLnumber.length + '|' + number_length);
|
||||
var result = SLnumber + '';
|
||||
while(result.length < SLlength_goal)
|
||||
{
|
||||
result = "0" + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// ################################################################################
|
||||
// filter conf_dtmf send string and pass on to originate call
|
||||
function SendConfDTMF(taskconfdtmf)
|
||||
|
||||
Reference in New Issue
Block a user