Class: OpenTok::Sip
- Inherits:
-
Object
- Object
- OpenTok::Sip
- Defined in:
- lib/opentok/sip.rb
Instance Method Summary collapse
-
#dial(session_id, token, sip_uri, opts) ⇒ Object
Dials a SIP gateway to input an audio-only stream into your OpenTok session.
-
#initialize(client) ⇒ Sip
constructor
A new instance of Sip.
-
#play_dtmf_to_connection(session_id, connection_id, dtmf_digits) ⇒ Object
Sends DTMF digits to a specific client connected to an OpnTok session.
-
#play_dtmf_to_session(session_id, dtmf_digits) ⇒ Object
Sends DTMF digits to all clients connected to an OpnTok session.
Constructor Details
#initialize(client) ⇒ Sip
Returns a new instance of Sip.
76 77 78 |
# File 'lib/opentok/sip.rb', line 76 def initialize(client) @client = client end |
Instance Method Details
#dial(session_id, token, sip_uri, opts) ⇒ Object
Dials a SIP gateway to input an audio-only stream into your OpenTok session. See the / OpenTok SIP developer guide.
50 51 52 |
# File 'lib/opentok/sip.rb', line 50 def dial(session_id, token, sip_uri, opts) response = @client.dial(session_id, token, sip_uri, opts) end |
#play_dtmf_to_connection(session_id, connection_id, dtmf_digits) ⇒ Object
Sends DTMF digits to a specific client connected to an OpnTok session.
the DTMF signal is being sent to. A p indicates a pause of 500ms (if you need to add a delay in sending the digits).
61 62 63 64 |
# File 'lib/opentok/sip.rb', line 61 def play_dtmf_to_connection(session_id, connection_id, dtmf_digits) raise ArgumentError, "invalid DTMF digits" unless dtmf_digits_valid?(dtmf_digits) response = @client.play_dtmf_to_connection(session_id, connection_id, dtmf_digits) end |
#play_dtmf_to_session(session_id, dtmf_digits) ⇒ Object
Sends DTMF digits to all clients connected to an OpnTok session.
A p indicates a pause of 500ms (if you need to add a delay in sending the digits).
71 72 73 74 |
# File 'lib/opentok/sip.rb', line 71 def play_dtmf_to_session(session_id, dtmf_digits) raise ArgumentError, "invalid DTMF digits" unless dtmf_digits_valid?(dtmf_digits) response = @client.play_dtmf_to_session(session_id, dtmf_digits) end |