How to define a username and password on:
/etc/asterisk/manager.conf
to originate a call from a php webform
this is the code i'm using on php form, but I got the error not autenticated
##### CODE ###
#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.$strUser = "admin";#specify the password for the above user
$strSecret = "1101";
$strUser = "1101";
//"amp111";
#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc
$strChannel = "SIP/1101";
#specify the context to make the outgoing call from. By default, AAH uses from-internal
#Using from-internal will make your outgoing dialing rules apply
$strContext = "vicidial-auto";
#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "15";
#specify the priority you wish to place on making this call
$strPriority = "1";
#specify the maximum amount of retries
$strMaxRetry = "3";
$number=strtolower($_REQUEST['number']);
$pos=strpos ($number,"local");
if ($number == null) :
exit() ;
endif ;
if ($pos===false) :
$errno=0 ;
$errstr=0 ;
$strCallerId = "<$number>";
$oSocket = fsockopen ("localhost", 5038, &$errno, &$errstr, 20);
if (!$oSocket) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $number\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: $strPriority\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
fclose($oSocket);
}
echo "Extension $strChannel should be calling $number." ;
else :
exit() ;
endif ;
?>