I have an application which requires sending sms from one user to another.On receiving this sms it sends back a reply sms.I have developed a code but the problem is it goes in aloop of sending again and again from one user to another.For example if user 1 sends some sms to user 2,then a sms is automatically sent to user 1 which in turn automatically sends sms to user 2 again and this goes again and again.How can I avoid that? I have to send the reply sms only once from user 2 to user 1 and then no return sms.Please help me with this code.
Here is my code:
Thanks in advance.
If you know the exact text that the automated SMS reply will contain, can’t you just put a condition around the block that sends the reply?
edit: if the message is dynamic (which it seems that it needs to be, based on your comments) then you could ensure that all automatic replies start with a special string token which identifies them as an automatic reply. This way, if you receive a message that starts with your token, you know you don’t need to reply: