Skip to content

Commit

Permalink
DX-2100 webrtc generate transfer method (#26)
Browse files Browse the repository at this point in the history
* DX-2100 webrtc generate transfer method

* added missing include
  • Loading branch information
jmulford-bw authored Jul 21, 2021
1 parent 8bf0706 commit 6cf7bf8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bandwidth.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'bandwidth-sdk'
s.version = '7.0.0'
s.version = '7.1.0'
s.summary = 'bandwidth'
s.description = 'Bandwidth\'s set of APIs'
s.authors = ['APIMatic SDK Generator']
Expand Down
6 changes: 5 additions & 1 deletion lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
module Bandwidth
module WebRtc
def generate_bxml(device_token, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
return '<?xml version="1.0" encoding="UTF-8"?><Response><Transfer><SipUri uui="%s;encoding=jwt">%s</SipUri></Transfer></Response>' % [device_token, sip_uri]
return '<?xml version="1.0" encoding="UTF-8"?><Response>' + generate_transfer_bxml_verb(device_token, sip_uri) + '</Response>'
end

def generate_transfer_bxml_verb(device_token, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
return '<Transfer><SipUri uui="%s;encoding=jwt">%s</SipUri></Transfer>' % [device_token, sip_uri]
end
end
end
13 changes: 13 additions & 0 deletions test/integration/test_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
include Bandwidth::Voice
include Bandwidth::Messaging
include Bandwidth::MultiFactorAuth
include Bandwidth::WebRtc

begin
USERNAME = ENV.fetch("USERNAME")
Expand Down Expand Up @@ -580,4 +581,16 @@ def test_tn_lookup
get_response = @bandwidth_client.phone_number_lookup_client.client.get_lookup_request_status(ACCOUNT_ID, request_id)
assert(get_response.data.status.length > 0, "status value not set")
end

def test_webrtc_generate_bxml
expected = '<?xml version="1.0" encoding="UTF-8"?><Response><Transfer><SipUri uui="asdf;encoding=jwt">sip:sipx.webrtc.bandwidth.com:5060</SipUri></Transfer></Response>'
actual = Bandwidth::WebRtc.generate_bxml('asdf')
assert_equal(expected, actual)
end

def test_webrtc_generate_transfer_bxml_verb
expected = '<Transfer><SipUri uui="asdf;encoding=jwt">sip:sipx.webrtc.bandwidth.com:5060</SipUri></Transfer>'
actual = Bandwidth::WebRtc.generate_transfer_bxml_verb('asdf')
assert_equal(expected, actual)
end
end

0 comments on commit 6cf7bf8

Please sign in to comment.