FrontlineSMS let users send, receive and manage SMS over a mobile network.

Hello friends,
I am trying to learn about frontline sms external commands feature.
We want to use it to automatically export the sms database table to a csv file.
I also want to know if there is an additional manual that has examples of using this feature. We are in the requirements building stage of our project and are trying to understanding the potential of this feature.

Views: 2862

Replies are closed for this discussion.

Replies to This Discussion

Hi Gayatri

Thanks for the message - good to hear from you!

I'll give you my answer and let the developer team give you theirs! =)

The External Commands feature is single SMS-related, triggered by incoming messages. So when a message comes into FrontlineSMS with a specific keyword, you can tell the software to run an external command or program to do something with that message.

If you want to export the entire SMS database table to a CSV file then I guess you can write a separate program to do that, which will read the database directly. This could be run manually, by you, and wouldn't need to be automatically triggered by a keyword.

We haven't given any external command examples because, being an advanced feature, many users who need it will likely have the IT skills to figure it out for it themselves. Check out the Help section in FrontlineSMS for any further details (if you haven't already).

Let me know if that helps!

Thanks Ken,
Thing is there is no dedicated developer team in my NGO. I just joined 4 weeks ago as the MIS person, and am figuring it out after my coordinator downloaded frontline. One of us knows access, VB and I have worked as software eng in C++, Sybase, C shell scripting on UNIX.

I guess it is 'pretty much anything' that we could do with the database of course. But did not understand the 'response type' option 'Frontline SMS commands' . The help section has no info on that.

Also, The response type, Is it only for response from remote server for http requests? Or does it also return the status of running an executable that we type under 'command line execution'
Hi Ken,
I wrote a test program, to understand External commands functionality - it works beautifully! I can trigger an exe to write to a file on hard disk, and get back a reply to my cell phone with all the outputs to screen. thank you.
But I still could not figure out 'FrontlineSMS Commands' option in response type.
appreciate any pointers :)
Hi Gayatri,

This functionality is quite advanced, but since you were able to use external commands successfully, you must be an advanced user. :D

The idea is similar, if you select the 'FrontlineSMS Commands' option, FrontlineSMS will expect, as the output of the command, an XML format list of commands to be executed. Up to now, we only support a list of messages to be sent.

Here is an example of a list of commands in XML:

Frontline will read this XML output and send the first sms to the described number, to the contact "Ken Banks" (if the contact exists) and to the "Work" group (if exists). The second message will be sent only to Ken Banks, if the contact does not exist, that message won't be sent.

Let me know if you understood my explanation.
Hope this helps you to clarify your doubts.


PS: The XML file is attached as well. (Example.xml)
aaaah brilliant software!!!
It works it works :)) thank you so much Kadu for the info!

I tested it with my exe and a http url - that both produce xml output. Also, the exe can accept arguments that frontline sends and generate xml command with inputs given. That works fine.

Now we are testing url that can accept arguments from the frontline software like message text etc, and process it into the xml command generated. My web programmer has some questions for you -
1. Can we retrieve the sms reply from frontline to webpage?
2. If so, is it posted in URL so that we can get the values by $_Request in PHP?
3. What is the format the sms is sent - in URL or xml file or anything else?
Hi Gayatri,

I'm glad to hear that this feature works. You're probably the first user to test that.

Regarding your questions:

Yes you can retrieve reply messages from FrontlineSMS. You can see up an HTTP request using the reply message fields on the URL. So if you create your server to expect this kind of variables in the URL, you can set that up in FrontlineSMS. The fields you can include are:
- Sender number
- Sender name
- Message content
- Keyword (that triggered the action)
- The sms id

Hope that helps,

Keep us posted on how do you get on,

Hi Kadu,
I will get back to you regarding url php programming soon.

I noticed something while using external commands - When I have a keyword 'TEST', but I send sms 'Test', the keyword is triggered BUT the $message_content field includes the keyword also. Whereas if I send 'TEST', then frontline correctly sends only the message content leaving out the keyword. I tested it with my C++ exe with two keywords "Test" and "Ok" instead of TEST or OK. some issue with case sensitivity while parsing the whole sms text? as in, if Test is also considered same as TEST keyword, then message content should not contain 'Test'.
1.Also, with FrontlineSMS commands, when I automatically receive sms, I sometimes get '@' symbol at the end of message to my cell ph. This is not sent by the program kicked off,ie in the xml output to screen, neither is it displayed in the frontline user interface, in the sent messages, when I double click the message.
I am not able to reproduce this error consistently.

2.Another error I noticed - Response Type - either FronlineSMS command or Plain Text and Include response, when I have say a '?' in the output from program, it gets displayed as %3F, when the msg is automatically sent.
even though the program sends xml/output to screen as '?'
similarly, if it is "!" it gets displayed as %21
Dear all,

I also noticed a few issues in the soft:
1. I do have the same issue with keywords case sensitive:
keyword is included in "Messagebody" if I use "alert", and not included if I use "ALERT".
2. using autoforward functionality. I get sometimes an "@" at the end of the forwarded message. I did not identify yet in which cases I get this. I will try to identify when it happens.

Best regards
Hi Gayatri,

You are probably right about the issue with case sensitivity, we might have ignored the case to identify the keyword but not from removing the keyword from the message content.

Regarding the other issue you are facing, it is probably another bug that needs to be fixed. We do that for URL's, because URL don't allow some chars.

We'll add these two issues to our list and hopefully we will be releasing these fixes in the next version.

Thanks for your help testing our software,

Hi Kadu,
We are testing our dummy url manually, and it works with the following fields
It will give you an output:
FrontlineSMS - Trial



but when frontline kicks off the http request for this url ${sender_name} ${message_content}
with the same parameters, this is what is given as response (I select Response Type Plain Text, and Include $command_response )

FrontlineSMS - Trial

It is as though no inputs are given to the url. Ideally, we should get the name and message content also in the response. I think so if I understand it correctly. Let me know
Hi Gayatri,

In frontlineSMS you've got to have${sender_name}&message_content=${message_content}

Hope this helps.



© 2017   Created by FrontlineSMS Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service