SMS Handler: Step by step example

This page contains changes which are not marked for translation.

Other languages:
English • ‎Bahasa Indonesia

1) Plan the message

  • What data are you trying to collect?
  • Why?
  • Who are the stakeholders?
    • Who will provide the data?
      • What information do they have?
      • Can they generate the data reliably?
      • What is the cost of generating and reporting the data?
      • What benefits will they get?
    • Who will use the data?
      • What do they need?
      • How long will they need the data to be collected? One off or ongoing?
  • Exactly what data items should be collected

2) Design the database table

  • Will the data be stored in existing tables or do we need new tables?
  • What should the table design be
  • Create the tables if necessary
    • This currently requires Admin access to the database. Check with Priyono.

3) Design the SMS message

  • What will the start code be?
  • What fields will be collected?
  • What is the type of each field?
  • Are there any optional fields?
  • Are there any repeating groups?

4) Set up the SMS message metadata

  • Go to Edit SMS message, under SMS metadata in the Administration menu
  • Create a new SMS message record
    • For the reply (and any possible alert messages) put in a temporary placeholder SQL (e.g. "select 'Thank you'")
  • Go to Edit SMS Fields
  • Add and configure each of the fields

5) Set up the translation strings

  • Go to Admin | Interface |translation table
  • Add new strings for each of the error messages
  • Add new strings for the reply and alert messages (if required)

6) Build the message handler

  • Go to Admin | SMS metadata | Create SMS handler
  • Select the new message from the list and click submit
  • Check any errors carefully. They are usually to do with invalid lookup SQL for specific fields. Proceed if there are no errors, otherwise correct the problems and retry

7) Test the message

  • Using IM test the message
  • First send just the message start code to check that the format message is correct
  • Then send some correct data
  • Then send some incorrect data testing each of the validation steps

8) Finish the reply and alert messages

  • Now there is some test data, it is easier to compose the SQL for the reply message.
  • Build the SQL in PgAdmin first to make sure that it works
  • The copy it into the SMS message definition.
    • Replace any hard coded user ID values with the predefined variable sms_userid
    • Replace any hard coded message ID values with sms_msgid
  • Save, re-create the handler, and test again

9) Set up any required custom business rules

See the section on Business Rules.

10) Create output reports

Create new reports to display, summarise and analyse the data that is now able to be captured.