[Asterisk-Users] phpagi DIAL command not working

Tony Buser gr0k at juju.org
Wed Feb 18 16:45:46 MST 2004


Welp I had no luck trying to get this to work.  However, I came up with 
a workaround that isn't as clean, but at least it works.  :)  Here's 
what I did:

In my agi script:

      $agi->agi_exec("SET VARIABLE PHONENUM $strPhone");
      $agi->agi_exec("SET PRIORITY 20");

Then in extensions.conf:

exten => 70557,1,AGI(fileno.php)
exten => 70557,20,Dial(Zap/5/${PHONENUM})
exten => 70557,21,Hangup

Someone told me about the paragraph on the wiki 
http://www.voip-info.org/wiki-Asterisk+AGI that says:

"If the application dials outward, the script returns execution to the 
dialplan and looses contact with the asterisk server. The script 
continues to run in the background by itself and is free to clean up and 
do post-dial processing."

That sounds to me like just execing a DIAL command from within the agi 
_should_ work and yet it doesn't.  Anyone have any insight?

Tony Buser wrote:

> I'm using phpagi to try and call out through our x100p line with the 
> following code for instance:
>
> $strPhone = "6105555555";
> $agi->agi_exec("DIAL Zap/5/$strPhone");
>
> On the console I see:
>
> fileno.php: >> DIAL Zap/5/6105555555
>
> However it doesn't dial.  It just continues on to the next line of the 
> script and eventually times out and hangs up.  If I put the following 
> in extensions and call it, it dials out correctly:
>
> exten => 70558,1,Dial(Zap/5/6105555555)
>
> Everything else in my code works. (ANSWER, HANGUP, agi_getdtmf, 
> text2wave, etc)  I'm running the latest cvs as of yesterday.  What am 
> I doing wrong?





More information about the asterisk-users mailing list