Re: [asterisk-users] phpagi problem

2006-07-18 Thread Mauricio Mantilla
Yeah, I wrote it on a different file and it worked, i guess there was some hidden character in the script that was messing it up.Thank you anyway,Mauricio MantillaOn 7/17/06, 
Time Bandit [EMAIL PROTECTED] wrote:
 #!/usr/bin/php -q?php require('/var/lib/asterisk/agi-bin/phpagi.php'); $agi = new AGI(); $agi-say_digits(62410); $cid = $agi-get_variable(dir); $agi-say_digits($cid);
? I'm getting this error: parse error, unexpected '=' on line 6I don't know why you're getting this error, it parse correctly here.But one thing is that the line $agi-say_digits($cid); won't work.
When you do a get_variable, the result you get is an array, and themember holding the value is 'data'. So you have to write your linelike this : $agi-say_digits($cid['data']);Check the documentation : 
http://phpagi.sourceforge.net/phpagi2/docs/hth___--Bandwidth and Colocation provided by 
Easynews.com --asterisk-users mailing listTo UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users

___
--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] phpagi problem

2006-07-18 Thread VoIP Street

Mauricio Mantilla wrote:
Yeah, I wrote it on a different file and it worked, i guess there was 
some hidden character in the script that was messing it up.

Thank you anyway,

Mauricio Mantilla

On 7/17/06, *Time Bandit* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


  #!/usr/bin/php -q
   ?php
  require('/var/lib/asterisk/agi-bin/phpagi.php');
  $agi = new AGI();
  $agi-say_digits(62410);
  $cid = $agi-get_variable(dir);
  $agi-say_digits($cid);
   ?
 
 
  I'm getting this error:
 
  parse error, unexpected '=' on line 6

I don't know why you're getting this error, it parse correctly here.

But one thing is that the line $agi-say_digits($cid); won't work.
When you do a get_variable, the result you get is an array, and the
member holding the value is 'data'. So you have to write your line
like this : $agi-say_digits($cid['data']);

Check the documentation : http://phpagi.sourceforge.net/phpagi2/docs/

hth
___
--Bandwidth and Colocation provided by Easynews.com
http://Easynews.com --

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





___
--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


dos2unix usually fixes these sorts of issues.

Just do something like this at the command line:

dos2unix filename filename

It removes a lot of the garbage that causes trouble with command line 
PHP scripts and AGIs etc.



--
VoIP Street
Origination/Termination with SUPERIOR customer service!
http://www.VoIPstreet.com
___
--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


[asterisk-users] phpagi problem

2006-07-17 Thread Mauricio Mantilla
Hi all,I'm trying to write a script using phpagi, but there's something that's not working and I can't figure out why.Here's my code:#!/usr/bin/php
 -q
?phprequire('/var/lib/asterisk/agi-bin/phpagi.php');
$agi = new AGI();
$agi-say_digits(62410);
$cid = $agi-get_variable(dir);$agi-say_digits($cid);
?
I'm getting this error:parse error, unexpected '=' on line 6can you tell me what am I doing wrong?thanksMauricio Mantilla
___
--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] phpagi problem

2006-07-17 Thread Time Bandit

#!/usr/bin/php -q
 ?php
require('/var/lib/asterisk/agi-bin/phpagi.php');
$agi = new AGI();
$agi-say_digits(62410);
$cid = $agi-get_variable(dir);
$agi-say_digits($cid);
 ?


I'm getting this error:

parse error, unexpected '=' on line 6


I don't know why you're getting this error, it parse correctly here.

But one thing is that the line $agi-say_digits($cid); won't work.
When you do a get_variable, the result you get is an array, and the
member holding the value is 'data'. So you have to write your line
like this : $agi-say_digits($cid['data']);

Check the documentation : http://phpagi.sourceforge.net/phpagi2/docs/

hth
___
--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