dimagi/commcare-hq — pull request #2214 by gcapalbo (2014-01-07 06:18:02+00:00)
Title: SMS Queue

A single, central location for processing all incoming and outgoing sms. Features include:

- Ability to restrict sending sms to certain days of the week / times of day
- Processing inbound sms for a single contact one at a time
- Retrying to send an outbound sms a certain number times before giving up
- Ability to prevent automated messages from interfering with sms chat conversations
- Ability to ignore stale messages

Architecturally, it's split into two parts:

1) The run_sms_queue management command, which polls the sms/queued_sms couch view and spawns celery tasks in the celery "sms_queue" queue for each sms to be processed.

2) The celery "sms_queue" queue, where each task processes the sms it was given.