RapidSMS Developers Guide/Running RapidSMS

From Wikibooks, open books for an open world
< RapidSMS Developers Guide
Jump to: navigation, search

Once you have completed the creation of your Personal Repository, running RapidSMS is easy.

Tweak your local.ini file[edit]

As explained before, local.ini is the RapidSMS configuration file.

Edit it to change the behavior of RapidSMS and ensure it will run:

  • change the order of items in apps= as this is the order in which every message is passed to every apps.
  • change the list of backends in backends=. Router will fail if you name gsm backend but have no modem attached for example.
  • verify the list of apps and their dependencies. httptester for example requires webapp.
  • make sure you are sending the logs to a file as looking at the logs is the main troubleshooting method.

Start the router[edit]

RapidSMS router is the main component of RapidSMS. Its process will start all the configured backends and apps.

Backends will then start to loop over their resources and send Message objects to the router as those are received.

When a message is received, the router will call each app for them to handle it.

Start the router:

./rapidsms route

The router outputs messages depending on the configuration of the log level. The same output is written to the log file, should this one be configured.

Start the web server[edit]

The web-server (Django's) is optional but most of the time is wanted. It ensures that apps with a web interface are accessible, such as the Django admin and the Message logger.

Start the web server:

./rapidsms runserver IP:PORT

Replace IP with your local IP to which restrict access to that webserver and the port on which it will respond to requests.

By default (if you omit IP and PORT), rapidsms will use 127.0.0.1:8000'.

If you want to use default HTTP port on all interfaces, use:

sudo ./rapidsms runserver 0.0.0.0:80

Note that you need to have super user privileges to use ports below 1024.

Personal Repository · Creating a RapidSMS App