Skip to content

Commit 511697c

Browse files
committed
app_mixmonitor: Add tests for duplicate recording avoidance detection.
Related to: asterisk/asterisk#1512
1 parent 7e08b53 commit 511697c

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[default]
2+
exten => s,1,Answer()
3+
same => n,Set(i=0)
4+
same => n,While($[${INC(i)}<1100]) ; more than the default # of file descriptors per process
5+
same => n,MixMonitor(test.wav)
6+
same => n,EndWhile()
7+
same => n,While($[${INC(i)}<2200])
8+
same => n,MixMonitor(test2.wav,r(test2-rx.wav)t(test2-tx.wav))
9+
same => n,EndWhile()
10+
same => n,StopMixMonitor()
11+
same => n,MixMonitor(test3.wav)
12+
same => n,Wait(0.1)
13+
same => n,StopMixMonitor()
14+
same => n,ExecIf(${STAT(e,${AST_CONFIG(asterisk.conf,directories,astspooldir}/monitor/test3.wav)}?UserEvent(MixMonitorSuccess,Result: Pass):UserEvent(MixMonitorSuccess,Result: Fail))
15+
same => n,Hangup()
16+
17+
[nothing]
18+
exten => 0,1,Answer()
19+
same => n,Wait(8)
20+
same => n,Hangup()
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
testinfo:
2+
summary: 'Ensure that MixMonitor called in a loop acts sanely.'
3+
description: |
4+
'This tests calling MixMonitor in a loop to ensure that
5+
duplicate recordings do not get opened, consuming all
6+
available file descriptor resources.'
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: 'pluggable_modules.EventActionModule'
22+
23+
test-object-config:
24+
connect-ami: True
25+
26+
caller-originator:
27+
channel: 'Local/s@default'
28+
context: 'nothing'
29+
exten: '0'
30+
priority: '1'
31+
trigger: 'ami_connect'
32+
33+
hangup-monitor:
34+
ids: '0'
35+
36+
ami-config:
37+
-
38+
ami-events:
39+
conditions:
40+
match:
41+
Event: 'UserEvent'
42+
UserEvent: 'MixMonitorSuccess'
43+
requirements:
44+
match:
45+
Result: 'Pass'
46+
count: 1
47+
stop_test:
48+
49+
properties:
50+
tags:
51+
- dial
52+
- apps
53+
dependencies:
54+
- python: 'twisted'
55+
- python: 'starpy'
56+
- asterisk: 'app_dial'
57+
- asterisk: 'app_userevent'
58+
- asterisk: 'app_originate'
59+
- asterisk: 'app_mixmonitor'
60+
- asterisk: 'pbx_config'

tests/apps/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tests:
1515
- test: 'mixmonitor_rxtx'
1616
- test: 'mixmonitor_audiohook_inherit'
1717
- test: 'mixmonitor_func'
18+
- test: 'mixmonitor_loop'
1819
- dir: 'control_playback'
1920
- dir: 'playback'
2021
- test: 'say_interrupt'

0 commit comments

Comments
 (0)