Sender number

Sender number SearchSearch
Author Message
seye ogunkoya
New member
Username: Seyz4all

Post Number: 1
Registered: 07-2008
Posted on Saturday, July 05, 2008 - 02:25 pm:   

Nowsms has been while i use it, but i want to know how to change the sender number to a name, like church name, so that the receiver would see the name and not the phone number cos i use a mobile phone to connect with nowsms....

please help me out.
Luciano Blanquero
New member
Username: Blanquero

Post Number: 14
Registered: 08-2008
Posted on Tuesday, September 02, 2008 - 03:21 pm:   

I want to know the same.

Can I put diferents sender numbers to the diferents users? Why?

For example:

- User 1 ---------- sender address 1
- User 2 ---------- sender address 2
- User 3 ---------- sender address 3
- User 4 ---------- sender address 4
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 79
Registered: 08-2008
Posted on Tuesday, September 02, 2008 - 06:58 pm:   

If you are sending messages using a GSM modem, it is not possible to change the sender address. In order to use different sender addresses, you need to be connected to an SMS service provider via one of the TCP/IP based protocols (like SMPP), and your provider may have restrictions on what sender addresses you are allowed to use.

Assuming that you have a connection to an SMS service provider that allows you to use different sender addresses, you can force different NowSMS user accounts to send messages using a different sender address. This is configured as a property of the "SMS Users" account, as the "Forced Sender Address". If a value is set for "Forced Sender Address", this value will be used as the sender address for all messages submitted by that user account.

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

Post Number: 17
Registered: 08-2008
Posted on Thursday, September 04, 2008 - 06:00 pm:   

Hello;

Can you provide me a sentence for put a Try Catch for capture this:

auth: aW50ZWw6aW50ZWw= HTTP/1.0 200 OK Content-type: text/html Expires: Tue, 01 Jan 1980 1:00:00 GMT Cache-Control: no-cache

It appears to my clients when send a sms, and I would like to remplace this for "SMS SENDED OK"


The script-sms is the next:

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;
$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;


?>


thanks
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 92
Registered: 08-2008
Posted on Thursday, September 11, 2008 - 08:23 pm:   

I am not very strong with PHP.

But it seems relatively simple to clean this up.

Let's take one issue at a time.

This part looks confusing and ugly:

auth: aW50ZWw6aW50ZWw= HTTP/1.0 200 OK Content-type: text/html Expires: Tue, 01 Jan 1980 1:00:00 GMT Cache-Control: no-cache

The "auth:" part is present because of the echo "auth: $auth\n" statement .... so you simply need to remove it.

The part that starts with "HTTP/1.0 200 OK" is the HTTP header of the response from NowSMS.

If you want to filter out the HTTP header, use the following after the $x = SendSMS ... statement:

$httpBody = strstr ($x, "\r\n\r\n");
if ($httpBody) $x = $httpBody;

After that, it is echo $x that displays the response from NowSMS. You don't have to display that if you don't want to. Simply remove that command ... and instead you can parse common responses and translate them if you want.

For example, if the message sending is successful, "MessageID=" will definitely be present in the response. So in my example below, if that is present, instead of displaying the response from NowSMS, instead we just say: "Message queued for sending".

For all other cases, we display "Error sending message" ... and after that, we display the body of the HTTP response from NowSMS, so that you can know what the error condition is (such as "Message Quota Exceeded").

If you want to display a different response when "Message Quota Exceeded" than strstr looking for "Message Quota Exceeded" and echo a different text message in that case.

if (strstr($x, "MessageID=")) {
echo "Message queued for sending\n";
}
else {
echo "Error sending message<br><br>";
echo $x;
}
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 93
Registered: 08-2008
Posted on Thursday, September 11, 2008 - 08:28 pm:   

This thread is mixed with the questions and discussions that started in another thread: http://support.nowsms.com/discus/messages/1/24249.html

I am closing this thread, and to continue discussion, please post in the other thread.

--
Des
NowSMS Support