Two way sms question

Two way sms question SearchSearch
Author Message
Mad
New member
Username: Madsms

Post Number: 1
Registered: 04-2007
Posted on Thursday, April 05, 2007 - 12:45 pm:   

Hi,
I need to receive messages from an SMPP connection and forward them to a third party using http. The URL of the third party looks like this:
http://IP:port/xxx/message?MSISDN=XXXXXX&ShortCode=XXXX&SMS=XXX&lang=X

where:

MSISDN= sender mobile number

ShortCode= the short code of the operator.

SMS= Message sent from user (Hexadecimal for Arabic and as is for English )

lang= 1 for Arabic message and 2 for English message.

filling the (command to execute) field with the following:

http://IP:port/xxx/message?MSISDN=@@SENDER@@&ShortCode=@@RECIP@@&SMS=@@FULLSMS@@ &lang=2

did the job successfully for the English messages. The question now is what parameter can tell me whether the message is Arabic or English and how to let the Arabic message processing execute a URL other than the URL that is excuted by the English message. Another question is what paramater to use instead of @@FULLSMS@@ so that the returned text will be the hexadecimal code for the Arabic message.

Please do your best to help me.. Thanx
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7057
Registered: 10-2002
Posted on Thursday, April 05, 2007 - 08:12 pm:   

Hi Mad,

There is no facility in NowSMS to run a different 2-way command depending on whether a message is text or binary.

However, by default, binary messages are not forwarded to 2-way SMS commands unless the command includes @@BINARY@@ in the URL. If the message is text @@BINARY@@ will be replaced with a 0, and if the message is binary, it will be replaced with 1.

So you could do:

http://IP:port/xxx/message?MSISDN=@@SENDER@@&ShortCode=@@RECIP@@&SMS=@@FULLSMS@@ &binary=@@BINARY@@

And if the message is English, you'd get the text and binary=0. If the message is Arabic (or other requiring Unicode encoding), you'd get the hex string of the Unicode for @@FULLSMS@@ and binary=1.

Not exactly what you are looking for, but maybe something you could work with?

-bn
Mad
New member
Username: Madsms

Post Number: 2
Registered: 04-2007
Posted on Sunday, April 08, 2007 - 07:45 am:   

Thank you sir,
I've tried this url
http://IP:port/xxx/message?MSISDN=@@SENDER@@&ShortCode=@@RECIP@@&SMS=@@FULLSMS@@ &lang=@@BINARY@@

then sent an Arabic message. lang=@@BINARY@@ should retain lang=1 and the SMS=@@FULLSMS@@ should retain the hexadecimal code of the Arabic message and everything must go ok. Unfortunately, this was not the case, the received message at the third party was a kind of garbage letters and not the arabic text.
Please advise what character set to choose in the 2-way window.
a related question is that is it possible to get the messages received by a connection autoforwarded (sent) through another connection. This may solve the problem. In my case nowsms must receive the messages from an smpp connection then autoforward them to an http connection (http connection has the ability to differentiate text messages from binary messages and sends each one through the assigned url).
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7066
Registered: 10-2002
Posted on Monday, April 09, 2007 - 08:02 pm:   

Hi Mad,

Sorry, I was incorrect in my previous reply.

I forgot that Unicode messages (such as Arabic) are converted to text before they are passed to the 2-way command facility. I was incorrect in stating that they were forwarded as hex data.

Therefore, NowSMS, when passing the message to a 2-way command will not distinguish whether the message is in English or Arabic. It will treat both cases the same, and will execute the same 2-way command.

By default, NowSMS uses the UTF-8 character set for passing the text to a 2-way command. UTF-8 is based on Unicode, so it can support all languages. Your application is seeing garbage because it does not support UTF-8.

What you can do is set "Receive Character Set" to "iso-8859-6", which is Arabic. This is probably the character set that your application expects.

The "iso-8859-6" character set supports both Arabic and English. So hopefully your application should be able to supprot both without a "&lang=" parameter.

Disregard the @@BINARY@@ parameter that I mentioned as it does not apply to your configuration.

-bn
MadSMS
New member
Username: Madsms

Post Number: 3
Registered: 04-2007
Posted on Tuesday, April 10, 2007 - 06:14 am:   

Thank you sir for your explanation. The problem in my case is that I I have to forward the messages to a third party which uses their own software which they developed (not nowsms). The messages they receive via http must meet their predefined http template and the arabic messages must be received in hexadecimal. They are receiving messages in the same manner from many other parties and I have to do the same. I like NowSMS and I am sure that we will find a way to accomplish their needs.
i think that the solution will be autoforwarding the messages received from the smpp connection to the third party using http connection where:
URL template text:http://IP:port/xxx/message?MSISDN=@@Sender@@&ShortCode=@@PhoneNumber@@&SMS= @@Text@@&lang=2

URL teplate Binary: http://IP:port/xxx/message?MSISDN=@@Sender@@&ShortCode=@@PhoneNumber@@&SMS=@@Dat a@@&lang=@@UDHBin@@

and the question now is how to autoforward the messages received from the smpp connection to the third party using http connection?
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7108
Registered: 10-2002
Posted on Friday, April 13, 2007 - 07:42 pm:   

What is the direction of the SMPP connection?

If the SMPP client is initiating the connection to NowSMS (login account defined under "SMS Users"), then any messages received from the SMPP client would be routed to an "HTTP SMSC" connection, like you describe. (I think you would need to change "&lang=@@UDHBIN@@" to "&lang=1")

If NowSMS is initiating the connection to the SMPP server (defined in the "SMSC" list), then by default, NowSMS will route any messages received via that connection to the "2-way" facility instead of outbound routing via an "HTTP SMSC". However, there is a way to change this.

In SMSGW.INI, under the [SMPP - server:port] section header, add:

ReRouteReceived=HTTPSMSC

In SMSGW.INI, under the [HTTP - server:port] section header, add:

RouteName=HTTPSMSC

This configuration parameter tells NowSMS that any SMS messages it receives from "SMPP - server:port" should be re-routed for delivery via a route named "HTTPSMSC". And the "RouteName=HTTPSMSC" setting links this route to "HTTP - server:port".

-bn
MadSMS
New member
Username: Madsms

Post Number: 4
Registered: 04-2007
Posted on Tuesday, April 17, 2007 - 10:38 am:   

Sorry for being late in the reply. I was testing the solution in the last days. In my case NowSMS is initiating the connection to the SMPP server (defined in the "SMSC" list so I changed the SMSGW.INI to the format you specified but it did not work. Nothing was sent by http. Would you please see the attached SMSGW.INI file and advice me what to do. Thank you
application/octet-streamSMSGW.INI
smsgw.INI (0.7 k)
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7115
Registered: 10-2002
Posted on Tuesday, April 17, 2007 - 01:47 pm:   

That looks correct.

One thing I forgot is that support for this "ReRouteReceived" configuration is relatively new in NowSMS. You need v2007.01.24 or later. For a patch to update to the latest version, download http://www.nowsms.com/download/20070412.zip.

-bn
MadSMS
New member
Username: Madsms

Post Number: 5
Registered: 04-2007
Posted on Wednesday, April 18, 2007 - 08:05 am:   

Thank you very much sir. It worked successfully. Your support is really brilliant. Thank you again.
Mukund Daga
New member
Username: Daga0001

Post Number: 3
Registered: 05-2007
Posted on Wednesday, May 16, 2007 - 09:05 am:   

Hello ,

I was wondering if you could help me out is some way. I wanted to extract a portion of the string that a sender is sending via SMS. The incoming SMS would then act as an input for a script code that would process the data and give me the output which I wanted to send back to the sender. Is it possible to do so ? How do I program this via NowSMS ?
Mukund Daga
New member
Username: Daga0001

Post Number: 4
Registered: 05-2007
Posted on Wednesday, May 16, 2007 - 09:07 am:   

For example, if the SMS is "LT 1234" , the SMS should first trigger a script and then take 1234 as the input for that particular script. And I wanted to send the output of the script back to the sender of the SMS. I would really appreciate any help. Thanks a lot. :-)
Mukund Daga
New member
Username: Daga0001

Post Number: 5
Registered: 05-2007
Posted on Wednesday, May 16, 2007 - 09:09 am:   

For example, if the SMS is "LT 1234" , the SMS should first trigger a script and then take 1234 as the input for that particular script. And I wanted to send the output of the script back to the sender of the SMS. I would really appreciate any help. Thanks a lot. :-)