[asterisk-users] To Asterisk AMI Gurus - Tacking issue with originate

Bruce Nik brucevoip at gmail.com
Thu Dec 17 19:29:55 CST 2009


Hello Everyone,

I am making a simple index.php file which will allow a web user to enter his
$phoneNumb, $dialNumb, and callerID ($spoofNumb) and get the call bridged.
Following is the index.php and the contents of extensions_custom.conf. When
I submit the form nothing happens. I don't even see Manager Connected msg.
Your input will be much appreciated. I am thinking I have some syntax
problem.

/etc/asterisk/extensions_custom.conf
*[testphp]
exten => _X.,1,Answer()
exten => _X.,n,Dial(SIP/testTrunk/${EXTEN})
exten => _X.,n,Hangup()*

*
*
*
*
*
*****************************************************************************************************
*
/var/www/html/clickncall/index.php
<html>
<head>
<title>ClicknCall</title>
</head>
<body><br><br>
<div align="center">

<?php

$sys_ip = "127.0.0.1";
$User_str = "testphp";
$Secret_str = "testphp";

if ($_POST['x']) {
$oSocket = fsockopen($sys_ip, 5038, $errnum, $errdesc) or die("Connection to
host failed");

fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Username: $User_str\r\n");
fputs($oSocket, "Secret: $Secret_str\r\n\r\n");
fputs($oSocket, "Events: off\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: SIP/testTrunk/$phoneNumb\r\n");
fputs($oSocket, "Exten: $dialNumb\r\n");
fputs($oSocket, "Context: testphp\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Timeout: 10000\r\n");
fputs($oSocket, "CallerId: $spoofNumb\r\n");
fputs($oSocket, "Async: true\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");

fclose($oSocket);

print $_POST['x'];

} else {
  print "<form method=\"post\"action=\"$_SERVER[PHP_SELF]\">";
  print "<br>";
  print "PHONE Number: <input type=\"text\"name=\"phoneNumb\">";
  print "<br>";
  print "PARTY Number: <input type=\"text\"name=\"dialNumb\">";
  print "<br>";
  print "FORGE Number: <input type=\"text\"name=\"spoofNumb\">";
  print "<br>";
  print "<input type=\"Submit\" value=\"                         Dial
                     \">";
  print "</form>";

} ?>

</div>
</body>
</html>

************************************************************************************
*/etc/asterisk/manager_custom.conf*
[testphp]
secret = testphp
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user


Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091217/146fef51/attachment.htm 


More information about the asterisk-users mailing list