Change: (Error: Message Quota Exceeded)

Change: (Error: Message Quota Exceeded) SearchSearch
Author Message
Luciano Blanquero
New member
Username: Blanquero

Post Number: 13
Registered: 08-2008
Posted on Tuesday, September 02, 2008 - 02:46 pm:   

Hi;

How can I modify the page (at Nowsms) where this information goes out?

Error: Message Quota Exceeded

Because at this page also appears :
auth: "my user":"mypass" auth: XXXXXXXXXXXXXXXXXX= HTTP/1.0 403 Forbidden Content-type: text/html Expires: Tue, 01 Jan 1980 1:00:00 GMT Cache-Control: no-cache

If I put a public script php I don´t want that the user and password will be show at the public

How can I edit this page? because I don´t find it

and I don´t find the payment page for buy a licence for NowSMS
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 80
Registered: 08-2008
Posted on Tuesday, September 02, 2008 - 07:14 pm:   

Hi,

It is not possible to modify the "Error: Message Quota Exceeded" response.

HOWEVER ... NowSMS does not include the password for the user account in the HTTP response that it sends. I can only assume that this information about the user account is being generated by your PHP script for some reason.

If I do this from a PHP script on my server (and echo the response), I only see this:


quote:

HTTP/1.0 403 Forbidden Content-type: text/html Expires: Tue, 01 Jan 1980 1:00:00 GMT Cache-Control: no-cache

Error: Message Quota Exceeded

Accout "name": credit limit exceeded




Is there maybe some debug code in the PHP script that is echoing this information?



quote:

I don´t find the payment page for buy a licence for NowSMS




There is no on-line order page. Contact nowsms@nowsms.com to open a dialog with our sales department ... or feel free to call one of the phone numbers listed on this page: http://www.nowsms.com/contact.htm.

--
Des
NowSMS Support
Luciano Blanquero
New member
Username: Blanquero

Post Number: 15
Registered: 08-2008
Posted on Tuesday, September 02, 2008 - 07:31 pm:   

I am using this script


send.php:

<?

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;
echo "auth: $auth\n";
$auth = base64_encode($auth);
echo "auth: $auth\n";
fwrite($fp, "Authorization: Basic " . $auth . "\n");
}
fwrite($fp, "\n");

$res = "";

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


return $res;
}



$x = SendSMS("127.0.0.1", 81, "username", "password", "+4499999999", "Test Message");
echo $x;


?>


Which varible must I delete or modify for don´t show the user and password of my client when send a sms throught the file send.php?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 84
Registered: 08-2008
Posted on Wednesday, September 03, 2008 - 02:01 pm:   

Take out the following line, which appears twice:

echo "auth: $auth\n";
Luciano Blanquero
New member
Username: Blanquero

Post Number: 16
Registered: 08-2008
Posted on Wednesday, September 03, 2008 - 10:59 pm:   

ok, thanks Des,

I have deleted it, and now don´t appears the password.

But I´m worried, Can I add a secuencie line for reject "short numbers" at the receipient?

For example, that an user can send "hello" to "4466"

thanks
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 94
Registered: 08-2008
Posted on Thursday, September 11, 2008 - 08:54 pm:   

Hi Luciano,

Before I get to your other question, I want to point out that another thread for others who might be reading this.

The discussions here are mixed with the questions on the following thread: http://support.nowsms.com/discus/messages/1/24041.html

The other thread includes an explanation of how you could look for "Message Quota Exceeded" in the response from NowSMS, and return some other text to the submitting user.

As to rejecting messages addressed to "short numbers" ...

There are two ways to do this.

1. If your script is the only way that your users will be interacting with NowSMS, then test the length of the phone number before you call SendSMS.

Here's a simple PHP function that you could use:

function IsValidPhoneNumber ($phoneNumber) {
/* for test, remove leading international + if present */
if (substr ($phoneNumber, 0, 1) == "+") {
$phoneNumber = substr ($phoneNumber, 1);
}

if (strlen($phoneNumber) < 8) {
/* Short codes not allowed */
return FALSE;
}

if (!is_numeric($phoneNumber)) {
/* Phone number must be numeric */
return FALSE;
}

return TRUE;
}

In that script, you can perform whatever tests you want with regard to what recipient phone numbers are to be allowed.

You can also return error responses to your users so they can see why they are not allowed to send the message. (Use the "echo" command in PHP to return an appropriate error message.)

2. The other altnerative is to apply restrictions in NowSMS. However, when you do this, NowSMS will accept the message from the user ... but it will discard the message without sending it.

To implement this ...

Within NowSMS, in your SMSC definitions, you can UNcheck "Support any outbound message traffic", and define a list of recipient address patterns allowed on the route.

Usually, people put in patterns like this:

+1*

The above would indicate that all messages addressed to a phone number that starts with "+1" would be routed via this connection.

The SMSC connection will not process any messages to recipient addresses that do not match this mask. So, for example, you could define a pattern mask that matched mobile numbers in your country, and disallowed all other numbers.

Use the "?" character as a wildcard to match exactly one character. Use the "*" character as a wildcard to match zero or more characters.

For example, if I wanted to define a mask to allow only phone numbers with a length of 10 or longer, I would do this:

??????????* (10 ? and 1 *)

To define a mask to only allow phone numbers with a length of 10, I would do this:

?????????? (10 ?)

To define a mask to only allow phone numbers with a length of 10, that start with 07, I would do this:

07???????? (07 followed by 8 ?)

--
Des
NowSMS Support