Skip to content

Commit 6cf7bf8

Browse files
authored
DX-2100 webrtc generate transfer method (#26)
* DX-2100 webrtc generate transfer method * added missing include
1 parent 8bf0706 commit 6cf7bf8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

bandwidth.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'bandwidth-sdk'
3-
s.version = '7.0.0'
3+
s.version = '7.1.0'
44
s.summary = 'bandwidth'
55
s.description = 'Bandwidth\'s set of APIs'
66
s.authors = ['APIMatic SDK Generator']

lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
module Bandwidth
88
module WebRtc
99
def generate_bxml(device_token, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
10-
return '<?xml version="1.0" encoding="UTF-8"?><Response><Transfer><SipUri uui="%s;encoding=jwt">%s</SipUri></Transfer></Response>' % [device_token, sip_uri]
10+
return '<?xml version="1.0" encoding="UTF-8"?><Response>' + generate_transfer_bxml_verb(device_token, sip_uri) + '</Response>'
11+
end
12+
13+
def generate_transfer_bxml_verb(device_token, sip_uri="sip:sipx.webrtc.bandwidth.com:5060")
14+
return '<Transfer><SipUri uui="%s;encoding=jwt">%s</SipUri></Transfer>' % [device_token, sip_uri]
1115
end
1216
end
1317
end

test/integration/test_integration.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
include Bandwidth::Voice
1010
include Bandwidth::Messaging
1111
include Bandwidth::MultiFactorAuth
12+
include Bandwidth::WebRtc
1213

1314
begin
1415
USERNAME = ENV.fetch("USERNAME")
@@ -580,4 +581,16 @@ def test_tn_lookup
580581
get_response = @bandwidth_client.phone_number_lookup_client.client.get_lookup_request_status(ACCOUNT_ID, request_id)
581582
assert(get_response.data.status.length > 0, "status value not set")
582583
end
584+
585+
def test_webrtc_generate_bxml
586+
expected = '<?xml version="1.0" encoding="UTF-8"?><Response><Transfer><SipUri uui="asdf;encoding=jwt">sip:sipx.webrtc.bandwidth.com:5060</SipUri></Transfer></Response>'
587+
actual = Bandwidth::WebRtc.generate_bxml('asdf')
588+
assert_equal(expected, actual)
589+
end
590+
591+
def test_webrtc_generate_transfer_bxml_verb
592+
expected = '<Transfer><SipUri uui="asdf;encoding=jwt">sip:sipx.webrtc.bandwidth.com:5060</SipUri></Transfer>'
593+
actual = Bandwidth::WebRtc.generate_transfer_bxml_verb('asdf')
594+
assert_equal(expected, actual)
595+
end
583596
end

0 commit comments

Comments
 (0)