From 722acb3c79422275119071be69dbf6307bd0fc2b Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 20 Sep 2006 03:23:16 +0000 Subject: [PATCH] fixed selected CID agi script to work with Asterisk 1.0 and 1.2 trees git-svn-id: svn://192.168.202.10@290 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDADselective_CID.agi | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/agi/agi-VDADselective_CID.agi b/agi/agi-VDADselective_CID.agi index 27494e6e..6c0b8142 100644 --- a/agi/agi-VDADselective_CID.agi +++ b/agi/agi-VDADselective_CID.agi @@ -21,6 +21,7 @@ $script = 'agi-VDADselective_CID.agi'; $AGILOG=0; +$FD=0; # force debug for testing # CLEAR AREA CODE LISTINGS: # Florida: 239|305|321|352|386|407|561|689|727|754|772|786|813|836|850|861|863|904|941|954 @@ -115,11 +116,22 @@ if ($areacode !~ /$clear_area_codes/) } ### set the callerid to the ACQS value(calleridname) - print "SET CALLERID \"$calleridname\" <0000000000>\n"; + ## use these two lines for Asterisk 1.2 tree + $newcallerid = "\"$calleridname <0000000000>\""; + $AGI->set_callerid($newcallerid); + ## use these two lines for Asterisk 1.0 tree +# print "SET CALLERID \"$calleridname\" <0000000000>\n"; +# print "SET CALLERIDNAME \"$calleridname\"\n"; checkresult($result); - if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" <0000000000>"; &agi_output;} -} + if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<0000000000\>"; &agi_output;} + if ($FD > 0) {print STDERR "callerID changed: \"$calleridname\" \<0000000000\>\n";} +} +else +{ + if ($FD > 0) {print STDERR "callerID NOT changed: \"$calleridname\" <$callerid>\n";} + +} if ($AGILOG) {$agi_string = "AGI Variables: |$extension|$areacode|$callerid|$calleridname|"; &agi_output;} exit; @@ -127,7 +139,6 @@ exit; - sub checkresult { my ($res) = @_; my $retval;