Hi there. I’m trying to build an app to let users see if thier LDAP account is locked out via telephone. I’m using Perl and the script runs great. When I run it outside of Asterisk it just says “Say Digits 123” when it gets to the AGI SayDigits line. BUt the AGI never returns anything to Asterisk. I’m fairly new to asterisk, so I might be making a sophmore error here, but I’m stumped… Thanks much…
AGI Debug Log: (Notice there are no AGI RX >> lines
-- Executing Goto("IAX2/2162-7", "custom-help|s|1") in new stack
-- Goto (custom-helpdesk,s,1)
-- Executing SayDigits("IAX2/2162-7", "1") in new stack
-- Playing 'digits/1' (language 'en')
-- Executing AGI("IAX2/2162-7", "adsearch.pl") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/adsearch.pl
AGI Tx >> agi_request: adsearch.pl
AGI Tx >> agi_channel: IAX2/2162-7
AGI Tx >> agi_language: en
AGI Tx >> agi_type: IAX2
AGI Tx >> agi_uniqueid: 1153403795.7
AGI Tx >> agi_callerid: 2162
AGI Tx >> agi_calleridname: Dave Kolberg
AGI Tx >> agi_callingpres: 1
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 7777
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: custom-helpdesk
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
-- AGI Script adsearch.pl completed, returning 0
-- Executing SayDigits("IAX2/2162-7", "2") in new stack
-- Playing 'digits/2' (language 'en')
-- Hungup 'IAX2/2162-7'
The PL script
[code][root@asterisk1 agi-bin]# cat adsearch.pl
#!/usr/bin/perl
use strict;
use Net::LDAP;
use Asterisk::AGI;
my $ad = Net::LDAP->new(“ldap://myDC”)
or die “Could not connect”;
$AGI = new Asterisk::AGI;
$ad->bind("users@mydomain.com", password=>“secret”);
my $searchbase = “OU=All_Users,DC=mydomain,DC=com”;
my $filter = “memberof=CN=WIN,OU=All_Groups,DC=mydomain,DC=com”;
my $attrs = “sn”;
print “Searching…”;
my $results =$ad->search(base=>$searchbase,filter=>$filter,attrs=>$attrs);
my $count = $results->count;
$AGI->verbose(“Trying to say $count/n”,1);
$AGI->exec(‘Say Number’,$count);
$ad->unbind;
[/code]
The custom call:
[custom-help]
exten => s,1,SayDigits(1)
exten => s,2,agi(adsearch.pl)
exten => s,3,SayDigits(2)
[/quote]