mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-04 10:52:17 +02:00
feat: Enable telephony for OSS (#21)
* fix: fix tooltip bug * feat: add Twilio with CloudFlare configuration * chore: update Tella Video
This commit is contained in:
parent
d39a8111a6
commit
8e2e5c9327
21 changed files with 891 additions and 191 deletions
|
|
@ -16,15 +16,11 @@ class CampaignCallDispatcher:
|
|||
"""Manages rate-limited and concurrent-limited call dispatching"""
|
||||
|
||||
def __init__(self):
|
||||
self._twilio_service = None
|
||||
self.default_concurrent_limit = 20
|
||||
|
||||
@property
|
||||
def twilio_service(self):
|
||||
"""Lazy initialization of TwilioService"""
|
||||
if self._twilio_service is None:
|
||||
self._twilio_service = TwilioService()
|
||||
return self._twilio_service
|
||||
def get_twilio_service(self, organization_id: int) -> TwilioService:
|
||||
"""Get TwilioService instance for specific organization"""
|
||||
return TwilioService(organization_id)
|
||||
|
||||
async def get_org_concurrent_limit(self, organization_id: int) -> int:
|
||||
"""Get the concurrent call limit for an organization."""
|
||||
|
|
@ -225,15 +221,16 @@ class CampaignCallDispatcher:
|
|||
|
||||
# Initiate call via Twilio
|
||||
try:
|
||||
call_result = await self.twilio_service.initiate_call(
|
||||
twilio_service = self.get_twilio_service(campaign.organization_id)
|
||||
call_result = await twilio_service.initiate_call(
|
||||
to_number=phone_number,
|
||||
workflow_run_id=workflow_run.id,
|
||||
organization_id=campaign.organization_id,
|
||||
url_args={
|
||||
"workflow_id": campaign.workflow_id,
|
||||
"user_id": campaign.created_by,
|
||||
"workflow_run_id": workflow_run.id,
|
||||
"campaign_id": campaign.id,
|
||||
"organization_id": campaign.organization_id,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue