HTTP/1.0 404 Not Found Connection: close

HTTP/1.0 404 Not Found Connection: close SearchSearch
Author Message
milan
Unregistered guest
Posted on Tuesday, April 26, 2005 - 04:02 pm:   

Hi,

I would like to ask for help in the following matter. I successfully installed NowSMS on my computer with Windows XP Prof. with MS IIS web server. I am able to receive SMS and MMS messages and send SMS and MMS via Now Web Interface.

Now I want to send SMS via socket by using the PHP procedure SendSMS, which was published here. Unfortunately I haven’t been successful. After launching the procedure I always receive error message written into the Explorer window. HTTP/1.0 404 Not Found Connection: close Tis string is returned in the $res from the SendSMS.

Probably there is some problem with the authentication. I have similar problem with sending MMS messages as well

Thank for your advice.

Command line:
http://localhost/testsms.php?phone=724177996&text=QAhoj
The php procedure:
<?

function SendSMS ($host, $port, $username, $password, $phoneNoRecip, $msgText) {

$fp = fsockopen($host, $port, $errno, $errstr);
if (!$fp) {
echo "errno: $errno \n";
echo "errstr: $errstr\n";
return $result;
}

fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . " HTTP/1.0\n");
if ($username != "") {
$auth = $username . ":" . $password;
$auth = base64_encode($auth);
fwrite($fp, "Authorization: Basic " . $auth . "\n");
}
fwrite($fp, "\n");

$res = "";

while(!feof($fp)) {
$res .= fread($fp,1);
}
fclose($fp);


return $res;
}


if (isset($_REQUEST['phone'])) {
if (isset($_REQUEST['text'])) {
$x = SendSMS("127.0.0.1", 81, "milan", "123456", $_REQUEST['phone'], $_REQUEST['text']);
echo $x;
}
else {
echo "ERROR : Message not sent -- Text parameter is missing!\r\n";
}
}
else {
echo "ERROR : Message not sent -- Phone parameter is missing!\r\n";
}

?>

LOG:
23:55:25:426 [9] ThreadProcessConnection: Processing connection from 127.0.0.1...
23:55:25:426 [9] ThreadProcessConnection: Packet Length is 81 bytes
23:55:25:426 [9] ThreadProcessConnection: 47 45 54 20 2F 3F 50 68 6F 6E 65 3D 37 32 34 31 GET /?Phone=7241
23:55:25:426 [9] ThreadProcessConnection: 37 37 39 39 36 26 54 65 78 74 3D 51 41 68 6F 6A 77996&Text=QAhoj
23:55:25:426 [9] ThreadProcessConnection: 20 48 54 54 50 2F 31 2E 30 0A 41 75 74 68 6F 72 HTTP/1.0 Author
23:55:25:426 [9] ThreadProcessConnection: 69 7A 61 74 69 6F 6E 3A 20 42 61 73 69 63 20 62 ization: Basic b
23:55:25:436 [9] ThreadProcessConnection: 57 6C 73 59 57 34 36 4D 54 49 7A 4E 44 55 32 0A WlsYW46MTIzNDU2
23:55:25:436 [9] ThreadProcessConnection: 0A
23:55:25:436 [9] ThreadProcessConnection: HTTP/1.0 404 Not Found
Connection: close
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 4384
Registered: 10-2002
Posted on Tuesday, April 26, 2005 - 06:12 pm:   

Hi Milan,

It looks like the request is coming in to the MMSC Web port, instead of the web port for the SMS gateway.

Direct the request to the port number that is configured on the "Web" page of the setup under "Port number for web interface".

-bn