Kannel routing based on prefix - kannel

I've got a trouble with Kannel. I am using it as an SMS aggregator like this ESME-Kannel-SMSC. I've got several SMSC and I need to implement routing based on phone number prefix. Is it possible? Anyone has done it before?

Take a look at the Kannel documentation for SMS center variables:
allowed-prefix: A list of phone number prefixes which are accepted to be sent through this SMSC. Multiple entries are separated with semicolon (';'). For example, "040;050" prevents sending of any SMS message with prefix of 040 or 050 through this SMSC. If denied-prefix is unset, only these numbers are allowed. If set, number are allowed if present in allowed or not in denied list.
denied-prefix: A list of phone number prefixes which are NOT accepted to be sent through this SMSC.
preferred-prefix: As denied-prefix, but SMS messages with receiver starting with any of these prefixes are preferably sent through this SMSC. In a case of multiple preferences, one is selected at random (also if there are preferences, SMSC is selected randomly)

Related

SMS to Twilio Number with Extension

I'd like users to be able to text my Twilio number and have the text forwarded to various recipients based on the number's extension. i.e. texting to 555-555-5555,2 should route to a different receiver than 555-555-5555,3.
This Quora answer hints that this is possible, but I haven't found any further documentation: https://www.quora.com/Is-it-possible-to-send-a-text-message-from-my-Android-to-a-phone-number-with-an-extension-number
I tried using Twilio Studio to implement something like an IVR or message/response, but that only produced a text prompt which didn't seem to respond to the number entered after the comma.
This not possible by appending data to the destination number. You would need to place directives in the SMS message body and have your Twilio (Studio) logic parse the message body to determine how to deliver the SMS (which Phone number to deliver the SMS to).

SMPP message concatenation across multiple binds

We have developed an SMPP server based on CloudHopper SMPP library. The system is in production processing a considerable volume of messages everyday.
Customers are allowed to maintain multiple TX binds for a higher throughput and redundancy. Recently we identified that a few of our customers send segmented messages (message parts) over multiple binds. So we receive parts of a single SMS over different binds from the same customer (same SystemId) and those are valid (in UDH, Having the same reference number, valid seq no etc).
We support concatenation on a bind level, but not across multiple binds.
Is it a standard/good practise to support concatenation for parts sent over multiple binds? Message reference number in the UDH header for concatenated messages should be unique for all binds created by an SMPP gateway? Any thoughts on this are welcome
UPDATE:
Regarding MessageRef no in UDH, we understood that there is no guarantee that it will be unique across multiple binds. (We see repeated MessageRef in concurrent binds from the same customer). Now we concatenate parts if they have the same MessageRef no and also the same destination number. We believe it is rare to receive two part sequences at the same time with equal MessageRef numbers, going towards the same mobile.
As long as a concatenated messages have valid UDH, I see not issue on this. SMSC further is usually transparent on this, altough it knows the multipart messages belong to single SMS message. From a practice side, customers usually have limitation on bind side just for 1 transmitter (on gigabit network should not be an issue), but this depends on number of messages/s they want to submit.
I usually have my own queue in between, so the submit response does not affect SMSC submit delay.

Any way to determine which text message is being responded to?

I use Twilio with my team management system. A text message is automatically sent out for each game. The receiver can then reply with YES or NO. My issue is that when I send two text messages, I have no way to tell if the reply is for the first message I sent, or the second.
Does Twilio have any way to determine which text message it was a response to?
Twilio developer evangelist here.
If you are sending two messages from one Twilio number to the same user number there is nothing within the SMS specification that allows a user to reply to a specific message, so there is nothing you can do with Twilio to detect that.
If you are sending two messages to two different numbers and you get replies from those numbers, you can match against the from number and see what the last message sent from that number was and attach the reply to that.
Alternatively, if you want to get replies from one user to different messages, you could send them from different Twilio numbers. That way you can match the outgoing number to the message and the answer. This is mostly used for phone number masking to enable anonymous communications and there is a good tutorial available on this in the Twilio documentation.
Let me know if that helps at all.

Will concatenated sms be delivered always in the order sent out by a GSM handset?

As I know concatenated sms are split in GSM handset and delivered to network. Does GSM standard talk about order of these packets? Will it be always sent in order? That is first sequence packet first and next later?
My questions regarding this.
1. Does SMPP talk about order of long sms segments? Like is it possible for SP to get out of order messages?
2. Does GSM handset deliver long messages always in order or not?
"long sms" officially known as concatenated sms can and will turn up in any order. Therefore the receiving device / system must be able to cater for this. Concatenated sms come in the form of multiple sms. Encoded within is the part number and the total number of parts for the concatenated sms (you can search for information on the "UDH - User Data Header" to get more information).
So answering your questions:
1) There is no ordering in the sending / receiving of concatenated sms. Only information within each concatenated sms part which says which part it is and how big the complete concatenated sms is.
2) GSM handsets tend to send out in order. The order is lost usually during the store and forward process on the SMSC side. On a side note GSM handsets when receiving a concatenated sms build the sms once all parts are received.

How do some SMS messages transmit the senders name?

I have noticed that certain SMS messages that I receive from companies come with a 'sender name'. eg. Just today I received an SMS from a number I have never used before (not im my contacts), however the senders name showed up as 'Adobe'. I get this from other companies too. eg Facebook, Google & Banking.
Is it similar to how a email server works? (you tell the server who you 'are' before you send the message) Is this the case with a carrier's cell tower?
I guess I'm wondering what the service is called and how it works? (ie. can you send 'header info' with SMS messages or is the cell tower just spoofing the message's 'sender number' and replacing it with characters?)
(hopefully this is the right place to ask this question...)
The MAP protocol (the one used for sending SMS messages among others) allow specifying either a phone number or an alphanumeric number as the sender.
AFAIK this cannot be set from your phone where the sender number will be always your public phone number but SMS Centers can allow sending such messages on other interfaces like the ones used by banks and the companies mentioned by you (usually using the SMPP or UCP protocoll).
Please note that some Telcos do not allow this kind of sender address in messages originated elsewhere but sent to their customers (or they don't allow it for everybody). They use SMS spam filters/firewalls called Home Routers for this.
Mobile communication in GSM, UMTS and LTE is governed by 3GPP.
The TP-OA field in SMS-DELIVER TPDU in an incoming SMS typically contains the number of a sender.
The network fills the TP-OA field with usually an MSISDN.
Please see 3GPP TS 23.040 Figure C.10.
But in case of a company name, TP-OA can be made alphanumeric using the Type of Number Information Element as 7-bit default alphabet
I suggest you to read 3GPP TS 24.011 and 23.040 to get an idea of how SMSes work.
However, I must point out that since a sender does not send TP-OA, it can't be easily spoofed.

Resources