mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
chore: refactor status processor (#465)
* chore: refactor status processor * fix: fix billing duration when billsec is None for Cloudonix
This commit is contained in:
parent
d817d50056
commit
29c5be298c
29 changed files with 910 additions and 809 deletions
28
api/enums.py
28
api/enums.py
|
|
@ -17,6 +17,32 @@ class CallType(Enum):
|
|||
OUTBOUND = "outbound"
|
||||
|
||||
|
||||
class TelephonyCallStatus(str, Enum):
|
||||
INITIATED = "initiated"
|
||||
RINGING = "ringing"
|
||||
IN_PROGRESS = "in-progress"
|
||||
ANSWERED = "answered"
|
||||
COMPLETED = "completed"
|
||||
FAILED = "failed"
|
||||
BUSY = "busy"
|
||||
NO_ANSWER = "no-answer"
|
||||
CANCELED = "canceled"
|
||||
ERROR = "error"
|
||||
|
||||
@classmethod
|
||||
def from_raw(cls, value: object) -> "TelephonyCallStatus | None":
|
||||
if isinstance(value, cls):
|
||||
return value
|
||||
|
||||
if value in (None, ""):
|
||||
return None
|
||||
|
||||
try:
|
||||
return cls(str(value).lower())
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
|
||||
class WorkflowRunMode(Enum):
|
||||
ARI = "ari"
|
||||
PLIVO = "plivo"
|
||||
|
|
@ -77,8 +103,6 @@ class WorkflowRunStatus(Enum):
|
|||
|
||||
|
||||
class OrganizationConfigurationKey(Enum):
|
||||
DISPOSITION_CODE_MAPPING = "DISPOSITION_CODE_MAPPING"
|
||||
DISPOSITION_MESSAGE_TEMPLATE = "DISPOSITION_MESSAGE_TEMPLATE"
|
||||
CONCURRENT_CALL_LIMIT = "CONCURRENT_CALL_LIMIT"
|
||||
TELEPHONY_CONFIGURATION = (
|
||||
"TELEPHONY_CONFIGURATION" # Stores all providers + active one
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue