[asterisk-users] combining AGI with dialplans

james at dades.ca james at dades.ca
Fri Jun 15 13:22:54 CDT 2007


On 2007-05-15 Tony Mountifield wrote (wrt using AGI scripts to dial out):

> Can't comment on this one, as I never use AGI to dial.
> My AGIs just set the context, extension and priority,
> and exit to the dialplan to do any dialling.

(http://article.gmane.org/gmane.comp.telephony.pbx.asterisk.user/185537)


I would like to do this, but I am having trouble figuring out how. I have
tried the following but it is not working for me:


***test.php***
#!/usr/bin/php -q
<?php
    require_once('phpagi.php');
    $agi = new AGI();

    $dialstr="IAX2/wayne/112 at testcntxt";
    $agi->SetVar("JAMES",$dialstr);
    exit(0);
?>

***extensions.conf***
[from-sip]
exten => 111,1,DeadAGI(test.php)
exten => 111,2,Dial(${JAMES})
exten => 111,3,Hangup



Thanks in advance for any help.
James








More information about the asterisk-users mailing list