A major milestone for the SMS Framework project is reliable and flexible support for incoming SMS messages. Tylor’s work on the SMS Receive module has kickstarted the effort and I believe we make a plan for the future of two-way support in the framework.
I have one idea: integrate with Actions. Administrators can define a series of "discriminators," or keywords that users put at the beginning of their message to tell the system what the message should do. Any data that follows the discriminator will be parameters for the action. Think of a discriminator as the command and the rest of the message as the options. Here’s the text from a hypothetical SMS message:
publish 56
"publish" would be the discriminator and "56" would be the option (the nid in this case). Additional options could be added separated by spaces.
Each discriminator will be turned into a trigger and could potentially have several actions assigned to it. When a message is received, the discriminator is identified and the actions that are assigned to it are triggered. So following the example message above, we would define the "publish" discriminator and have it trigger the publish action. This would set the status of node 56 to published.
I currently have a early version of this code working. It’s is capable of the previous example.
The current issue I'm facing with this design is the lack of a "create node" action. There are no actions (that I know of) that can create a brand new node, so we'd be stuck altering existing node via SMS unless we wanted to write it.
Any feedback?

Comments
Not sure if you have seen
Not sure if you have seen it, mailhandler module calls these Commands and has had them for 6 years now. Anyway, a system like this makes sense.
Mailhandler
Look at mailhandler. Moshe might want to collaborate on some abstraction, to use the same set of tokens / codes to support various "Actions" in Drupal. Mailhandler creates new nodes, and we're doing with SMS receive today, so this shouldn't be a problem.
So, this helper module might be something like "Remote Actions" -- future versions of mailhandler could depend on it, and it could be extensible via a hook so people could expand the "vocabulary" available.
Also, it's more than just discriminators. We're using the # / hashtags to signify special keywords, which in and of themselves have logic attached. e.g. some options would be "support hashtags for group routing" and/or "support hashtags for taxonomy terms".
But yes, an actions tie in is likely the right way to go.
Remote Actions++
I've done some work on integrating drupal with AIM and Jabber mediated by the Services module such that with appropriate authentication users could send commands (exposed services methods) to a Drupal instance. Having a concise set of commands that I could hook into and build upon would really extend the utility what I'm working on.
I have also been working on
I have also been working on this (albeit quietly) for some projects we are doing at the MIT Mobile Experience Lab. My modifications are working and will be put to a live user test here in a few weeks.
I merged some of the SMS Receive module into the SMS core and then I implemented a hook_sms_action() which allows for modules to register their custom action keywords and callback functions, very similarly to how a custom Services module registers service methods in Services.module. I blogged a bit more explanation and an example usage just today.
I'm working now with MIT to figure out what exactly our next steps here are so that I can share my actual code (I've only been here a short time but it appears that there may be some extra process to go through to get the OK to release under GPL), but for now I thought it'd be good to say that I, too, am working in this area.
B.McMurray
B.McMurray
Wow happy to know that, keep
Wow happy to know that, keep it up, you're great man. More power
Thanks for the feedback.
Thanks for the feedback. I'll look at the mailhandler module. I like the idea of abstracting some of this into a separate module, but I'm wondering if it really makes sense as SMS commands and mailhandler commands won't be so similar. Mail message have a subject and body while SMS messages only have a short body that must be put under some pretty complex parsing logic.
I also like the idea of allowing symbols to identify specific variables in commands, as this avoids having to memorize a certain order for options. Parsing the proper variables out incoming message might be the biggest challenge, especially if we want admins to be able to configure completely custom commands.
I'd like to post what I have done so far in terms of Action integration and see if we can start a conversation around that. I think that this route will ultimately be the most flexible solution. My only worry is that there currently seems to be a shortage of actions out there. I understand that it's a new module but I'd like to be sure that there is going to be enough actions to trigger to make this worth it :)
I'll provide a link for a public sandbox once I have it up.
Thanks again for the feedback!
--
Will White
--
Will White
here in the Philippines we
here in the Philippines we are more conversant in the "keywords" as command to do something like "register", "accept", "read", "deny", etc.
I think symbols will be suited for special task [I don't know] maybe offline drupal admin trying to tweak and fix some drupal site offline but for the end user the keyword is currently acceptable here in the Philippines, I really don't know with other country. Just my opinion.
In rummble.com they already implemented it:
COMMANDS >> ACTIONS
nickname sex age sexuality >> To signup from a mobile
POSTCODE >> Set your location (postcode)
go PLACENAME COUNTRY >> Set your location to a town
'#(SPACE)Eating [as an example]' >> Set your Status
friend theirmobilenumber >> Add a friend to your network
username message >> Message another Rummble user
username? >> Get info & photo of a user sent to u
block username / unblock >> Blocks a user from texting you
hide / unhide >> Hides your online profile
quiet / unquiet >> To not receive messages
help >> Send for help on your mobile
But in general this is great, this awesome, this is cool. Good luck guys. I wonder how can I be at help, just new here.
New Code Added to HEAD
I've added my work on this to HEAD. The new module is called sms_actions. Here's a quick way to try it out:
sms_incoming('5555555555', 'demote [nid of a node on your site]');
I've added some API documentation about this. Let me know how it goes. Thanks!
--
Will White
--
Will White
sms_actions permission
I can't seem to find the permissions for the sms_actions, so currently I need to login as the first user to see it. Is this a bug?
Russell JVM Gutierrez
Manager, Hong Kong Projects
flippingNORMALS
Web | Social Media | Mobile
Russell JVM Gutierrez