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
20 changes: 20 additions & 0 deletions tests/apps/mixmonitor_loop/configs/ast1/extensions.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[default]
exten => s,1,Answer()
same => n,Set(i=0)
same => n,While($[${INC(i)}<1100]) ; more than the default # of file descriptors per process
same => n,MixMonitor(test.wav)
same => n,EndWhile()
same => n,While($[${INC(i)}<2200])
same => n,MixMonitor(test2.wav,r(test2-rx.wav)t(test2-tx.wav))
same => n,EndWhile()
same => n,StopMixMonitor()
same => n,MixMonitor(test3.wav)
same => n,Wait(0.1)
same => n,StopMixMonitor()
same => n,ExecIf(${STAT(e,${AST_CONFIG(asterisk.conf,directories,astspooldir}/monitor/test3.wav)}?UserEvent(MixMonitorSuccess,Result: Pass):UserEvent(MixMonitorSuccess,Result: Fail))
same => n,Hangup()

[nothing]
exten => 0,1,Answer()
same => n,Wait(8)
same => n,Hangup()
60 changes: 60 additions & 0 deletions tests/apps/mixmonitor_loop/test-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
testinfo:
summary: 'Ensure that MixMonitor called in a loop acts sanely.'
description: |
'This tests calling MixMonitor in a loop to ensure that
duplicate recordings do not get opened, consuming all
available file descriptor resources.'

test-modules:
test-object:
config-section: test-object-config
typename: 'test_case.TestCaseModule'
modules:
-
config-section: caller-originator
typename: 'pluggable_modules.Originator'
-
config-section: hangup-monitor
typename: 'pluggable_modules.HangupMonitor'
-
config-section: ami-config
typename: 'pluggable_modules.EventActionModule'

test-object-config:
connect-ami: True

caller-originator:
channel: 'Local/s@default'
context: 'nothing'
exten: '0'
priority: '1'
trigger: 'ami_connect'

hangup-monitor:
ids: '0'

ami-config:
-
ami-events:
conditions:
match:
Event: 'UserEvent'
UserEvent: 'MixMonitorSuccess'
requirements:
match:
Result: 'Pass'
count: 1
stop_test:

properties:
tags:
- dial
- apps
dependencies:
- python: 'twisted'
- python: 'starpy'
- asterisk: 'app_dial'
- asterisk: 'app_userevent'
- asterisk: 'app_originate'
- asterisk: 'app_mixmonitor'
- asterisk: 'pbx_config'
1 change: 1 addition & 0 deletions tests/apps/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tests:
- test: 'mixmonitor_rxtx'
- test: 'mixmonitor_audiohook_inherit'
- test: 'mixmonitor_func'
- test: 'mixmonitor_loop'
- dir: 'control_playback'
- dir: 'playback'
- test: 'say_interrupt'
Expand Down