Added INBOUND_DID In-Group populate option
git-svn-id: svn://192.168.202.10@3807 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -258,6 +258,7 @@
|
||||
# 230810-2006 - Added third_alert_trigger features
|
||||
# 231026-0917 - Fix for rare fronter/closer logging issue
|
||||
# 240219-1527 - Added daily_limit in-group user parameter
|
||||
# 240223-0847 - Added INBOUND_DID populate option
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -277,6 +278,7 @@ $entry_list_id=0;
|
||||
$areacode_filter_run=0;
|
||||
$no_agent_no_queue_checked=0;
|
||||
$fronter_agent='';
|
||||
$inbound_did='';
|
||||
|
||||
|
||||
$now_date_epoch = time();
|
||||
@@ -1109,18 +1111,37 @@ if ($sthArows > 0)
|
||||
$sthA->finish();
|
||||
|
||||
# If answer signal config is enabled and the in-group is set to send one, send an Answer signal
|
||||
if ( ($inbound_answer_config > 0) and ($answer_signal !~ /NONE|ROUTE/i) )
|
||||
if ( ($inbound_answer_config > 0) && ($answer_signal !~ /NONE|ROUTE/i) )
|
||||
{
|
||||
$AGI->answer();
|
||||
if ($AGILOG) {$agi_string = " Answering call: - $channel|$answer_signal"; &agi_output;}
|
||||
}
|
||||
|
||||
# If the INBOUND_DID option is used in one of the populate settings, look it up by the uniqueid here
|
||||
if ( ($populate_lead_source =~ /INBOUND_DID/) || ($populate_lead_vendor =~ /INBOUND_DID/) )
|
||||
{
|
||||
$stmtA = "SELECT extension FROM vicidial_did_log where uniqueid='$uniqueid' and call_date > \"$timeTWENTYFOURhoursAGO\" order by call_date desc limit 1;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$inbound_did = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = " Populate INBOUND_DID set: - $inbound_did|$stmtA"; &agi_output;}
|
||||
}
|
||||
|
||||
# When VID or VIDPROMPT, methods are not used, no Vendor Lead Code can be supplied. Fill it with inbound_number
|
||||
$igvendorid = $AGI->get_variable('igvendorid');
|
||||
if ( ($call_handle_method !~ /^VID/) && (length($igvendorid) < 1) )
|
||||
{
|
||||
if ($populate_lead_vendor =~ /INBOUND_NUMBER/)
|
||||
{$vendor_id = $inbound_number;}
|
||||
if ($populate_lead_vendor =~ /INBOUND_DID/)
|
||||
{$vendor_id = $inbound_did;}
|
||||
if (length($populate_lead_vendor) < 1)
|
||||
{$vendor_id = '';}
|
||||
if ( (length($populate_lead_vendor) > 0) && (length($vendor_id) < 1) )
|
||||
@@ -1312,6 +1333,8 @@ else
|
||||
{
|
||||
if ($populate_lead_source =~ /INBOUND_NUMBER/)
|
||||
{$source_id = $inbound_number;}
|
||||
if ($populate_lead_source =~ /INBOUND_DID/)
|
||||
{$source_id = $inbound_did;}
|
||||
if ( (length($populate_lead_source) < 1) || ($populate_lead_source =~ /BLANK/) )
|
||||
{$source_id = '';}
|
||||
if ($populate_lead_source =~ /DISABLED/)
|
||||
|
||||
Reference in New Issue
Block a user