Skip to content

Commit 0e58be4

Browse files
app_dial: Add tests for progress dial time.
Add tests to ensure that the progress timeout for Dial works as intended.
1 parent 9100d08 commit 0e58be4

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[default]
2+
exten => s,1,Answer()
3+
same => n,Dial(Local/s@noanswer,^2) ; wait up to 2 seconds for early media. We won't get it, so execution should continue
4+
same => n,UserEvent(DialProgress,Result: Pass)
5+
same => n,Dial(Local/s@earlymedia,3^2) ; we should get early media, so that will "lock" in this call and we'll wait up to 3 seconds, resulting in a normal NOANSWER
6+
same => n,ExecIf($["${DIALSTATUS}"="NOANSWER"]?UserEvent(DialProgress,Result: Pass))
7+
same => n,Dial(Local/s@answer,3^2) ; call will answer, so should not continue
8+
same => n,UserEvent(DialProgress,Result: Fail)
9+
same => n,Hangup()
10+
11+
[noanswer]
12+
exten => s,1,Wait(99)
13+
same => n,Hangup()
14+
15+
[earlymedia]
16+
exten => s,1,Wait(0.5)
17+
same => n,Progress()
18+
same => n,Wait(2)
19+
same => n,Hangup()
20+
21+
[answer]
22+
exten => s,1,Wait(0.5)
23+
same => n,Progress()
24+
same => n,Wait(1)
25+
same => n,Answer()
26+
same => n,Wait(0.5)
27+
same => n,Hangup()
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
testinfo:
2+
summary: 'Ensure that Dial progress timer works correctly.'
3+
description: |
4+
'This tests the Dial application aborts if progress is not received
5+
and a progress timeout is specified, and continues otherwise.'
6+
7+
test-modules:
8+
test-object:
9+
config-section: test-object-config
10+
typename: 'test_case.TestCaseModule'
11+
modules:
12+
-
13+
config-section: caller-originator
14+
typename: 'pluggable_modules.Originator'
15+
-
16+
config-section: hangup-monitor
17+
typename: 'pluggable_modules.HangupMonitor'
18+
-
19+
config-section: ami-config
20+
typename: 'pluggable_modules.EventActionModule'
21+
22+
test-object-config:
23+
connect-ami: True
24+
25+
caller-originator:
26+
channel: 'Local/s@default'
27+
context: 'nothing'
28+
exten: '0'
29+
priority: '1'
30+
trigger: 'ami_connect'
31+
32+
hangup-monitor:
33+
ids: '0'
34+
35+
ami-config:
36+
-
37+
ami-events:
38+
conditions:
39+
match:
40+
Event: 'UserEvent'
41+
UserEvent: 'DialProgress'
42+
requirements:
43+
match:
44+
Result: 'Pass'
45+
count: 2
46+
stop_test:
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: 'pbx_config'

tests/apps/dial/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
tests:
33
- test: 'dial_announcements'
44
- test: 'dial_answer'
5+
- test: 'dial_progress'
56
- test: 'dial_busy'
67
- test: 'dial_congestion'
78
- test: 'dial_hangup'

0 commit comments

Comments
 (0)