Module: Bandwidth::WebRtc

Defined in:
lib/bandwidth/web_rtc_lib/web_rtc/client.rb,
lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb,
lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb

Defined Under Namespace

Classes: APIController, Client

Instance Method Summary collapse

Instance Method Details

#generate_bxml(device_token, voice_call_id, sip_uri = "sip:sipx.webrtc.bandwidth.com:5060") ⇒ Object



9
10
11
# File 'lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb', line 9

def generate_bxml(device_token, voice_call_id, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
    return '<?xml version="1.0" encoding="UTF-8"?><Response>' + generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri) + '</Response>'
end

#generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri = "sip:sipx.webrtc.bandwidth.com:5060") ⇒ Object



13
14
15
16
# File 'lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb', line 13

def generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
    voice_call_id = voice_call_id.split("-", 2).last.split("-").join()
    return '<Transfer><SipUri uui="%s;encoding=base64,%s;encoding=jwt">%s</SipUri></Transfer>' % [voice_call_id, device_token, sip_uri]
end