Modify or replace sender ID

Modify or replace sender ID SearchSearch
Author Message
Mohamed Anis
New member
Username: Mohamedanis

Post Number: 4
Registered: 02-2013
Posted on Thursday, November 28, 2013 - 10:41 am:   

Dears,

How I change all senders alphanumeric got to my gateway with fixed sender ID.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4758
Registered: 08-2008
Posted on Friday, November 29, 2013 - 03:09 pm:   

Hi,

Do you wish to change all senders to a fixed sender ID, or only alphanumeric?

To change all senders there are two available configuration settings:

1.) For the outbound SMSC connection, set a "Default Sender Address" and Uncheck "Allow Sender Address Override". This means that the "Default Sender Address" will be used as the sender for all messages sent via this SMSC connection.

2.) For each client account defined under "SMS Users", a "Forced Sender Address" can be configured. If this setting is used, this forced address is used as the sender for all messages sent from this account. (This setting also allows a comma delimited list of addresses that are allowed. If the client tries to use a sender address that is not in the list, the first sender address in the forced list will be used.)


For more flexibility, accounting callbacks can provide custom control.

Basically, an accounting callback is an HTTP interface where NowSMS can tell you when it processes a message ... and it can give you some control over how the message is processed. For example, you can control how the message is routed, or block NowSMS from accepting the message. You can also modify some message attributes such as the sender.

Accounting callbacks are described here:

http://www.nowsms.com/doc/advanced-configuration-settings/sms-accounting-callbac ks

There is an example of a simple accounting callback that selectively modifies recipient addresses here:

http://support.nowsms.com/discus/messages/1/70303.html

That callback is looking for recipient addresses that start with +91 and changing +91 to 0091.

If you wanted to do something similar for the sender address, change all 'To' references in that script to 'Sender' in order to affect sender address instead of recipient.

I haven't tested the following, but it should be close to what is needed.

We look for Type=SMSSend callbacks, and then check to see if Sender= is a numeric string. If it is not, this example changes the sender to 1234567890.

<?php
header ("Content-Type: text/plain");

if (!strcasecmp ($_REQUEST['Type'], "SMSSend")) {
if (isset($_REQUEST['Sender'])) {

$sender = $_REQUEST['Sender'];

/* If sender starts with +, remove for numeric test */
if (!strncmp ($sender, "+", 1)) {
$sender = substr($sender, 1);
}

/* Test if sender is all numeric */
if(!ctype_digit($sender)){
/* Sender is alphanumeric, so change it */
echo "Sender=" . "1234567890" . "\r\n";
}

}
}
?>

See the thread I referenced earlier (http://support.nowsms.com/discus/messages/1/70303.html) for more info on how to setup such an accounting callback.

--
Des
NowSMS Support
Mohamed Anis
New member
Username: Mohamedanis

Post Number: 5
Registered: 02-2013
Posted on Sunday, December 01, 2013 - 10:00 am:   

Dear Sir,

My Issue is :

I need to add prefix for Mobile number in case of got request from fixed sender (may be more than one)

as example

if i got request like

?To=+201XXXXXXXX&Sender=Razy2 replace mobile from +201XXXXXXXX to 601XXXXXXX

and
?To=+201XXXXXXXX&Sender=Razy1 replace mobile from +201XXXXXXXX to 701XXXXXXX
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4764
Registered: 08-2008
Posted on Tuesday, December 03, 2013 - 10:14 pm:   

What you describe is definitely possible.

The basic process of the accounting callback is that NowSMS issues an HTTP callback to provide your script with details about a submitted message.

If you have configured SMSAccountingAllowChanges=Yes under the [SMSGW] section of SMSGW.INI, your script can change some message attributes, such as sender or recipient by a special response.

For example, the accounting request might include ?To=+201XXXXXXXX&Sender=Razy2

If you want to change the sender to 601XXXXXXX, you issue the following text response in your accounting script:

Sender=601XXXXXXX


--
Des
NowSMS Support
Mohamed Anis
New member
Username: Mohamedanis

Post Number: 6
Registered: 02-2013
Posted on Wednesday, December 04, 2013 - 08:27 am:   

Dears ,

This Issue solved by put
SMSAccountingAllowChanges=Yes
and
SMSAccountingURL=http://localhost:8800/php/remap.php

into the file SMSGW.INI

and on my script remap.php I replaced client Mobile to fixed format based on SenderID.