Send Flash SMS Response to 2-way SMS | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through April 13, 2018 ⬆ |
◄ ► |
Author | Message | |||
Sandeepp New member Username: Sandeepp Post Number: 1 Registered: 06-2015 |
Hi, We are currently running the demo version of the software. We are planning to buy license next week only. To evaluate the client requirement, we came across one issue. We are connected to SMSC server and established the 2-way messaging service. Based on client requirement, we will receive SMS and need to send back Flash message to the user. We are able to send 2-way sms and also from the web panel can send the flash message. But return message from the 2-way communication always sending the text message. I also added the DCS flag in the ini file, but that did not help. Can you please guide how to handle the situation? This is urgently required. Thanks and Regards, Sandeep | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5338 Registered: 08-2008 |
Hi Sandeep, With SMS, there is no real difference between a reply to a message and a new message back to the sender. NowSMS makes it real easy to send a reply, where you can just return the reply text as the command response. But if you have special needs, such as a custom DCS value, then instead of returning the reply in the command , from your 2-way command script, make a new HTTP connection to the NowSMS server and submit the message with the parameters that you require (e.g., add &DCS=10 to the URL string). If you’re working with PHP, you could use our SendSMS script at http://www.nowsms.com/doc/submitting-sms-messages/send-sms-text-message-with-php … just modify the part that builds the URL request to include the DCS value. To clarify, I'm suggesting you change: fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . " HTTP/1.0\n"); to: fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&DCS=10&Text=" . rawurlencode($msgText) . " HTTP/1.0\n"); Or, you could easily modify the function so that the DCS value is passed as a parameter. -- Des NowSMS Support | |||
Sandeepp New member Username: Sandeepp Post Number: 2 Registered: 06-2015 |
Hi Des, Thank you for the reply, but I do not understand. Right now our PHP script for 2-way uses the echo command to send a reply. I do not understand how I would uses this SendSMS script instead. Thanks and Regards, Sandeep | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5339 Registered: 08-2008 |
Hi Sandeep, Let's say you have a 2-way command configured to call http://server/2way.php?sender=@@SENDER@@&text=@@FULLSMS@@ Here's a simple example where we extract the sender from the URL parameters, and use the SendSMS function to send a reply back to that sender. <?php header ("Content-Type: text/plain"); if (isset($_REQUEST['sender'])) { SendSMS("127.0.0.1", 8800, "username", "password", $_REQUEST['sender'], "Test Reply"); } else { echo "ERROR : 'sender' parameter missing!\r\n"; } ?> 127.0.0.1 and 8800 are the IP address and port number of the NowSMS server. Username/password are account credentials for an account defined under "SMS Users" Because we are generating a new message instead of a reply, change the 2-way command definition to uncheck "Command returns response text" or "Reply to sender with command output". (There is different wording for this option in different versions of NowSMS. -- Des NowSMS Support P.S. - Don't forget to include the SendSMS function in your PHP script. Immediately after the <?php would be my suggestion. And don't forget to modify it to add &DCS=10 for the flash SMS message class to be added. | |||
Chala Tumelo New member Username: Tumelo Post Number: 7 Registered: 01-2013 |
Hi Des, some time in 2009 a user was advised that to avoid 2-way responses queuing at the bottom of a pending queue is to enable seperate outbound queues for different user accounts. That is clear enough, but I need a means of priorizing 2-way responses from the same user. Such is my need that an account is sending out an announcement to which receipients may reply and get a reply via 2-wy. As it is, since the initial announcement and the 2 way reply are from the same user.... the 2-way reply is going to the bottom. What do we do? As you can see it is terribly inefficient to send the two-way response only after three hours of being requested for because of the queue. I suppose there is something I must learn here. | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5671 Registered: 08-2008 |
Hi Chala, Are you using PHP and submitting the reply using SendSMS, like in the earlier messages on this thread? If yes, create a separate SMS user account and use it for more urgent messages. -- Des NowSMS Support | |||
Chala Tumelo New member Username: Tumelo Post Number: 8 Registered: 01-2013 |
Hi Des, I am using vbScript. | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5681 Registered: 08-2008 |
Unfortunately, I do not have a VBScript example to send an SMS. But the basic approach to submit from a user account is to build a URL string and then connect to the URL. The URL format for simple text messages is described here: http://www.nowsms.com/doc/submitting-sms-messages/sending-sms-text-messages -- Des NowSMS Support |