oncall-engine/engine/apps/twilioapp/models
Michael Derynck ae7561a84f
Map country code to different Twilio resources (#1976)
Many countries are introducing different requirements for SMS senders to
register and/or use alpha numeric ids, short codes or regional numbers
or face being blocked. The changes in this PR will give us more
flexibility by allowing us to map to different resources in Twilio based
on the phone number we are trying to reach. For this first
implementation the selection is made based on country code of the
recipient. Verification and phone calls were given the same treatment
although the immediate need is for SMS. Senders with no country code set
can be used as catch-all defaults. This also falls back to the
configured live settings/environment variables if not configured.

Possible future additions:
- Move through list of trying multiple senders before failing
notification
- Easily expanded to allow per-organization or per-user resources to let
users and tenants configure their own Twilio
- Add UI + replace live settings so users can configure their own
settings
- More selection criteria if needed

TODO:

- [x] Add+Fix Tests
- [x] Verify changes are compatible with #1713
2023-05-25 21:56:44 +00:00
..
__init__.py Map country code to different Twilio resources (#1976) 2023-05-25 21:56:44 +00:00
twilio_log_record.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
twilio_phone_call.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
twilio_sender.py Map country code to different Twilio resources (#1976) 2023-05-25 21:56:44 +00:00
twilio_sms.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00