From 7389121a0462e42482008430b9aa7ec8648f009b Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 5 Apr 2011 19:11:39 +0000 Subject: [PATCH] Added variables to agi-set_variables script Added third RING_ALL entry on example dialplans git-svn-id: svn://192.168.202.10@1634 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-set_variables.agi | 25 +++++++++++++++++-- docs/conf_examples/extensions.conf.sample | 1 + docs/conf_examples/extensions.conf.sample-1.4 | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/agi/agi-set_variables.agi b/agi/agi-set_variables.agi index 0adc59cc..8344056a 100644 --- a/agi/agi-set_variables.agi +++ b/agi/agi-set_variables.agi @@ -13,11 +13,12 @@ # exten => _91NXXNXXXXXX,n,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor) # exten => _91NXXNXXXXXX,n,Hangup # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # changes: # 101118-1409 - First build # 101125-2115 - Added parsing for 3-way calls +# 110404-1604 - Added dial_timeout and cpd_amd_action variables # $script = 'agi-set_variables.agi'; @@ -175,6 +176,8 @@ if ($AGILOG) {$agi_string = "AGI Variables: |$unique_id|$channel|$extension|$typ $VDADcampaign=''; $VDADphone=''; $VDADphone_code=''; +$auto_dial_timeout='60'; +$cpd_amd_action='DISABLED'; $callerid =~ s/\"//gi; $callerid =~ s/ .*//gi; @@ -209,6 +212,23 @@ if ($sthArows > 0) $sthA->finish(); } +$stmtA = "SELECT dial_timeout,cpd_amd_action FROM vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +if ($AGILOG) {$agi_string = "$sthArows|$stmtA|"; &agi_output;} +if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $auto_dial_timeout = $aryA[0]; + # only set if auto-dial call + if ($callerid =~ /^V/) + { + $cpd_amd_action = $aryA[1]; + } + $sthA->finish(); + } + $stmtA = "SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$VD_lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -317,7 +337,8 @@ $AGI->exec("EXEC Set(_rank=$rank)"); $AGI->exec("EXEC Set(_owner=$owner)"); $AGI->exec("EXEC Set(_campaign_id=$campaign_id)"); $AGI->exec("EXEC Set(_dialed_number=$dialed_number)"); - +$AGI->exec("EXEC Set(_auto_dial_timeout=$auto_dial_timeout)"); +$AGI->exec("EXEC Set(_cpd_amd_action=$cpd_amd_action)"); $dbhA->disconnect(); diff --git a/docs/conf_examples/extensions.conf.sample b/docs/conf_examples/extensions.conf.sample index c2fc82e1..b947ed91 100644 --- a/docs/conf_examples/extensions.conf.sample +++ b/docs/conf_examples/extensions.conf.sample @@ -382,6 +382,7 @@ exten => _8320*.,2,Hangup exten => _8331*.,1,Playback(sip-silence) exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) +exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) exten => _8331*.,n,Hangup diff --git a/docs/conf_examples/extensions.conf.sample-1.4 b/docs/conf_examples/extensions.conf.sample-1.4 index 47ce4213..aafe4489 100644 --- a/docs/conf_examples/extensions.conf.sample-1.4 +++ b/docs/conf_examples/extensions.conf.sample-1.4 @@ -386,6 +386,7 @@ exten => _8320*.,2,Hangup exten => _8331*.,1,Playback(sip-silence) exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) +exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) exten => _8331*.,n,Hangup