Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[default]

exten => s,1,NoOp()
same => n,Answer()
same => n,Playback(silence/1&please-try-again&silence/3)
same => n,Hangup()

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
testinfo:
summary: 'Test getting/setting multiple bridge variables simultaneously via ARI.'
description: |
'Create a bridge. Set some bridge variables on the newly
created bridge. Then, get those bridge variables to ensure
everything worked as expected.'

test-modules:
test-object:
config-section: 'test-object-config'
typename: 'ari.AriBaseTestObject'
modules:
- config-section: 'pluggable-config'
typename: 'pluggable_modules.EventActionModule'

test-object-config:
apps: 'testsuite'
reactor-timeout: 15
stop-on-end: False

pluggable-config:
- ari-start:
ari-requests:
- method: 'post'
uri: 'channels/create'
params:
endpoint: 'Local/s@default'
app: 'testsuite'
channelId: 'channel1'
expect: 200
- method: 'post'
uri: 'bridges/bridge1'
body: {'variables': {'BRIDGESTATE': {'value': 'created', 'report_events': True }, 'BRIDGENOREPORT1': {'value': 'donotreport', 'report_events': False }}}
expect: 200

- ari-events:
match:
type: 'StasisStart'
application: 'testsuite'
channel:
id: 'channel1'
count: 1
ari-requests:
- method: 'post'
uri: 'bridges/bridge1/variables'
body: {'variables': {'TESTVAR1': 'test1', 'TESTVAR2 ': {'value': 'test2', 'report_events': True}, ' TESTVAR3': 'test3'}}
expect: 204
- method: 'get'
uri: 'bridges/bridge1/variables'
params:
variables: 'BRIDGESTATE, BRIDGENOREPORT1, TESTVAR1, TESTVAR2 ,TESTVAR3'
expect: 200
response_body:
match: {'variables': {'BRIDGESTATE': 'created', 'BRIDGENOREPORT1': 'donotreport', 'TESTVAR1': 'test1', 'TESTVAR2': 'test2', 'TESTVAR3': 'test3'}}
- method: 'post'
uri: 'bridges/bridge1/addChannel'
params:
channel: 'channel1'
expect: 204

- ari-events:
match:
type: 'ChannelEnteredBridge'
application: 'testsuite'
channel:
id: 'channel1'
bridge:
id: 'bridge1'
bridgevars:
BRIDGESTATE: 'created'
TESTVAR2: 'test2'
count: 1
ari-requests:
- method: 'delete'
uri: 'channels/channel1'
expect: 204

- ari-events:
match:
type: 'StasisEnd'
application: 'testsuite'
channel:
id: 'channel1'
count: 1
stop_test:

properties:
dependencies:
- python: 'autobahn.websocket'
- python: 'requests'
- python: 'twisted'
- python: 'starpy'
- asterisk: 'res_ari_channels'
tags:
- ARI
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[default]

exten => s,1,NoOp()
same => n,Answer()
same => n,Playback(silence/1&please-try-again&silence/3)
same => n,Hangup()

Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
testinfo:
summary: 'Test getting/setting a bridge variable via ARI.'
description: |
'Create a bridge. Set some bridge variables one at a time on the newly
created bridge. Then, get those bridge variables one at a time to ensure
everything worked as expected. Make sure that the variable set to
report events does so, and that the variable set to not report events does
not report events.'

test-modules:
test-object:
config-section: 'test-object-config'
typename: 'ari.AriBaseTestObject'
modules:
- config-section: 'pluggable-config'
typename: 'pluggable_modules.EventActionModule'

test-object-config:
apps: 'testsuite'
reactor-timeout: 15
stop-on-end: False

pluggable-config:
- ari-start:
ari-requests:
- method: 'post'
uri: 'channels/create'
params:
endpoint: 'Local/s@default'
app: 'testsuite'
channelId: 'channel1'
expect: 200
- method: 'post'
uri: 'bridges/bridge1'
body: {'variables': {'BRIDGESTATE': {'value': 'created', 'report_events': True }}}
expect: 200

- ari-events:
match:
type: 'StasisStart'
application: 'testsuite'
channel:
id: 'channel1'
count: 1
ari-requests:
- method: 'post'
uri: 'bridges/bridge1/variable'
params:
bridgeId: 'bridge1'
variable: 'TESTVAR1'
value: 'test1'
report_events: False
expect: 204
- method: 'post'
uri: 'bridges/bridge1/variable'
params:
bridgeId: 'bridge1'
variable: 'TESTVAR2'
value: 'test2'
report_events: True
expect: 204
- method: 'get'
uri: 'bridges/bridge1/variable'
params:
bridgeId: 'bridge1'
variable: 'BRIDGESTATE'
expect: 200
response_body:
match: {'value': 'created'}
- method: 'get'
uri: 'bridges/bridge1/variable'
params:
bridgeId: 'bridge1'
variable: 'TESTVAR1'
expect: 200
response_body:
match: {'value': 'test1'}
- method: 'get'
uri: 'bridges/bridge1/variable'
params:
bridgeId: 'bridge1'
variable: 'TESTVAR2'
expect: 200
response_body:
match: {'value': 'test2'}
- method: 'post'
uri: 'bridges/bridge1/addChannel'
params:
channel: 'channel1'
expect: 204

- ari-events:
match:
type: 'ChannelEnteredBridge'
application: 'testsuite'
channel:
id: 'channel1'
bridge:
id: 'bridge1'
bridgevars:
BRIDGESTATE: 'created'
TESTVAR2: 'test2'
count: 1
ari-requests:
- method: 'delete'
uri: 'channels/channel1'
expect: 204

- ari-events:
match:
type: 'ChannelEnteredBridge'
application: 'testsuite'
channel:
id: 'channel1'
bridge:
id: 'bridge1'
bridgevars:
TESTVAR1: 'test1'
count: 0

- ari-events:
match:
type: 'StasisEnd'
application: 'testsuite'
channel:
id: 'channel1'
count: 1
stop_test:

properties:
dependencies:
- python: 'autobahn.websocket'
- python: 'requests'
- python: 'twisted'
- python: 'starpy'
- asterisk: 'res_ari_channels'
tags:
- ARI
3 changes: 3 additions & 0 deletions tests/rest_api/bridges/bridge_variables/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests:
- test: 'get_set_multiple'
- test: 'get_set_single'
1 change: 1 addition & 0 deletions tests/rest_api/bridges/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests:
- test: 'add_recording_channel'
- test: 'bridge_by_id'
- test: 'bridge_record'
- dir: 'bridge_variables'
- test: 'id_propagate'
- test: 'no_id_propagate'
- dir: 'playback'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[default]

exten => s,1,NoOp()
same => n,Answer()
same => n,Playback(silence/1&please-try-again&silence/3)
same => n,Hangup()

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
testinfo:
summary: 'Test getting/setting multiple channel variables simultaneously via ARI.'
description: |
'Create a channel. Set some channel variables on the newly
created channel. Then, get those channel variables to ensure
everything worked as expected.'

test-modules:
test-object:
config-section: 'test-object-config'
typename: 'ari.AriBaseTestObject'
modules:
- config-section: 'pluggable-config'
typename: 'pluggable_modules.EventActionModule'

test-object-config:
apps: 'testsuite'
reactor-timeout: 15
stop-on-end: False

pluggable-config:
- ari-start:
ari-requests:
- method: 'post'
uri: 'channels/create'
params:
endpoint: 'Local/s@default'
app: 'testsuite'
channelId: 'channel1'
body: {'variables': {'CALLSTATE': {'value': 'created', 'report_events': True }}}
expect: 200

- ari-events:
match:
type: 'StasisStart'
application: 'testsuite'
channel:
id: 'channel1'
count: 1
ari-requests:
- method: 'post'
uri: 'channels/channel1/variables'
body: {'variables': {'TESTVAR1': 'test1', 'TESTVAR2 ': {'value': 'test2', 'report_events': True}, ' TESTVAR3': 'test3'}}
expect: 204
- method: 'get'
uri: 'channels/channel1/variables'
params:
variables: ' TESTVAR1, TESTVAR2 ,TESTVAR3'
expect: 200
response_body:
match: {'variables': {'TESTVAR1': 'test1', 'TESTVAR2': 'test2', 'TESTVAR3': 'test3'}}
- method: 'delete'
uri: 'channels/channel1'
expect: 204

- ari-events:
match:
type: 'StasisEnd'
application: 'testsuite'
channel:
id: 'channel1'
channelvars:
CALLSTATE: 'created'
TESTVAR2: 'test2'
count: 1
stop_test:

properties:
dependencies:
- python: 'autobahn.websocket'
- python: 'requests'
- python: 'twisted'
- python: 'starpy'
- asterisk: 'res_ari_channels'
tags:
- ARI
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[default]

exten => s,1,NoOp()
same => n,Answer()
same => n,Playback(silence/1&please-try-again&silence/3)
same => n,Hangup()

Loading
Loading