Way to bypass inbound message processor from the command line script?

Way to bypass inbound message processor from the command line script? SearchSearch
Author Message
marcia piccione
New member
Username: Mpiccione

Post Number: 3
Registered: 01-2012
Posted on Saturday, January 21, 2012 - 04:09 pm:   

Here is our problem:

We need to split a shortCode between 2 destinations (NowSms client accounts). What we were hoping to do was use the 2-way / command line callback feature to process all inbound messages and determine which account to send the sms to. So, essentially, we would have to receive the inbound message, evaluate the destination, and then resubmit it. Problem is, how do we get around endless looping with the inbound processor?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3735
Registered: 08-2008
Posted on Monday, January 23, 2012 - 10:40 pm:   

Hi Marcia,

This seems to be related to your other question:

http://support.nowsms.com/discus/messages/1/70765.html

Maybe not directly ... but basically the technique is similar.

Implement a 2-way command to process messages for this short code. Have the short code resubmit the message to the correct account by connecting back to NowSMS and appending the &LocalUser=xxxx parameter to indicate which account should receive the message.

--
Des
NowSMS Support
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3736
Registered: 08-2008
Posted on Wednesday, January 25, 2012 - 03:17 pm:   

Additional information submitted via e-mail:


quote:

We are trying to split a short code between 2 endpoints by using a command
line script in NowSMS for inbound text messages. I can run the command
line script standalone from the command line fine, but I don't know how to
get it to trigger from
an inbound request. Or is that not the case? Or, at least I don't see any
evidence of it triggering. I have also been unable to find an example of
what the syntaix looks like if you are passing more than 1 command line
argument into the script.




What type of command line script is it?

Does it involve a batch file? If it does, NowSMS needs to invoke a command processor first. Try the ECHO example in http://www.nowsms.com/doc/2-way-sms-support, and verify that you can make this work before moving on to your batch file. Once that is working, insert your batch file in place of echo in the example ... e.g., c:\windows\system32\cmd.exe /c c:\path\yourcmd @@SENDER@@ @@RECIP@@ @@FULLSMS@@

Is it VBScript or JScript? You need to include c:\windows\system32\cscript.exe in the 2-way command as NowSMS will not launch the command directly ... e.g., c:\windows\system32\cscript.exe c:\path\incall.vbs %@@SENDER@@ @@RECIP@@ @@FULLSMS@@

In either case, the best way to see what is happening when NowSMS tries to execute the 2-way command is to enable the SMSDEBUG.LOG. It will show how NowSMS is processing the message, and show the 2-way command that NowSMS is trying to execute, as well as the results.



quote:


I'm also unclear how you would resubmit the message to NowSMS for routing to
a specific local user without endless looping through the command line
interface (if it were actually triggering).




You submit it back to NowSMS via HTTP as a new message, like I described in that other thread.

So you don't have to follow the link, here is the relevant bit:


quote:

The standard NowSMS HTTP GET format is used (http://www.nowsms.com/doc/submitting-sms-messages/url-parameters)

For example:

http://server:port/?Sender=1234&PhoneNumber=5678&Text=text+of+message&InboundMes sage=Yes&LocalUser=accountname

The request also needs to include SMS user account credentials, either through an HTTP Basic Authorization header, or &User=username&Password=password in the HTTP GET.

We strongly recommend enabling the credit balance for the SMS User account that is used, and leave the credit balance at 0. This allows inbound messages, but disallows outbound messages.




If you're using the command line JScript from http://www.nowsms.com/sending-sms-from-command-line, just modify the part where it builds the URL for submitting to NowSMS so that it adds these extra variables to indicate that the message should be routed to one of the local user accounts instead of the 2-way command processor.

--
Des
NowSMS Support