<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6844">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels/pjsip/qualify/call_unreachable: Trigger on a more reliable event<br><br>On my test box, the test occasionally never saw the ContactStatus event on<br>the AMI connection. The ContactStatus event is only sent once per status<br>change and likely got "sent" before the test established the AMI<br>connection. The test was using that event to trigger sending the<br>Originate action and thus the test fails.<br><br>* Switch to using the TEST_FRAMEWORK test event 'TestEvent' for the<br>AOR_CONTACT_QUALIFY_RESULT state. This event is sent periodically and is<br>a more reliable trigger event to initiate the Originate action.<br><br>* Added some more test failure checks.<br><br>Change-Id: Id9500c988b4f6cac44783fcd7663dc2cbef4add5<br>---<br>M tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf<br>M tests/channels/pjsip/qualify/call_unreachable/test-config.yaml<br>2 files changed, 36 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/44/6844/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf<br>index a1dec5e..3f8e15a 100644<br>--- a/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf<br>+++ b/tests/channels/pjsip/qualify/call_unreachable/configs/ast1/extensions.conf<br>@@ -3,14 +3,21 @@<br> <br> ; -- Audio Source --<br> <br>+; We should never execute this section of dialplan.<br>+; If we do then the unreachable endpoint answered!<br> exten => playback,1,NoOp()<br>- same => n,Answer()<br>- same => n,Playback(tt-monkeys)<br>+ same => n,UserEvent(failed)<br>+ same => n,Playback(tt-weasels)<br> same => n,Hangup()<br> <br> ; -- Sender --<br> <br>+; The unreachable endpoint should fail to dial immediately.<br> exten => 1000,1,NoOp()<br>- same => n,Dial(PJSIP/test)<br>- same => n,ExecIf($[${DIALSTATUS}=CHANUNAVAIL]?UserEvent(success)<br>+ same => n,Dial(PJSIP/test,10)<br>+ same => n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?unavail<br>+ same => n,UserEvent(failed)<br> same => n,Hangup()<br>+ same => n(unavail),UserEvent(success)<br>+ same => n,Hangup()<br>+<br>diff --git a/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml b/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml<br>index 2f7a579..99409f8 100644<br>--- a/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml<br>+++ b/tests/channels/pjsip/qualify/call_unreachable/test-config.yaml<br>@@ -26,13 +26,17 @@<br> ami-events:<br> conditions:<br> match:<br>- Event: 'ContactStatus'<br>- ContactStatus: 'Unreachable'<br>- AOR: 'test'<br>+ Event: 'TestEvent'<br>+ Type: 'StateChange'<br>+ State: 'AOR_CONTACT_QUALIFY_RESULT'<br> requirements:<br> match:<br>- EndpointName: 'test'<br>- count: '1'<br>+ Status: 'Unreachable'<br>+ # We have to wait for the second event just in case<br>+ # the first event happens too early and the unreachable<br>+ # ContactStatus state has not been set yet.<br>+ count: '>2'<br>+ trigger-on-count: True<br> ami-actions:<br> action:<br> Action: 'Originate'<br>@@ -43,12 +47,21 @@<br> Priority: '1'<br> -<br> ami-events:<br>+ -<br>+ id: '0'<br>+ conditions:<br>+ match:<br>+ Event: 'UserEvent'<br>+ UserEvent: 'failed'<br>+ count: '0' # shouldn't receive any of these<br>+ -<br> id: '0'<br> conditions:<br> match:<br> Event: 'UserEvent'<br> UserEvent: 'success'<br>- count: 1<br>+ count: '1'<br>+ stop_test:<br> <br> hangup-monitor:<br> ids: '0'<br>@@ -56,5 +69,11 @@<br> properties:<br> minversion: '13.17.0'<br> dependencies:<br>+ - buildoption: 'TEST_FRAMEWORK'<br>+ - python : 'twisted'<br>+ - python : 'starpy'<br>+ - asterisk : 'app_dial'<br>+ - asterisk : 'app_playback'<br>+ - asterisk : 'app_userevent'<br> - asterisk : 'res_pjsip'<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6844">change 6844</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6844"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id9500c988b4f6cac44783fcd7663dc2cbef4add5 </div>
<div style="display:none"> Gerrit-Change-Number: 6844 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>