Skip to content

Add SIP Outbound video Flag and PlayDTMF function with API endpoints #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 29, 2021

Conversation

geekchick
Copy link
Contributor

Hi!

These changes are for the following JIRA tickets:

Add SIP Video Outbound flag to Python sDK: https://jira.vonage.com/browse/DEVX-5646
Add "Play DTMF" API to Python SDK: https://jira.vonage.com/browse/DEVX-5652

Copy link

@calthoff calthoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Tonya! Looks good! It is not clear to me (someone still familiarizing myself with this SDK) exactly what a "force mute action" is, though. Maybe consider adding a sentence clarifying what that means in the docstring?

@geekchick
Copy link
Contributor Author

Hey Tonya! Looks good! It is not clear to me (someone still familiarizing myself with this SDK) exactly what a "force mute action" is, though. Maybe consider adding a sentence clarifying what that means in the docstring?

Hi Cory! Ok, sounds good! Force Mute allows a moderator to force clients to mute their audio in streams they publish. So I can add something like that to elaborate on it.

@geekchick geekchick requested a review from calthoff July 28, 2021 20:19
will join

:param connection_id An optional parameter used to send the DTMF tones to a specific
connectoiin in a session.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: connection

@@ -1042,6 +1050,7 @@ def dial(self, session_id, token, sip_uri, options=[]):
"""
payload = {"sessionId": session_id, "token": token, "sip": {"uri": sip_uri}}
observeForceMute = False
Copy link

@calthoff calthoff Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why define observeForceMute and video flags? They don't seem to get used.

@@ -1447,3 +1460,41 @@ def mute(self, session_id: str, stream_id: str= "", options: dict = {}) -> reque
("There was an error thrown by the OpenTok SDK, please check that your session_id {0} and stream_id (if exists) {1} are valid").format(
session_id, stream_id))

def play_dtmf(self, session_id: str, connection_id: str, digits: str, options: dict = {}) -> requests.Response:
"""
Plays a DTMF string into a session or to a specific connection

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As someone new to this, I'm not clear what a DTMF string is or what it means to play a DTMF string.

try:
if not connection_id:
url = self.endpoints.get_dtmf_all_url(session_id)
payload = {"digits": digits}
Copy link

@calthoff calthoff Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why define payload twice if it is the same in either case?

@geekchick geekchick merged commit 6008329 into 3.x-beta Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants