[Asterisk-Users] Manager API problems

Kyle Haefner khaefner at gmail.com
Tue Feb 22 14:38:42 MST 2005


Hello,

I am trying to set a variable using the Manager API Setvar.  I am
testing with a sample php code from the wiki. But when I run it I am
getting back the error:

ERROR:

Response: Error
Message: No such channel

Do channels have different names in the manager api than they do in
the Dialplan?

<?php
$socket = fsockopen("127.0.0.1","5138", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: kyle\r\n");
fputs($socket, "Secret: Start\r\n\r\n");
fputs($socket, "Action: SetVar\r\n");
fputs($socket, "Channel: Zap/9-1\r\n");
fputs($socket, "Variable: foo\r\n");
fputs($socket, "Value: 69\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while (!feof($socket)) {
$wrets .= fread($socket, 8192);
}
fclose($socket);
echo <<<ASTERISKMANAGEREND
ASTERISK MANAGER OUTPUT:
$wrets
ASTERISKMANAGEREND;
?>



Kyle Haefner
Colorado State Computer Science Dept.



More information about the asterisk-users mailing list