RapidSMS system cannot understand your message

29 views
Skip to first unread message

dannette opot

unread,
Mar 28, 2013, 7:36:11 AM3/28/13
to rapi...@googlegroups.com
Hi Everyone!


I have been able to setup my RapidSMS server to send and receive essages.I have started all the required services e.g.bearerbox, smsbox etc.
My problem is that the RapidSMS System returns the error: "Sorry, the RapidSMS system cannot understand your message", which is my default response.
 I have my App.py that should be doing the handling.This app has been included in the settings.py file.What might be the problem.Thanks guyz.

Regards,
Danet.

Tim Akinbo

unread,
Mar 28, 2013, 7:37:56 AM3/28/13
to RapidSMS
Is it App.py or app.py. Files in Python are case sensitive. So can you confirm that the filename is app.py and if after changing it, you still have problems, you can respond to this email.

Tim Akinbo


--
You received this message because you are subscribed to the Google Groups "rapidsms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapidsms+u...@googlegroups.com.
To post to this group, send email to rapi...@googlegroups.com.
Visit this group at http://groups.google.com/group/rapidsms?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

dannette opot

unread,
Mar 28, 2013, 7:44:40 AM3/28/13
to rapi...@googlegroups.com
Tim Akinbo >> the name is app.py - lowercase

Tim Akinbo

unread,
Mar 28, 2013, 7:50:40 AM3/28/13
to RapidSMS
Ok if that's the case, you need to ensure that you wrote your application according to the application structure here: http://rapidsms.readthedocs.org/en/latest/topics/applications/index.html

If that's so, can you paste your code on bpaste.com for app.py and provide the link so I can take a look.

Tim Akinbo

dannette opot

unread,
Mar 28, 2013, 8:00:25 AM3/28/13
to rapi...@googlegroups.com
Here is my code:

class App(AppBase):

    pattern = re.compile(r'^phone\s+',re.IGNORECASE)

    def start (self):
        """Configure your app in the start phase."""
        pass

    def _parse_message(self, message):
        parts = message.text.split()[1:] # exclude the keyword (e.g., "phone")
        #print parts;
        index = ''
        fname=''
        lname=''
        phonenumber=''
               
        if parts.__len__()==4:
            index=parts[0]
            fname=parts[1]
            lname=parts[2]
            phonenumber=parts[3]           
        return index, fname, lname, phonenumber

    def handle(self,message):
        response =message.text.lower()
        #keyword is valid
        if response.startswith('phone'):
            index, fname, lname, phonenumber = self._parse_message(message)
            AddressBook(
                index,
                fname,
                lname,
                phonenumber,
                datecreated=datetime.datetime.today()).save()
            message.respond("Thank you %s,you are registered!")
        else:
            message.respond("Wrong message format!")
    def cleanup (self, message):
        """Perform any clean up after all handlers have run in the
           cleanup phase."""
        pass

    def outgoing (self, message):
        """Handle outgoing message notifications."""
        pass

    def stop (self):
        """Perform global app cleanup when the application is stopped."""
        pass

Alioune Dia

unread,
Mar 28, 2013, 8:08:28 AM3/28/13
to rapi...@googlegroups.com
Hi

Yor message is mal formated , Perhaps , RapidSMS have some
problems to format it ?
message.respond("Thank you %s,you are registered!")
should be
message.respond("Thank you %s,you are registered!" % name)

—Ad

2013/3/28 dannette opot <dane...@gmail.com>:

Tim Akinbo

unread,
Mar 28, 2013, 9:12:07 AM3/28/13
to RapidSMS
Also, *this is a common mistake* you have to make sure you return True when you've handled a message if not, the message will be propagated to the RapidSMS default application which will generate that response.

After your message.respond invocation, make sure to add return True.

Cheers.

Tim Akinbo

Cory Zue

unread,
Mar 28, 2013, 9:23:28 AM3/28/13
to rapidsms
Also, I believe rapidsms still has each app process the message in the order they are defined in your settings, so another thing to check would be to make sure your app comes before the "default" app.

dannette opot

unread,
Mar 28, 2013, 2:34:43 PM3/28/13
to rapi...@googlegroups.com
Thanks guys.I include the return True statement after handling the message.The only simple error i have to worry about is wrong message format.This i will handle.

dannette opot

unread,
Apr 23, 2013, 8:21:22 AM4/23/13
to rapi...@googlegroups.com
How do you configure RapidSMS to send data via a web service?,i have some data in some table that i want to be sending to another system on a daily basis,and the only way to do this is via Web Service.Do we have a RapidSMS API to do this?
Reply all
Reply to author
Forward
0 new messages