# What this PR does Added support for [Exotel](https://exotel.com/) call provider. Features: - Sending verification code through SMS - Making test call - Making notification call ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
45 lines
977 B
Python
45 lines
977 B
Python
from django.db import models
|
|
|
|
from apps.phone_notifications.phone_provider import ProviderPhoneCall
|
|
|
|
|
|
class ExotelCallStatuses:
|
|
QUEUED = 10
|
|
IN_PROGRESS = 20
|
|
COMPLETED = 30
|
|
FAILED = 40
|
|
BUSY = 50
|
|
NO_ANSWER = 60
|
|
|
|
CHOICES = (
|
|
(QUEUED, "queued"),
|
|
(IN_PROGRESS, "in-progress"),
|
|
(COMPLETED, "completed"),
|
|
(FAILED, "failed"),
|
|
(BUSY, "busy"),
|
|
(NO_ANSWER, "no-answer"),
|
|
)
|
|
|
|
DETERMINANT = {
|
|
"queued": QUEUED,
|
|
"in-progress": IN_PROGRESS,
|
|
"completed": COMPLETED,
|
|
"failed": FAILED,
|
|
"busy": BUSY,
|
|
"no-answer": NO_ANSWER,
|
|
}
|
|
|
|
|
|
class ExotelPhoneCall(ProviderPhoneCall, models.Model):
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
status = models.PositiveSmallIntegerField(
|
|
blank=True,
|
|
null=True,
|
|
choices=ExotelCallStatuses.CHOICES,
|
|
)
|
|
|
|
call_id = models.CharField(
|
|
blank=True,
|
|
max_length=50,
|
|
)
|