feat: agent stream for cloudonix OPBX (#261)

* feat: agent stream for cloudonix OPBX

* feat: make cloudonix app name optional

* feat: create application while configuring telephony config

* fix: get telephony configuration from stamped workflow run

* fix: fix vobiz hangup URL
This commit is contained in:
Abhishek 2026-05-02 15:53:58 +05:30 committed by GitHub
parent 5cfdbeff02
commit 7fd3b96470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 1529 additions and 545 deletions

View file

@ -262,19 +262,6 @@ class TelephonyProvider(ABC):
"""
pass
@abstractmethod
def normalize_phone_number(self, phone_number: str) -> str:
"""
Normalize a phone number to E.164 format for this provider.
Args:
phone_number: Raw phone number from webhook
Returns:
Phone number in E.164 format (+country_code_number)
"""
pass
@abstractmethod
async def verify_inbound_signature(
self,
@ -336,6 +323,28 @@ class TelephonyProvider(ABC):
"""
pass
async def handle_external_websocket(
self,
websocket: "WebSocket",
*,
organization_id: int,
workflow_id: int,
user_id: int,
workflow_run_id: int,
params: Dict[str, str],
) -> None:
"""Handle the agent-stream WebSocket where credentials are passed inline.
Used by ``/api/v1/agent-stream/{workflow_uuid}`` when the caller carries
provider credentials in the query string (no stored
``TelephonyConfigurationModel`` row required). ``organization_id`` is
passed so providers can scope any config lookups to the workflow's
org. Default raises so providers that haven't opted in fail loudly.
"""
raise NotImplementedError(
f"Agent-stream not supported for provider {self.PROVIDER_NAME}"
)
async def configure_inbound(
self, address: str, webhook_url: Optional[str]
) -> ProviderSyncResult: