Skip to content

Commit

Permalink
dial_progress: Fix originate and improve test robustness.
Browse files Browse the repository at this point in the history
* Fix originate to extension '0' instead of 's' as in dialplan.
* Eliminate the Fail UserEvent if we continue past the pass
  dials. Previously, the test suite would initiate shutdown
  as soon as 2 passes were received, which caused the answer
  dial channel allocation to fail, leading dialplan execution
  to continue onwards to stuff it wasn't supposed to execute
  in a successful test, triggering a failure. To test the same
  scenario, explicitly continue onwards and check DIALSTATUS
  for an additional pass, which should prevent us from getting
  shut down before the test has concluded.
* Fix test so that it doesn't exit prematurely.
  • Loading branch information
InterLinked1 committed Oct 18, 2024
1 parent e930bd9 commit bd853d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/apps/dial/dial_progress/configs/ast1/extensions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ exten => s,1,Answer()
same => n,UserEvent(DialProgress,Result: Pass)
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
same => n,ExecIf($["${DIALSTATUS}"="NOANSWER"]?UserEvent(DialProgress,Result: Pass))
same => n,Dial(Local/s@answer,3^2) ; call will answer, so should not continue
same => n,UserEvent(DialProgress,Result: Fail)
same => n,Dial(Local/s@answer,3^2,g) ; call will answer, and will continue
same => n,ExecIf($["${DIALSTATUS}"="ANSWER"]?UserEvent(DialProgress, Result: Pass))
same => n,Hangup()

[noanswer]
Expand Down
17 changes: 9 additions & 8 deletions tests/apps/dial/dial_progress/test-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ test-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'
Expand All @@ -25,13 +22,10 @@ test-object-config:
caller-originator:
channel: 'Local/s@default'
context: 'noanswer'
exten: '0'
exten: 's'
priority: '1'
trigger: 'ami_connect'

hangup-monitor:
ids: '0'

ami-config:
-
ami-events:
Expand All @@ -42,7 +36,14 @@ ami-config:
requirements:
match:
Result: 'Pass'
count: 2
count: 3
-
ami-events:
conditions:
match:
Event: 'Hangup'
Channel: 'Local/s@default-00000000;1'
count: 1
stop_test:

properties:
Expand Down

0 comments on commit bd853d6

Please sign in to comment.