Skip to content

Commit 9a689f2

Browse files
committed
fix dial format bug
1 parent 24a7e73 commit 9a689f2

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Release 3.9.1
2+
- Fix a bug with SIP options in the `Opentok.dial` method
3+
14
# Release v3.9.0
25
- Add `publisher_only` role that can be specified when generating a token.
36

opentok/opentok.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,8 +1253,11 @@ def dial(self, session_id, token, sip_uri, options={}):
12531253
Note: Your response will have a different: id, connectionId and streamId
12541254
"""
12551255

1256-
payload = {"sessionId": session_id, "token": token, "sip": {"uri": sip_uri}}
1257-
payload.update(options)
1256+
payload = {
1257+
"sessionId": session_id,
1258+
"token": token,
1259+
"sip": {"uri": sip_uri, **options},
1260+
}
12581261

12591262
endpoint = self.endpoints.dial_url()
12601263

tests/test_sip_call.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,5 @@ def test_sip_call_with_aditional_options(self):
124124
)
125125
expect(sip_call_response).to(have_property(u("streamId"), sip_call.streamId))
126126
assert (
127-
b'"streams": ["stream-id-1", "stream-id-2"]}'
128-
in httpretty.last_request().body
127+
b'"streams": ["stream-id-1", "stream-id-2"]}' in httpretty.last_request().body
129128
)

0 commit comments

Comments
 (0)