Sha256: d2d32209b8f2d51f8c6594c25fb43ac38a4440f8a42bd7587f218d9d39e212b3

Contents?: true

Size: 721 Bytes

Versions: 15

Compression:

Stored size: 721 Bytes

Contents

# web_rtc_transfer.rb
#
# Custom transfer BXML for WebRtc
#
# @copyright Bandwidth INC

module Bandwidth
  module WebRtc
    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

    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
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bandwidth-sdk-10.5.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-10.4.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-10.3.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-10.2.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-10.1.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-10.0.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.4.1 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.4.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.3.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.2.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.1.2 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.1.1 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.1.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-9.0.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
bandwidth-sdk-8.0.0 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb