Skip to content

Commit

Permalink
feat(Voice): additional conference call method
Browse files Browse the repository at this point in the history
  • Loading branch information
650elx committed Mar 13, 2024
1 parent 082d2ba commit 7d8fb98
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
36 changes: 36 additions & 0 deletions sinch/domains/voice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,42 @@ class Conferences:
def __init__(self, sinch):
self._sinch = sinch

def call(
self,
destination: Destination,
conference_id: str,
cli: str = None,
conference_dtmf_options: ConferenceDTMFOptions = None,
dtmf: str = None,
conference: str = None,
max_duration: int = None,
enable_ace: bool = None,
enable_dice: bool = None,
enable_pie: bool = None,
locale: str = None,
greeting: str = None,
moh_class: str = None,
custom: str = None,
domain: str = None
) -> VoiceCalloutResponse:
return self._sinch.voice.callouts.conference(
destination=destination,
conference_id=conference_id,
cli=cli,
conference_dtmf_options=conference_dtmf_options,
dtmf=dtmf,
conference=conference,
max_duration=max_duration,
enable_ace=enable_ace,
enable_dice=enable_dice,
enable_pie=enable_pie,
locale=locale,
greeting=greeting,
moh_class=moh_class,
custom=custom,
domain=domain
)

def get(self, conference_id: str) -> GetVoiceConferenceResponse:
return self._sinch.configuration.transport.request(
GetConferenceEndpoint(
Expand Down
37 changes: 37 additions & 0 deletions tests/e2e/voice/conferences/test_call_conference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from sinch.domains.voice.models.callouts.responses import VoiceCalloutResponse


def test_conference_call(
sinch_client_sync,
phone_number,
voice_origin_phone_number,
conference_id
):
conference_callout_response = sinch_client_sync.voice.conferences.call(
conference_id=conference_id,
destination={
"type": "number",
"endpoint": phone_number
},
locale="en-US",
cli=voice_origin_phone_number
)
assert isinstance(conference_callout_response, VoiceCalloutResponse)


async def test_conference_call_async(
sinch_client_async,
phone_number,
voice_origin_phone_number,
conference_id
):
conference_callout_response = await sinch_client_async.voice.conferences.call(
conference_id=conference_id,
destination={
"type": "number",
"endpoint": phone_number
},
locale="en-US",
cli=voice_origin_phone_number
)
assert isinstance(conference_callout_response, VoiceCalloutResponse)

0 comments on commit 7d8fb98

Please sign in to comment.