-
Notifications
You must be signed in to change notification settings - Fork 5
AOMessageRouting
These are the steps ran when a message is being delivered by an application through Nuntium:
- If the message is SMS:
- Save the API and API Messages to the MobileNumbersTable.
- Run the AttributeInference, if "country" and/or "carrier" are still unknown.
- Run the Rules specified in the application that sent the message.
- Channels out the possible channels for delivering the message.
- Channels the message through any of the resulting channels.
- Run the Rules specified in that resulting channel.
Add an AO rules to your application by selecting 'Add Condition' and 'Add Action' in the application edit or new page.
The following example routes messages from the country code 855 (Cambodia) with the format 85510xxxxx or 85569xxxxx to the 'smart' channel, messages from the country code 1 (USA/Canada) or (44) UK to the 'twilio' channel and all others to the 'qst' channel.
Condition Field | Condition Type | Condition Value | Action Field | Action Value | Stop |
---|---|---|---|---|---|
To | Regexp | sms://855(?:10|69)\d+ | suggested_channel | smart | checked |
To | Regexp | sms://(?:1|44)\d+ | suggested_channel | twilio | checked |
To | Regexp | sms://\d+ | suggested_channel | qst | checked |
Note that the stop means "stop executing rules after this one if this rules matches" so you in the example above you would need the check them all so prevent it falling through to qst everytime since this is the most general match. Also note that you need to add a new 'rule' for each case and not a new condition an ad action.