[Asterisk-Dev] Asterisk Call Manger Won't Let Me In
Gary Ruddock
garyruddock at hotmail.com
Fri May 21 07:37:25 MST 2004
I managed to work out that it was the $timeout in the php.
I still can't connect via telnet it just hangs.
I am defo connected so thats good!!
I am now trying to work out how to originate a call. I suppose I should
start a new subject?
<?php
$timeout = 7500;
$socket = fsockopen("10.0.0.4","5038", $errno, $errstr, $timeout);
if (!$socket)
{
echo 'Socket fail<br>';
echo $errorno . '<br>';
echo $errstr . '<br>';
echo $timeout . '<br>';
}
else
{
//fgets($socket);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: cron\r\n");
fputs($socket, "Secret: xxxxxx\r\n\r\n");
fputs($socket, "Action: Originate\r\n");
fputs($socket, "Channel: SIP/6001\r\n\r\n");
fputs($socket, "Context: Default\r\n");
fputs($socket, "Exten: 2500\r\n");
fputs($socket, "Priority: 1\r\n");
fputs($socket, "Callerid: 01517077777\r\n");
//fputs($socket, "Action: Logoff\r\n");
$wrets=fgets($socket);
echo $wrets .'<br>';
$wrets=fgets($socket);
echo $wrets .'<br>';
$wrets=fgets($socket);
echo $wrets .'<br>';
?>
>I'm not sure about whats going on with your php script, but telnet looks
>fine. When you log in it sends you the version, then its up to you to
>send the login request. Just remember to hit enter a second time after
>the last line of the request.
>
>
>Action: Login[Enter]
>Username: cron[Enter]
>Secret: xxxxxx[Enter]
>[Enter]
>
>
>
>On Fri, 2004-05-21 at 08:28, Gary Ruddock wrote:
> > I edited manager.conf
> >
> > ;
> > ; Asterisk Call Management support
> > ;
> > [general]
> > enabled = yes
> > port = 5038
> > bindaddr = 10.0.0.4
> >
> > [manager]
> > secret = xxxxxxxx
> > read = system,call,log,verbose,command,agent,user
> > write = system,call,log,verbose,command,agent,user
> >
> > [cron]
> > secret = xxxxxxxxx
> > read = system,call,log,verbose,command,agent,user
> > write = system,call,log,verbose,command,agent,user
> >
> >
> > I tried to connect via telnet
> >
> > telnet 10.0.0.4 5038
> >
> > I got nothing till I set enabled = yes in manager.conf
> >
> > now when I telnet I get a response from asterisk call manager but then
>hangs
> > before asking me my username password
> >
> > [cron at 10.0.0. root]$ telnet 10.0.0.4 5038
> > Trying 10.0.0.4...
> > Connected to 10.0.0.4 (10.0.0.4).
> > Escape character is '^]'.
> > Asterisk Call Manager/1.0
> >
> >
> > It then just hangs...
> > when I kill the telnet I get in the asterisk CLI
> >
> > == Connect attempt from '10.0.0.3' unable to authenticate
> >
> >
> > I also tried to run a php script
> >
> > <?php
> >
> > $socket = fsockopen("10.0.0.4","5038", $errno, $errstr, $timeout);
> > if (!$socket)
> > {
> > echo 'Socket fail<br>';
> > echo $errorno . '<br>';
> > echo $errstr . '<br>';
> > echo $timeout . '<br>';
> > }
> > else
> > {
> > fputs($socket, "Action: Login\r\n");
> > fputs($socket, "UserName: cron\r\n");
> > fputs($socket, "Secret: xxxxxx\r\n\r\n");
> > fputs($socket, "Action: Command\r\n");
> > fputs($socket, "Command: status\r\n\r\n");
> > $wrets=fgets($socket,128);
> > echo $wrets;
> > }
> > ?>
> >
> > and it displays back
> >
> > "Socket fail
> >
> > Connection timed out"
> >
> > Any ideas? Is it a telnet thing?
> >
> > _________________________________________________________________
> > Express yourself with cool new emoticons
>http://www.msn.co.uk/specials/myemo
> >
> > _______________________________________________
> > Asterisk-Dev mailing list
> > Asterisk-Dev at lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-dev
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-dev
> >
>
>
>--
>Shannon Mitchell, SCSA, SCJP shannonm at kvinet.com
>Kanawha Valley Internet www.kvinet.com
>300 Technology Drive Suite 202 South Charleston, WV 25309
>Voice: 304 720-1807 Fax: 304 720-1830
>
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
_________________________________________________________________
Get a FREE connection, FREE modem and one month's FREE line rental, plus a
US or European flight when you sign up for BT Broadband!
http://www.msn.co.uk/specials/btbroadband
More information about the asterisk-dev
mailing list