How to? SMPP client send/receive messages via GSM modem

How to? SMPP client send/receive messages via GSM modem SearchSearch
Author Message
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 4185
Registered: 10-2002
Posted on Friday, March 18, 2005 - 08:34 pm:   

From the NowSMS tech support files ...

Title: Using NowSMS to allow an SMPP client to send/receive SMS messages via a GSM modem

Q: Can I use the SMPP server in NowSMS to allow an SMPP client application to send and receive SMS messages via a GSM modem?

A: Yes.

Ok. That might be too simple of an answer, so I will explain how to configure this:

1.) The first step is to configure the GSM modem in NowSMS, such that you can properly send SMS messages via the NowSMS web interface. (The GSM modem connection is defined on the "SMSC" page of the NowSMS configuration.)

2.) Enable the SMPP server. This is configured on the "Web" page of the NowSMS configuration.

3.) Define an account on the "SMS Users" page of the NowSMS configuration, and enable it for SMPP.

4.) At this point, the SMPP application should be able to connect to the NowSMS server using the username and password defined for that account, and send messages.

SMPP clients will often ask about parameters like "system type", TON and NPI. For the most part, NowSMS will ignore these values. The only exception is that the client should use TON=1 if it is sending to international numbers (e.g., "+number"), and TON=0 if it is sending to national numbers.

Stop here if you only need your SMPP client to send messages.

5.) So far we've only covered sending messages, so now we move on to receiving messages.

Normally, you would route all messages received via a specific modem to a specific SMPP user account. (If you want to route messages to specific SMPP user accounts based upon keywords, I will describe this possibility later, as it is more complicated.) Multiple SMPP clients could be receiving messages that came in via different modems.

a.) On the "SMSC" page, select your modem entry, and press Properties. Define a "Phone Number" associated with the modem. This can be the modem's real phone number, but it does not have to be.

b.) On the "SMS Users" page, create an account so that your server can connect to NowSMS via SMPP. Check "Enable SMPP Login for this User". Check "Route received messages to user via SMPP". Under "Recipient address(es) to route to this user", put the phone number from "step 5a" above.

When NowSMS receives a message from the modem, it records the recipient address, and it then knows to route the received message to an "SMS Users" account where the client can receive the message via SMPP.

Stop here if you only need your SMPP client to receive and send messages, and it is ok for there to be a one-to-one mapping between GSM modems and receiving SMPP client accounts.

6.) What if you want to do more specialised routing of messages received via the GSM modem?

For example, what if you wanted to route the received message to a different SMPP client account based upon a keyword that appears as the first text of the message.

To configure this, we will need to "trick" NowSMS. We will use the "2-way" SMS facility to have NowSMS process the received message, and resubmit the message to NowSMS so that it is routed to a particular SMPP account based upon a keyword that appears as the first text of the message.

a.) The first step is to change part of what was done in "step 5b". In the "Recipient address(es) to route to this user", do not use the phone number that is associated with the modem. Using the phone number associated with the modem causes the received message to bypass the "2-way" facility and get routed directly to the "SMS Users" account.

Instead, the "Recipient address(es) to route to this user" should contain a made-up number that you will use for internal routing in NowSMS. For the sake of this example, we will use "9999".

b.) On the "2-way" page, you need to define a command which essentially receives the message, and resubmits it to NowSMS.

This is simpler than it sounds.

Define "SMS Command Prefix" as the prefix that you want to route to this particular SMPP account. (Use "*" to match any keyword.)

Define "Receive phone number(s)" as the phone number of your modem. (Or leave it blank to capture messages received from any modem.)

For "Command to Execute", enter:

http://username:password@127.0.0.1:8800/?PhoneNumber=9999&Sender=@@Sender@@&Text =@@FullSMS@@

"username" and "password" should match an account that you define on the "SMS Users" page. This account is different from the one you defined above. This account does not need to connect via SMPP, so just create another account.

"127.0.0.1" is the loopback HTTP address, which is telling NowSMS to connect back to itself.

"8800" should match the "Port number for web interface" defined on the "Web" page of the NowSMS setup.

This command simply causes NowSMS to resend the received message. However, when NowSMS resends the message, it will instead be sending the message to "9999", for which we defined a route in "step 6a" that routes the message to an SMPP client account.

Change "@@FullSMS@@" to "@@SMS@@" if you want the prefix to be removed from the message text before it is routed to the SMPP client.