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
james at dades.ca wrote:> 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 >Checkout the "h" hangup extension: http://www.voip-info.org/wiki/index.php?page=Asterisk+h+extension -- Warm Regards, Lee
In my first message I included the example script:> ***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); > ?>I have found why it didn't work. I needed to call $agi->set_variable() not $agi->SetVar. This does what I wanted and expected. James