NowSMS Overall Solution for Content Messages

NowSMS Overall Solution for Content Messages SearchSearch
Author Message
Walhan
New member
Username: Walhan

Post Number: 1
Registered: 11-2008
Posted on Wednesday, November 19, 2008 - 05:22 pm:   

Hello,

I am looking for SMS/or MMS gateway solution for content short code messaging (sometime called information). Each short code will have one or multi channels each with independent content. That is costumers send subscription code to short code and will receive confirmation (SP - belling) SMS from separated SP shortcode. As long as the subscriber doesn't cancel by sending cancel command (ex. C1 to Cancel from channel 1 in a shortcode), she/ he will keep receiving content messages (can be SMS or MMS depending in short code) in a daily basis and messages from the SP shortcode that will bill the subscriber every month.

If a user sends "h" to the short code, she will receive free help message explaining how to subscribe/unsubscribe from the main shortcode (will not receive form SP shortcode)

While if she sends 1, she will be sent back through the other shortcode that will bill her for a month and will be added to subscribers list for that particular channel (channel 1) in that particular shortcode. And will keep receiving until she unsubscribe.

Some shortcodes will be manages locally and some will be managed remotely. The management of a short code is mainly sending SMS/MMS to the distribution list which is somehow associated with certain channel in a certain shortcode. The distribution list should be stored at same server when the gateway and, as mentioned, has MSISDN which are automatically added/ removed as subscribers add or remove them selves. So each channel in each short code will have it's own distribution list.

In case of MMS, the message will be sent to as many recipients for each MMS as possible (in the BCC) so that they will have the license limitation as efficient as possible (am I right?)

Please indicate if NowSMS can do this and how. What are the simplest way to achieve this, even by email sending as long as it is reasonably secure, reliable and remote management can not control the subscribers additions or removals. Do you have ready configuration for that?

Another question, I have already start testing and found that when sending email through outlook express, the address of the user@sms.domain appears at the first line of SMS (MMS is not tested yet).

I will appreciate if you can answer these questions as thorough and clear as possible.

P.S If my question is not clear please don't hesitate and I will explain more.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7695
Registered: 10-2002
Posted on Thursday, November 20, 2008 - 07:01 pm:   

Hi,

You can use NowSMS as a building block upon which to build this solution.

The easiest way to interface with NowSMS is via HTTP.

When a message is received via SMS, NowSMS interfaces to your application via the 2-way command facility. The most common way this is used is to connect to your application via HTTP. You can define different commands that are triggered for messages received for different short codes (or phone numbers when receiving via modems), and you can use different commands based upon the first word of text in the message.

If you want to store distribution lists at the server, you could store them on the NowSMS server. There is an HTTP API that is described here: http://support.nowsms.com/discus/messages/485/20322.html

Or you could manage the lists in your application.

It is also easy to interface with NowSMS via HTTP for sending SMS messages. The above link talks about this as well ... you can specify a distribution list instead of a phone number when sending. (Just remember that distribution lists are user-account based on the NowSMS server, so to submit to a list you must specify the credentials of the user who the list belongs to.)


quote:

In case of MMS, the message will be sent to as many recipients for each MMS as possible (in the BCC) so that they will have the license limitation as efficient as possible (am I right?)




Your provider is still going to charge you for each recipient as a separate message. But yes, it is most efficient to do this because MMS sending can be slow.


quote:

Another question, I have already start testing and found that when sending email through outlook express, the address of the user@sms.domain appears at the first line of SMS (MMS is not tested yet).




That is the default behaviour for sending e-mail to SMS, as for most applications, they want to advice the receiving SMS user where the message came from.

That is, of course, not appropriate for all applications.

Here is a description of how to modify the template:


quote:

E-mail to SMS - Add template setting to allow some minor changes to the standard SMS to e-mail format (From /Subject /Message Text) used by NowSMS. To change the SMS to e-mail format, edit MMSC.INI, and add an SMSEMailTemplate= setting to define a template for the SMS to e-mail format. The following replacement variables are supported in the template: @@FromAddress@@ (e-mail address of sender), @@FromName@@ (full name of sender), @@Subject@@ (subject of message), @@Text@@ (text of message). The default template is SMSEMailTemplate=@@FromAddress@@ /@@Subject@@ /@@Text@@




Basically, you either want:

SMSEMailTemplate=@@Subject@@ @@Text@@

or:

SMSEMailTemplate=@@Text@@



-bn
Walhan
New member
Username: Walhan

Post Number: 2
Registered: 11-2008
Posted on Saturday, November 22, 2008 - 06:57 pm:   

Thanks for your respond. yes the email worked fine after the adding:

SMSEMailTemplate=@@Text@@

at the middle of the file

I can see that nowsms can interface through url calls. and receives a command also through url.

but i can't see how it can handle more than a command. for example i want first to add to distribution list

the command might look like this somehow (I didn't test it yet):

http://192.168.1.3:8800/dlists?DListName=@@phone@@@@command@@&DListMemberAction=Add&DListMember=@@SENDER@@

where distribution list name is shortcode name attached to channel number

But then I want to make another command to be send confirmation letter through different account to the sender:

cmd /echo thank you for joining our service....

and perhaps then sending email or so.

How can this be performed?

And how can we have more than a command executed.

Is there a command to send email?

Thanks in advance
Walhan
New member
Username: Walhan

Post Number: 3
Registered: 11-2008
Posted on Monday, November 24, 2008 - 07:34 pm:   

Also,

While sending email to phone numbers through outlook express is successful (1234@smsdomain), i am not able to send to distribution list (i.e. dlist@smsdomain)

any direction?

thanks again
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 257
Registered: 08-2008
Posted on Tuesday, November 25, 2008 - 06:09 pm:   

Sorry for the delay in reply.


quote:

I can see that nowsms can interface through url calls. and receives a command also through url.

but i can't see how it can handle more than a command.

for example i want first to add to distribution list

But then I want to make another command to be send confirmation letter through different account to the sender




You need to get into your own scripting to do something like this.

NowSMS is then configured to call your script via HTTP (for example, Perl, PHP or ASP running on another web server) or as a local command (such as VBScript or JScript running on the local Windows PC that is running NowSMS).

The process depends on which scripting language you are using. But generally speaking, it is easy to issue HTTP commands from within a script. We recently updated one of our old PHP examples here: http://blog.nowsms.com/2008/10/nowsms-php-example-send-sms-text.html

And there's a command line JScript example here: http://www.nowsms.com/support/bulletins/tb-nowsms-008.htm

If you haven't worked with any scripting languages in the past, it can be a bit overwhelming.

The two examples that I show above are examples of initiating a new action (using HTTP to send a message) in a script. You would take that action as one of the steps of processing the message in your script.

Some simple PHP examples of processing a message in a 2-way script can be found here: http://support.nowsms.com/discus/messages/1/4520.html


quote:

Is there a command to send email?




You can specify a "mailto:" link as a 2-way command, but it is somewhat primitive. It doesn't take any other action, just sends the SMS to the e-mail address specified in the "mailto:" link.


quote:

While sending email to phone numbers through outlook express is successful (1234@smsdomain), i am not able to send to distribution list (i.e. dlist@smsdomain)




Yes, this can be very confusing.

NowSMS has a concept of "user accounts" ("SMS Users").

Distribution lists are maintained on a per-user account basis.

In order to send a message to a distribution list, you must authenticate to NowSMS as the user account that owns that distribution list.

When using SMTP, this means using "SMTP Authentication", which is typically configured in an e-mail client as something like "My e-mail server requires authentication". You then authenticate using the "SMS Users" account username and password.

Here's where it gets a bit more confusing ...

In some simple NowSMS setups, user accounts are not used. This is the case if "Require authentication for web interface" is NOT checked on the "Web" page of the NowSMS setup.

NowSMS 2007.09.06 and later versions will allow users that do not authenticate via SMTP to send to these non-user based distribution lists. (Earlier versions can only use SMTP AUTHentication to access user account based distribution lists.)

--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 4
Registered: 11-2008
Posted on Thursday, November 27, 2008 - 10:12 am:   

Hello again,

We were able to create a simple PHP script to send SMS. But unfortunately with the same problem. only one URL will be executed then the browser will move away.

The test script mainly consists of many of the following PHP command:

header ("Location: http://server:8800/?PhoneNumber=414444444&Text=SMSTextTest");

but the NowSMS only executed one.


How can multi commands be executed through PHP?
------


I would also appreciate if you can explain in specific your above solution to send email to distribution list thought if the first question is solved we can rather use database.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 273
Registered: 08-2008
Posted on Friday, November 28, 2008 - 03:33 pm:   

Hi,

If you perform an HTTP redirect ("Location:" header in HTTP response), then that tells the browser to connect to the specified URL.

Instead of telling the browser to connect to the URL ... you want to have your script connect to the URL as part of its processing.

The link that I referenced above had some pointers to other links for sending messages from a PHP script. Here's the one you want:

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

Or, actually, instead of that, you might want to look at this link, where we recently updated the old example from that other link:

http://blog.nowsms.com/2008/10/nowsms-php-example-send-sms-text.html

Basically, within the processing of your PHP script, you can call SendSMS to initiate an action from within your script.


--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 5
Registered: 11-2008
Posted on Monday, December 08, 2008 - 12:37 pm:   

----
Basically, within the processing of your PHP script, you can call SendSMS to initiate an action from within your script.

----


The script you mentioned was tested perfectly and it can be used with php/mysql. When sending Arabic text through the script, however, the script sent instead unreadable characters. Is there work around for this?

I know if you invoke through url you would append " &charset=iso-8859-6 " to the URL.

But what about if we need to send directly from the script you made. How would it be used.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 300
Registered: 08-2008
Posted on Monday, December 08, 2008 - 08:38 pm:   

You'd need to modify the PHP script to specify iso-8859-6 in the URL request.

Change:

fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . " HTTP/1.0\n");


to:

fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . "&charset=iso-8859-6 HTTP/1.0\n");
Walhan
New member
Username: Walhan

Post Number: 6
Registered: 11-2008
Posted on Monday, January 19, 2009 - 06:34 am:   

Thanks Des, we were able to make it after your advice. However, when trying with multiple connections, your php script doesn't contain a paramater to specify which connection I wish to use. Is there a way to specify that.

Say I have two connections with the same operators, and I need to use one for certain messeges, and the other for other certain messeges, how can i tell the script which one i need to use?



Also, another question, some SMS will surely get failed due to many reasons (like no enough money in a prepade MSISDN) how can we pass this information to PHP?

.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 371
Registered: 08-2008
Posted on Monday, January 19, 2009 - 06:12 pm:   

Hi Walhan,

If each account has a different sender address (or short code), then you can include an "&Sender=xxxx" parameter in the URL request and the message will be routed outbound via the connection with the matching "Default Sender Address".

If both accounts use the same sender address, then you can use the "&SMSCRoute=xxxx" parameter to specify which route should be used.

The following article explains how you use this parameter:

http://blog.nowsms.com/2008/07/routing-sms-messages-to-specifc-smsc.html

In either case, you would need to modify the script to include this parameter in the URL request (similar to how you added the &charset=isos-8859-6 parameter above).

Since there was a lot of talk about 2-way SMS earlier in this thread, the following article might also be of interest:

http://blog.nowsms.com/2008/06/2-way-sms-multiple-operators-with-same.html

This article talks about how a parameter can be passed to your script telling you which SMSC connection a message was received via, so that you can then pass this parameter back to direct the reply via the same route.

--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 7
Registered: 11-2008
Posted on Monday, January 26, 2009 - 12:26 pm:   

Thanks Des!

Though still I can't find how to pass information that certain SMS to certain subscribers failed.

This is useful off course when certain subscribers can't receive charging SMS due to no enough fund in their mobile subscription (so they didn’t pay). So we want know if NowSMS ability to pass this information somehow to PHP script to remove that subscriber from the list because she/he couldn't complete subscription payment (since the SMS was failed)
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 391
Registered: 08-2008
Posted on Monday, January 26, 2009 - 10:06 pm:   

Hi Walhan,

That quickly gets complicated.

Basically, you'd need to request delivery receipts. And then you'd need a script to process the delivery receipts to look for problems.

As a starting point, the first few messages of the following thread talk about requesting delivery receipts, and what to look for to determine that a report is regarding an error (in particular, I talk about determing the error bit in the 8th posting on the thread):

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

--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 8
Registered: 11-2008
Posted on Monday, February 02, 2009 - 12:30 pm:   

Thanks Des,

You have been very helpfull so far.
I tried your advice during testing. We were able toimplement "&ReceiptRequested=Yes", and the delivery messege was perfectly arrived but it seems nowsms doesn't respond to it through 2-way. To isolate the issue, script was so easy that it will only add "test
فساتين
}" to txt file if invoked by 2-way with "id:*" perfix but it didn't work. we also tried to make it implemented through the same original * script but even though nothing was invoked. ofcourese recieved number(s) paramers was used and left blank with the same result. Can nowsms process delivery notification? doens it treet it like normal sms?

Thanks in advance

}
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 416
Registered: 08-2008
Posted on Tuesday, February 03, 2009 - 06:22 pm:   

Hi Walhan,

Can I see details about the received message (delivery receipt) as it appears in SMSIN-yyyymmdd.LOG?

Can you try to see if it makes a difference if the message you send out (with receipt requested) contains only English text?

The reason I ask is because we have encountered some provider systems that set the message encoding value in the return receipt incorrectly if the original message required Unicode encoding. We added a work-around for this in NowSMS 2008.09.09 and later (http://www.nowsms.com/download/nowsms2009.zip).

--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 9
Registered: 11-2008
Posted on Thursday, February 05, 2009 - 12:30 pm:   

Hello,

Please find below:

2009-02-05 15:20:15,xxxxxxxx,Text,id:493BEAF9 sub:001 dlvrd:001 submit date:0902051520 done date:0902051521 stat:DELIVRD err:000 text:hihihi,804603,SMSCReceiptMsgId=493BEAF9



I also set "Character Set" to "default" and "ascii" but with the same result.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 435
Registered: 08-2008
Posted on Thursday, February 05, 2009 - 04:55 pm:   

Ok ... the message itself looks fine. There is not a compatibility issue there.

The user account ("SMS Users") that submits the messages, does it have SMPP or SMTP login enabled?

If it does, then NowSMS will route the receipt back to that account directly, bypassing the 2-way command facility.

Can you disable the SMPP and/or SMTP login capability for the account?

--
Des
NowSMS Support
Walhan
New member
Username: Walhan

Post Number: 10
Registered: 11-2008
Posted on Friday, February 06, 2009 - 04:21 pm:   

Yes, it is now responding to delivery notification after disabling SMPP and SMTP Thanks Des again.