I have a php application that calls 2 phones numbers
the first # that it calls is my office extension and the second # that it calls is a particular # that is pass to it.
but i was wondering what would be the parameter to change my outgoing #
my code is
<?php
#------------------------------------------------------------------------------------------
#edit the below variable values to reflect your system/information
#------------------------------------------------------------------------------------------
#specify the name/ip address of your asterisk box
#if your are hosting this page on your asterisk box, then you can use
#127.0.0.1 as the host IP. Otherwise, you will need to edit the following
#line in manager.conf, under the Admin user section:
#permit=127.0.0.1/255.255.255.0
#change to:
#permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on)
$strHost = "xxx.xxx.x.xxx";
#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 = "xxxxx";
#specify the password for the above user
$strSecret = "xxxxx";
#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc
$strChannel = "SIP/xxxx";
#specify the context to make the outgoing call from. By default, AAH uses from-internal
#Using from-internal will make you outgoing dialing rules apply
$strContext = "from-internal"; // I think that this should be the extension # 1018
#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "30";
#specify the priority you wish to place on making this call
$strPriority = "1";
#specify the maximum amount of retries
$strMaxRetry = "2";
$pattern = '/[^0-9]*/';
$strExten = preg_replace($pattern,'', $_POST['txtphonenumber']);
$strSpoof =preg_replace($pattern,'', $_POST['txtphonenumberspoof']);
$length = strlen($strExten);
if ($length == 10 && is_numeric($strExten)){
$strCallerId = $strExten;
// echo("$strHost, 5038, $errnum, $errdesc");
$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
//SOMETHING WOULD GO HERE
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $strExten\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: $strPriority\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
sleep(5);
fclose($oSocket);
echo("
<table width=\"300\" border=\"1\" bordercolor=\"#630000\" cellpadding=\"3\" cellspacing=\"0\">
<tr>
<td>
We are currently trying to call you. Please be patient, and wait for
your phone to ring!
<br>If your phone does not ring after 2 minutes, we apologize, but must either be out, or
already on the phone.<br>
<a href=\"".$_SERVER['PHP_SELF'] ."\">Try Again</a>
</td>
</tr>
</table>"
);
}else{
echo("
<table width=\"300\" border=\"1\" bordercolor=\"#630000\" cellpadding=\"3\" cellspacing=\"0\">
<tr>
<td>
Enter your phone number (1XXXXXXXXXX), and we will call you a few seconds later!
<form action=\"".$_SERVER['PHP_SELF'] ."\" method=\"post\">
<input type=\"text\" size=\"20\" maxlength=\"\" name=\"txtphonenumber\" value=\"5551234567\"><br>
<input type=\"submit\" value=\"Call Us!\">
</form>
</td>
</tr>
</table>"
);
echo("
<table width=\"300\" border=\"1\" bordercolor=\"#630000\" cellpadding=\"3\" cellspacing=\"0\">
<tr>
<td>
Enter your phone number (1XXXXXXXXXX), and we will call you a few seconds later!
<form action=\"".$_SERVER['PHP_SELF'] ."\" method=\"post\">
<input type=\"text\" size=\"20\" maxlength=\"\" name=\"txtphonenumber\" value=\"5551234567\"><br>
<input type=\"text\" size=\"20\" maxlength=\"\" name=\"txtphonenumberspoof\" value=\"555-764321\"><br>
<input type=\"submit\" value=\"Call Us!\">
</form>
</td>
</tr>
</table>"
);
}