Feat/inbound telephony (#113)

* feat: inbound telephony (twilio & vobiz)

* chore: add ruff and lint formatting

* fix: add missing cloudonix interface compliance implementation
This commit is contained in:
Sabiha Khan 2026-01-12 10:10:30 +05:30 committed by GitHub
parent b79bc4221d
commit 97fbd9b37b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 1998 additions and 40 deletions

View file

@ -21,6 +21,7 @@ from sqlalchemy import (
from sqlalchemy.orm import declarative_base, relationship
from ..enums import (
CallType,
IntegrationAction,
ToolCategory,
ToolStatus,
@ -324,6 +325,12 @@ class WorkflowRunModel(Base):
Enum(*[mode.value for mode in WorkflowRunMode], name="workflow_run_mode"),
nullable=False,
)
call_type = Column(
Enum(*[call_type.value for call_type in CallType], name="workflow_call_type"),
nullable=False,
default=CallType.OUTBOUND.value,
server_default=text("'outbound'::workflow_call_type"),
)
state = Column(
Enum(*[state.value for state in WorkflowRunState], name="workflow_run_state"),
nullable=False,

View file

@ -14,7 +14,7 @@ from api.db.models import (
WorkflowModel,
WorkflowRunModel,
)
from api.enums import StorageBackend
from api.enums import CallType, StorageBackend
from api.schemas.workflow import WorkflowRunResponseSchema
@ -25,6 +25,7 @@ class WorkflowRunClient(BaseDBClient):
workflow_id: int,
mode: str,
user_id: int,
call_type: CallType = CallType.OUTBOUND,
initial_context: dict = None,
campaign_id: int = None,
queued_run_id: int = None,
@ -80,6 +81,7 @@ class WorkflowRunClient(BaseDBClient):
campaign_id=campaign_id,
queued_run_id=queued_run_id,
storage_backend=current_backend.value,
call_type=call_type.value,
)
session.add(new_run)
try:
@ -288,6 +290,7 @@ class WorkflowRunClient(BaseDBClient):
"definition_id": run.definition_id,
"initial_context": run.initial_context,
"gathered_context": run.gathered_context,
"call_type": run.call_type,
}
)
for run in result.scalars().all()