Skip to content

Commit bdc8f92

Browse files
InterLinked1Friendly Automation
authored andcommitted
app_dial: Tests for expanded A option
Adds test for the expanded Announcement option which can plays announcements to the calling and called parties. ASTERISK-29442 Change-Id: Id8a136dc4ba771e0aca71e1a3ed3b4b20b406158
1 parent adbbf75 commit bdc8f92

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[default]
2+
exten => caller,1,Answer(2)
3+
same => n,Dial(Local/s@somebody/n,,gA(tt-weasels:tt-weasels))
4+
same => n,Hangup()
5+
6+
[default-side-b]
7+
exten => s,1,Answer()
8+
same => n,Set(TIMEOUT(absolute)=12)
9+
same => n,BackgroundDetect(silence/10,200,500)
10+
same => n,UserEvent(DialAnnouncementCaller,Result: Fail,Reason: No Announcement Heard)
11+
same => n,Hangup()
12+
exten => talk,1,UserEvent(DialAnnouncementCaller,Result: Pass)
13+
same => n,Hangup()
14+
15+
[somebody]
16+
exten => s,1,Wait(1)
17+
same => n,Progress() ; somebody's phone is ringing!
18+
same => n,Wait(${RAND(3,6)}) ; How long until he answers? We don't know.
19+
same => n,Set(TIMEOUT(absolute)=7)
20+
same => n,Answer()
21+
same => n,BackgroundDetect(silence/10,200,500)
22+
same => n,UserEvent(DialAnnouncementCaller,Result: Fail,Reason: No Announcement Heard)
23+
same => n,Hangup()
24+
exten => talk,1,UserEvent(DialAnnouncementCaller,Result: Pass)
25+
same => n,Hangup()
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
testinfo:
2+
summary: 'Ensure that Dial announcements work as intended.'
3+
description: |
4+
'This test plays back an announcement to the calling and
5+
called parties upon answer and ensures that audio on
6+
both sides is detected.'
7+
8+
test-modules:
9+
test-object:
10+
config-section: test-object-config
11+
typename: 'test_case.TestCaseModule'
12+
modules:
13+
-
14+
config-section: caller-originator
15+
typename: 'pluggable_modules.Originator'
16+
-
17+
config-section: hangup-monitor
18+
typename: 'pluggable_modules.HangupMonitor'
19+
-
20+
config-section: ami-config
21+
typename: 'ami.AMIEventModule'
22+
23+
test-object-config:
24+
connect-ami: True
25+
26+
caller-originator:
27+
channel: 'Local/caller@default'
28+
context: 'default-side-b'
29+
exten: 's'
30+
priority: '1'
31+
trigger: 'ami_connect'
32+
33+
hangup-monitor:
34+
ids: '0'
35+
36+
ami-config:
37+
-
38+
type: 'headermatch'
39+
conditions:
40+
match:
41+
Event: 'UserEvent'
42+
UserEvent: 'DialAnnouncementCaller'
43+
requirements:
44+
match:
45+
Result: 'Pass'
46+
count: 2
47+
48+
properties:
49+
tags:
50+
- dial
51+
- apps
52+
dependencies:
53+
- python: 'twisted'
54+
- python: 'starpy'
55+
- asterisk: 'app_dial'
56+
- asterisk: 'app_userevent'
57+
- asterisk: 'func_timeout'
58+
- asterisk: 'pbx_config'
59+

tests/apps/dial/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Enter tests here in the order they should be considered for execution:
22
tests:
3+
- test: 'dial_announcements'
34
- test: 'dial_answer'
45
- test: 'dial_busy'
56
- test: 'dial_congestion'

0 commit comments

Comments
 (0)