[asterisk-users] combining AGI with dialplans

2007-06-15 Thread james
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/[EMAIL PROTECTED];
$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






___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] combining AGI with dialplans

2007-06-15 Thread Lee Jenkins
[EMAIL PROTECTED] 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/[EMAIL PROTECTED];
 $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




___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] combining AGI with dialplans

2007-06-15 Thread james
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/[EMAIL PROTECTED];
 $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

___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users