[Asterisk-Users] Little Php question

Alex Barnes abarnes at ubiquitysoftware.com
Thu May 26 03:01:00 MST 2005


> -----Original Message-----
> From: Ronald [mailto:asterisk107 at gmail.com] 
> Sent: 26 May 2005 10:47
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: [Asterisk-Users] Little Php question
> 
> 
> Hi
> I'm trying to make a call from a local webpagee through my 
> xlite softphone 
> (xlite1)
> BTW when I'm trying to do it through telnet it works
> 
> For this I'm using a php script I found
> 
> <PRE>
> <?php
> $socket = fsockopen("192.168.1.1","5038");
> $uname = "test";
> $secret = "test";
> #$exten = 12345678;
> fputs($socket, "Action: Login\r\n");
> fputs($socket, "UserName: $uname\r\n");
> fputs($socket, "Secret: $secret\r\n\r\n");
> # fputs($socket, "\r\n");
> # fputs($socket, "\r\n\r\n");
> fputs($socket, "Action: Originate\r\n");
> fputs($socket, "Channel: SIP/xlite1\r\n");
> fputs($socket, "Context: mainmenu\r\n\");
> fputs($socket, "Exten: 12345678\r\n\);
> fputs($socket, "Priority: 1\r\n");
> fputs($socket, "Callerid: webcall\r\n\r\n");
> fputs($socket, "\r\n\r\n");
> fputs($socket, "Action: Logoff\r\n\r\n");
> while (!feof($socket)) {
> $wrets .= fread($socket, 8192);
> }
> fclose($socket);
> ?>
> </pre>
> 
> When starting the script I get a parse error (unexpected 
> t_string) in line 
> 15 which is the Exten line
> Can anybody help me out. (I have minimal php knowledge, so Im 
> turning to you 
> all)
> 

I don't think # is valid comment character.

Use '//' or '/* BLAH */'

Cheers

alex


Information contained in this e-mail and any attachments are intended for the use of the addressee only, and may contain confidential information of Ubiquity Software Corporation.  All unauthorized use, disclosure or distribution is strictly prohibited.  If you are not the addressee, please notify the sender immediately and destroy all copies of this email.  Unless otherwise expressly agreed in writing signed by an officer of Ubiquity Software Corporation, nothing in this communication shall be deemed to be legally binding.  Thank you.




More information about the asterisk-users mailing list