Skip to content

Commit 7cf20a2

Browse files
committed
app_confbridge: Tests for user answer_channel
This tests the operation of the new answer_channel user option and ensures that the default behavior has not changed. ASTERISK-29440 Change-Id: Ib150939cd806c842c49dbc4be5b56d0fb5e962d4
1 parent 6f93ce2 commit 7cf20a2

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[user_noanswer]
2+
type=user
3+
answer_channel=no
4+
timeout=5
5+
6+
[user_answer]
7+
type=user
8+
answer_channel=yes
9+
timeout=5
10+
11+
[default_user]
12+
type=user
13+
timeout=5
14+
15+
[default_bridge]
16+
type=bridge
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[default]
2+
exten => noanswer,1,Answer()
3+
same => n,Dial(Local/noanswer@conf/n,4,g)
4+
same => n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?pass,1:fail,1)
5+
exten => answer,1,Answer()
6+
same => n,Dial(Local/answer@conf/n,4,g)
7+
same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1)
8+
exten => default,1,Answer()
9+
same => n,Dial(Local/default@conf/n,4,g)
10+
same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1)
11+
exten => fail,1,UserEvent(ConfBridgeNoAnswer,Result: Fail,Reason: ${DIALSTATUS})
12+
same => n,Hangup()
13+
exten => pass,1,UserEvent(ConfBridgeNoAnswer,Result: Pass)
14+
same => n,Hangup()
15+
16+
[conf]
17+
exten => noanswer,1,Progress()
18+
same => n,ConfBridge(test,,user_noanswer)
19+
same => n,Hangup()
20+
exten => answer,1,Progress()
21+
same => n,ConfBridge(test,,user_answer)
22+
same => n,Hangup()
23+
exten => default,1,Progress()
24+
same => n,ConfBridge(test)
25+
same => n,Hangup()
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
testinfo:
2+
summary: 'Ensure that Confbridge user no answer option works as expected'
3+
description: |
4+
'This test configures ConfBridge user profiles with all combinations of
5+
answer_channel options. We expect that a call to noanswer will not
6+
be answered and calls to answer and default will be answered. We also
7+
test that the default behavior remains unchanged.'
8+
9+
test-modules:
10+
test-object:
11+
config-section: test-object-config
12+
typename: 'test_case.TestCaseModule'
13+
modules:
14+
-
15+
config-section: noanswer-originator
16+
typename: 'pluggable_modules.Originator'
17+
-
18+
config-section: answer-originator
19+
typename: 'pluggable_modules.Originator'
20+
-
21+
config-section: default-originator
22+
typename: 'pluggable_modules.Originator'
23+
-
24+
config-section: hangup-monitor
25+
typename: 'pluggable_modules.HangupMonitor'
26+
-
27+
config-section: ami-config
28+
typename: 'ami.AMIEventModule'
29+
30+
test-object-config:
31+
connect-ami: True
32+
33+
noanswer-originator:
34+
channel: 'Local/noanswer@default'
35+
application: 'Echo'
36+
trigger: 'ami_connect'
37+
38+
answer-originator:
39+
channel: 'Local/answer@default'
40+
application: 'Echo'
41+
trigger: 'ami_connect'
42+
43+
default-originator:
44+
channel: 'Local/default@default'
45+
application: 'Echo'
46+
trigger: 'ami_connect'
47+
48+
hangup-monitor:
49+
ids: '0'
50+
51+
ami-config:
52+
-
53+
type: 'headermatch'
54+
conditions:
55+
match:
56+
Event: 'UserEvent'
57+
UserEvent: 'ConfBridgeNoAnswer'
58+
requirements:
59+
match:
60+
Result: 'Pass'
61+
count: 3
62+
63+
64+
properties:
65+
tags:
66+
- confbridge
67+
- apps
68+
dependencies:
69+
- python: 'twisted'
70+
- python: 'starpy'
71+
- asterisk: 'app_confbridge'
72+
- asterisk: 'app_userevent'

tests/apps/confbridge/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ tests:
44
- test: 'confbridge_end_marked'
55
- test: 'confbridge_marked'
66
- test: 'confbridge_marked_unmarked'
7+
- test: 'confbridge_noanswer'
78
- test: 'confbridge_nominal'
89
- test: 'confbridge_recording'
910
- test: 'confbridge_result'

0 commit comments

Comments
 (0)