[Asterisk-Users] AGI ?

Freddi Hansen fh at danovation.dk
Wed May 24 14:50:45 MST 2006


>  On Wed, 2006-05-24 at 11:45 -0500, Eric "ManxPower" Wieling wrote:
>> >>
>> >> my $dialstat = $AGI->get_variable('DIALSTATUS');
>> >>
>> > 
>> > Hi,
>> > 
>> >    I have tried that as well.
>> > Thanks for the suggestion.
>> > 
>> > Any other thoughts.
>>
>> 1) What version of Asterisk are you using?
>>
>>     
> I am running from debian package version 1.2.7.1.dfsg-2
>> 2) Can you get any other dialplan variables?
>>
>>     
> I have tried getting other variables and no I do not get any results.
>> 3) Are you running the Dial app inside your AGI or before you run your AGI?
>>
>>     
> here is what my dialplan looks like within extensions.conf
> exten => _5NXXXXXX,1,AGI,LCRdialout.agi.test|${EXTEN}
> exten => _51NXXNXXXXXX,1,AGI,LCRdialout.agi.test|${EXTEN}
>
> Here are the two lines that I run from within the AGI script
> $AGI->exec("DIAL Zap/g2/$number|25|TW");
> $callStatus = $AGI->get_variable('DIALSTATUS');
>
> $AGI->exec("DIAL 
> IAX2/$iaxUser\:$iaxPass\@$iaxHost/$one$areaCode$number|25|TW");
> $callStatus = $AGI->get_variable('DIALSTATUS');
>
Hi
Here is an example that works fine for me:
                my 
$stat=$AGI->exec('Dial',"SIP/$ses{DST_ContactUsername}/$ses{Dialnumber}|$TimeOut");
                my $dstat=$AGI->get_variable('DIALSTATUS');

Here is the way I normally debug AGI's.:
1. try agi from commandline so you know you dont get syntax errors.
2. start your asterisk from command line (not safe_asterisk + asterisk 
-r)   This  is to get stdout from your agi program.
3. issue 'agi debug' to trace whats going on.   AGI  is a bit sensitive 
to you  sending wrong number of args, it can get out-of-sync so an error 
you make in one line may show up in the next command but it's pretty 
easy to spot with  'agi debug on'.
It might be just that you are giving 1 arg when you exec dial while I use 2.
Freddi

>
> Thanks,
> */Jon Scottorn/*



More information about the asterisk-users mailing list