Unique replies to multiple sms messages - sms

Our scenario is as follows:
We have a marketplace where sellers will receive multiple messages throughout the day from users.
We want to send message notifications etc via sms to sellers
We would like sellers to be able to reply to a sms message notification on their phone. We want what they text to appear as their reply on our site. Is this possible?
Say a seller checks their phone as sees that they have 5 notifications, is there a way they can reply to a specific message rather than the last one sent?
Any help would be much appreciated.

As you describe the use case, it is not possible. As you suspect, there's no way to link one inbound message to a particular outbound message. I'd suggest borrowing an idea from Twitter and including a Base-36 code in the notification. If a reply contains that code, then it's in response to that original message. For example...
Notitification: A seller is interested in your widget. LFLR
Reply: #LFLR Sorry. We are sold out of the widgets.
It will take a slight bit of effort from the sellers. But, then, they are motivated to sell. Using a Base-36 code will keep the number of characters to type under five even for a million plus messages.

Related

How to implement SMS tracking in Twilio where multiple SMS been sent to the same number

We are implementing an SMS tracking feature for our app using Twilio where we will send an SMS to our customer and once they reply with Yes/No
we will take action accordingly. For normal case, where each customer has one single phone number we can easily track the replies and
take action. But if the customer use the same phone number for multiple accounts and we send multiple SMS to the same customer
(eventually in a same phone number) we are not able to track which specific SMS they have replied for.
Lets take an example,
User Tom has three accounts with us. Each of the three accounts uses the same phone number P.
Twilio SMS are tracked by a combination of From/To pair.
Assuming, we are using one Twilio proxy number as sending number which is S.
Case 1: Tom has one booking canceled for a short notice period. An SMS has been sent from S->P. When a reply is received, we can easily track the reply and take the action.
Case 2: Tom has two or more bookings canceled due to a short notice period.
For each canceled booking, an SMS has been sent from S->P. When the user replies, we are unable to detect which booking to mark the reply for.
It is not possible to know which message a person has responded to in SMS. The only way to efficiently handle this is to send messages from different numbers. So, if a user signs up with the same phone number as another user then you need to assign a new Twilio number to them. Then you can tell which user you are contacting or receiving messages from by the number.
If you send out messages about bookings on the same account at the same time, then you need to be even more granular with the number access. Each notification should assign a number to use and then when a reply comes to that number it was about that notification. Then if you need to send a second message simultaneously, you attach a different Twilio number to it. And so on for more messages.

Fire Message Event Only when These other Messages have been sent

I'm working on architecting a micro-service solution where most code will be C# and most likely Angular for any front end. My question is about message chaining. I am still figuring out what message broker to use; Azure Service Bus , RabbitMQ, etc.. There is a concept which I haven't found much about.
How do I handle cases when I want to fire a message when a specific set of messages have fired. An example but not part of my actual solution: I want to say Notify someone when pays a bill. We send a message "PAIDBILL"
which will fire off microservices which will be processed independently:
FinanceService to Debit the ledger and fire "PaymentPosted"
EmailService: email Customer Saying thank you for paying the bill
"CustomerPaymentEmailSent"
DiscountService: Check if they get a discount for paying on time then send
"CustomerCanGetPaymentDiscount"
If all three messages have fired for the Same PAIDBILL: Message "PaymentPosted", "CustomerPaymentEmailSent", "CustomerCanGetPaymentDiscount"
then I want to email the customer that they will get a discount on their next bill. It Must be done AFTER all three have tiggered and the order doesn't matter. How do I Schedule a new message to be sent "EmailNextTimeDiscount" message, without having to poll for what messages have fired every minute, hour, day?
All I can think of is to have a SQL table which marks that each one is complete (by locking the table) and when the last one is filled then send off the message. Would this be a good solution? I find it an anti-pattern for the micro-service & message queue design.
If you're using messages (e.g. Service Bus / RabbitMQ), then I think the solution you have described is the best one. This type of design - where services have knowledge about the other domains in the system - is typically known as choreography.
You'll want to pick a service which will be responsible for this business logic. That service will need to receive all the preceding types of messages so that it can determine when (if) all have been met, which it probably wants to do by recording which of the gates have already passed in a database.
One alternative you could consider is chaining the business processes instead of doing them in parallel. So...
PAYBILL causes FinanceService to Debit the ledger and fire "PaymentPosted"
"PayentPosted" causes EmailService to email Customer Saying thank you for paying the bill and broadcasts "CustomerPaymentEmailSent"
"CustomerPaymentEmailSent" causes DicsountService to check if they get a discount for paying on Time then sends "CustomerCanGetPaymentDiscount"
The email you want to send is just triggered by "CustomerCanGetPaymentDiscount".
If I'm honest, I would switch around the dependency model you're using at this last stage. So, instead of some component listening for "CustomerCanGetPaymentDiscount" events from DiscountService and sending an email, I think I would instead have the DiscountService tell some other component to send an email. It seems natural to me for something that calculates discounts to know that an email should be sent. It seems less natural for something that sends emails to know about discounts (and everything else that needs emails sent). This is why I don't like architectures where the assumption is that every message should be an event and every action should be triggered by an event: it removes a lot of decisions about where domain logic can live, because the message receiver always has to know about the domain of the message sender, never vice versa.

Send SMS from GSM Modem witout getting target as SPAM from Carrier

I will like to explain a little bit my situation before i ask my question so if you like to read it here is it:
On my country i have a small school just 150 students, i will like to send to each of them 5 SMS per day with different information so i don't have to use paper anymore, using internet is out of the question because most of my student don't have internet on there phones or in there homes but everyone has a phone that receives SMS, i searched all over the internet and most SMS providers charge approximately $/0.03 per SMS and that is just too much for me because at the exchange rate each SMS ends up costing me almost 0.10 at my currency, the SMS providers that offer SMS cheaper than that are blocked by my local phone providers so there SMS don't arrive at my local phones.
The math end up like this
150 students x 5 sms per day x 20 days per month x 0.1 per SMS = 1,500
approximate and that is way out of my budget.
On my country my providers offer free sms for a month for each SIM card that you buy and each SMS card cost 5.0 per month, so i whant to buy 6 CARDS and send SMS to 25 students per SMS card per DAY so i will have to pay each month only 30 and i will be able to send all SMS on my budget.
Now my question, i just want to know if using the SMS cards like this is possible, or i will get flag by my telephone providers. On my mind what i want to do is like giving each of my teachers one phone and make them use that phone to send SMS to there students 25 students per teacher, and there is nothing wrong with it, the only difference is that i will use the SMS cards on GSM modems and connect them to a computer so it will require only 1 computer instead of 6 phones, i will still pay the cost that my providers ask for each SMS card so on my mind i am not doing nothing wrong, but maybe one of you that read this question have a different point of view and with your answers you can help me to see other sides of the picture and help me find out if i am right and i am not doing anything wrong or I'm wrong.
Looking forward to your answers so i can continue with my project or forget all about it.
It's curious to see that situation about of buying such amount of simcards. Well, the best scenario is that all of your students have the same cellphone operator but I guess that is not your case. For example, in my country there's a SMS packet of 10000sms that you can buy for almost 4USD but it covers SMS to mobile phones of the same operator you have.
The other way is to send SMS from the web (i.e https://www.sendatext.co/) but according to your situation it looks like everything must be done manually. There are many ways to solve this, but I hope you can consult that with your phone operator. Maybe they will offer a special price for you in order to support schools and education. Just saying. Have a nice day
When you use SIM card to send messages, it means it is MO-MT (phone to phone).
In such cases no operator will filter messages in any case (as you pay).
Also, ask your operator, if they provide other way to send SMS thru application (usually thru API or SMPP).
Based on the documentation here:
http://www.notepage.net/manuals/pg/v8/server/html/index.html
You could try to use a program called PageGate to interface with your cellular modem to send SMS. Based on what you've described, you'll probably want to use the GUI Client to submit the messages that are then delivered using the cellular modem.
You'll first, you'll need to connect the modem to the PC and make a note of either the device's IP (if it receives messaging commands by TCP) or COM port. Once you have that information, you'll want to install PageGate, then go through the steps for 'Creating a GSM-AT' carrier as that's what lets thep rogram talk to the cellular modem.
Also, since you're going to be using a cellular modem, that also opens up the ability for the people who receive your messages to reply to them. If someone does reply to a message, that reply will come back to the cellular modem and sit in memory on the device. PageGate can be configured to check the device for replies and has a reply processing system, with optional scripting module, that can do what you please with those replies (like write them as a file to a directory for record keeping, send them as an email to a predetermined email address or other SMS number, scan the reply for certain keywords and change who the reply needs to go to, etc).

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.

Any way to tell what text message another message is in response to?

Are there any texting services out there (like Twilio) with APIs that allow you to see what message another message is in response to? For example: I want to tell whether message 3 is in response to 1 or 2.
A->B: Do you like ice cream?
A->B: Do you like pizza?
B->A: Yes.
I'm guessing that there's just no threadedness to text messages, and this is impossible. But might as well have a canonical answer out there.... Reasons for this belief:
When you send emails to a phone number at txt.att.net, it uses a different number each time.
The texting services that I've looked at don't offer the feature
The phone UIs I've used all present it as a flat message list rather than a threaded list
Can someone confirm this?
There is no native support for this type of functionality in SMS. Message threading for SMS is inferred on the client side from context. When I send a text to person 1, if I receive a reply from person 1 within a given time-frame, I can assume that it was part of the same "conversation". (I actually implemented something like this for a chat client that I was working on)
I have also seen where the original message is included with the response, and the client can group the messages accordingly (take a look at gmail), but this could be messy if your clients were not the same.
Just a few thoughts.

Resources