Skip to content

Commit

Permalink
Merge pull request #227 from opentok/devx-5649-add-sip-video-outbound…
Browse files Browse the repository at this point in the history
…-flag

DEVX-5649 Add SIP Video Outbound flag
  • Loading branch information
pardel committed Oct 20, 2021
2 parents bd985d5 + 0d41782 commit 1b8d286
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 8 additions & 2 deletions lib/opentok/sip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Sip
# "password" => sip_password },
# "headers" => { "X-KEY1" => "value1",
# "X-KEY1" => "value2" },
# "secure" => "true"
# "secure" => "true",
# "video" => "true"
# }
# response = opentok.sip.dial(session_id, token, "sip:+15128675309@acme.pstn.example.com;transport=tls", opts)
# @param [String] session_id The session ID corresponding to the session to which
Expand All @@ -33,8 +34,13 @@ class Sip
# @option opts [Hash] :auth This object contains the username and password
# to be used in the the SIP INVITE​ request for HTTP digest authentication,
# if it is required by your SIP platform.
# @option opts [true, false] :secure Wether the media must be transmitted
# @option opts [true, false] :secure Whether the media must be transmitted
# encrypted (​true​) or not (​false​, the default).
# @option opts [true, false] :video Whether the SIP call will include
# video (​true​) or not (​false​, the default). With video included, the SIP
# client's video is included in the OpenTok stream that is sent to the
# OpenTok session. The SIP client will receive a single composed video of
# the published streams in the OpenTok session.
def dial(session_id, token, sip_uri, opts)
response = @client.dial(session_id, token, sip_uri, opts)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/cassettes/OpenTok_Sip/receives_a_valid_response.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion spec/opentok/sip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
it "receives a valid response", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
opts = { "auth" => { "username" => sip_username,
"password" => sip_password },
"secure" => "true"
"secure" => "true",
"video" => "true"
}
response = sip.dial(session_id, expiring_token, sip_uri, opts)
expect(response).not_to be_nil
Expand Down

0 comments on commit 1b8d286

Please sign in to comment.