Skip to content
scottyaz edited this page Apr 8, 2013 · 2 revisions

This is the WIKI for the bangpharma application which collects daily sales data from pharmacies. At the moment, this system is very simple and only asks one question per call.

Basic Use Cases

Pharmacy Initiated Call (IVR)

  1. Enrolled pharmacy flashes phone sitting at icddr,b office (local bangladesh number)

  2. Upon receiving a missed call, the application Tasker sends an http request to bangpharma with the missed call number

  3. Bangpharma then initiates a call back to the pharmacy (via Twillio)

  4. Data from the call is sent back to and stored in bangpharma database

http://andrewazman.com/bpharma_images/usecase_1.png

Server Initiated Call (IVR)

When we have no recorded sales data from a pharmacy within $max_lag hours bangpharma will initiate a call to one of the numbers from that pharmacy (TO DO: link to section on how phone number is chosen).

  1. Call initiated by bangpharma to pharmacy user
  2. Pharmacy user enters data and it is sent back and stored in bangpharma database

http://andrewazman.com/bpharma_images/usecase_2.png

SMS interaction for Study Staff

Study staff will register new pharmacies in the field. They will use SMS to provide the primary contact number for the pharmacy and the primary contact name.

  1. Study staff sends an sms "register " to +88xxxxxx (the phone at icddr,b)
  2. The phone at icddr,b will forward the sms to bangpharma
  3. the sms form will be checked and if it seems correct it will be logged in the database.
  4. Upon successful receipt of the name and number, bangpharma will send a confirmation along with the pharmacy id number. With the pharmacy id number, the pharmacy can now use the system and register new numbers by calling themselves.

http://andrewazman.com/bpharma_images/usecase_3_v2.png

SMS Interaction for Pharmacies

TO DO:

Tasker Setup and Trouble Shooting

The cellphone at icddr,b uses a program called tasker to pass incoming calls and texts to bangpharma. Tasker should be set up on the phone but in case it needs to be re-setup, the following section includes all the neccesary details.

Tasker Setup

  1. Tasker should be on the phone but in case it is not it can be downloaded through google play. You may need to sign on to the google account (ADD account details here) to download tasker.

  2. After installing.....

  3. Go to the TASK tab

  4. Create new task with + button

  5. Set the name to Incoming SMS

  6. (+) button -> Net button -> HTTP Post

  7. Use the following settings:

    • Server:Port -> my_domain/bangpharma

    • Path -> new_sms

    • Data / File -> sender=%SMSRF text=%SMSRB

    • Timeout -> 20 seconds

  8. Click the check mark to save this task

  9. Now create another task called Incoming Call (using the + button)

    • button -> Net button -> HTTP Get
  10. Use the following settings:

  • Server:Port -> my_domain/bangpharma

  • Path -> make_call/%CNUM/1

  • Timeout -> 20

  1. Click the check mark to save this task

  2. Now go to the Profiles tab and create a new profile (using the + button)

  3. New Profile Name -> Missed Call

  4. Select Event -> Phone -> Missed Call

  5. Do not enter anything in the Caller field and press the check button

  6. Task Selection -> Incoming Call

  7. Now the profile for missed calls is set up. Next we will set up the profile for incoming SMS messages in a similar manner.

  8. Press the + button from the Profiles tab

  9. Profile Name -> Receive SMS

  10. Select Event -> Phone -> Received Text

  11. Do not enter anything any field and press the check mark

  12. Task Selection -> Incoming SMS

  13. Now your profiles and tasks are set up

  14. Now you can press the On button in the bottom right corner to turn tasker profiles on (green indicates that it is on)

  15. You should see the tasker logo on the top menu bar when active

  16. You can now exit the program by pressing the home button

Tasker Troubleshooting

Problem: Tasker not forwarding calls or messages

Solution: First try turning tasker off then restarting. If this doesn't work try resetting the phone. Remember tasker is off, pharmacies cannot interact with bangpharma so try to do this quickly.

System Errors

  • error codes
    • 1 --> failed during /how_many_ors
    • 2 --> failed during /verify_ors
    • 7 --> fallback error (general)

How are emails sent out

We are using mailgun to send emails. At the moment we only have 200 free emails a day so we need to be careful and monitor this.

SMS functional details

TO DO: describe how sms conversations are tracked