<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/20083">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip: Add test for evsub leaks<br><br>Add a test that creates and terminates an evsub in the<br>three possible ways:<br><br>- unsubscribe with expires = 0<br>- allow subscription to timeout on the server side<br>- send a 5xx response to the initial notify<br><br>After each termination, call PJSIPShowSubscriptionsInbound<br>and if any InboundSubscriptionDetail events are generated,<br>the test fails.<br><br>ASTERISK-30469<br><br>Change-Id: Ia4b7ed52649fa102be0af7145036abfea5dd3c4b<br>---<br>A tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_server_timeout.xml<br>A tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_sub_unsub.xml<br>A tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_term.xml<br>A tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/test-config.yaml<br>M tests/channels/pjsip/subscriptions/mwi/tests.yaml<br>6 files changed, 324 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/83/20083/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/configs/ast1/pjsip.conf b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..ca0dbb7</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,21 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[global]</span><br><span style="color: hsl(120, 100%, 40%);">+type=global</span><br><span style="color: hsl(120, 100%, 40%);">+debug=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+transport=local-transport</span><br><span style="color: hsl(120, 100%, 40%);">+allow=g722,ulaw,alaw</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=alice</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:alice@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+mailboxes=alice</span><br><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_server_timeout.xml b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_server_timeout.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..c177dad</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_server_timeout.xml</span><br><span>@@ -0,0 +1,65 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Subscribe"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Subscribe --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: "alice" <sip:alice@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 SUBSCRIBE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: "alice" <sip:alice@[local_ip]:[local_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 10</span><br><span style="color: hsl(120, 100%, 40%);">+ Accept: application/simple-message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Allow-Events: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ User-Agent: SIPp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="NOTIFY" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="NOTIFY" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_sub_unsub.xml b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_sub_unsub.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..ca2f533</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_sub_unsub.xml</span><br><span>@@ -0,0 +1,93 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Subscribe"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Subscribe --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: "alice" <sip:alice@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 SUBSCRIBE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: "alice" <sip:alice@[local_ip]:[local_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 300</span><br><span style="color: hsl(120, 100%, 40%);">+ Accept: application/simple-message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Allow-Events: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ User-Agent: SIPp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="(;tag=.*)" header="To:" search_in="hdr" check_it="true" assign_to="to_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="NOTIFY" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <pause milliseconds="1000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Unsubscribe --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: "alice" <sip:alice@[remote_ip]:[remote_port]>[$to_tag]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 3 SUBSCRIBE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: "alice" <sip:alice@[local_ip]:[local_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ Accept: application/simple-message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Allow-Events: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ User-Agent: SIPp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="NOTIFY" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_term.xml b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_term.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..4e2982a</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/sipp/mwi_subscription_term.xml</span><br><span>@@ -0,0 +1,47 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Subscribe"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Subscribe --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: "alice" <sip:alice@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 SUBSCRIBE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: "alice" <sip:alice@[local_ip]:[local_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Expires: 10</span><br><span style="color: hsl(120, 100%, 40%);">+ Accept: application/simple-message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ Allow-Events: message-summary</span><br><span style="color: hsl(120, 100%, 40%);">+ User-Agent: SIPp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="NOTIFY" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 500 Server Error</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/test-config.yaml b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..0ac2655</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/sub_term_leakcheck/test-config.yaml</span><br><span>@@ -0,0 +1,75 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test MWI that subscriptions are cleaned upon termination.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This creates an MWI subscribtion, then lets the subscription terminate in the following 3 ways:</span><br><span style="color: hsl(120, 100%, 40%);">+ 1 - unsubscribe with expires = 0</span><br><span style="color: hsl(120, 100%, 40%);">+ 2 - allow subscription to timeout on the server side</span><br><span style="color: hsl(120, 100%, 40%);">+ 3 - send a 5xx response to the initial notify</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ In all three cases we test to make sure that there are no active subscriptions</span><br><span style="color: hsl(120, 100%, 40%);">+ at the end. If we receive any InboundSubscriptionDetail events, the test fails.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp:</span><br><span style="color: hsl(120, 100%, 40%);">+ version: 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ add-test-to-search-path: 'True'</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: sipp-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp_iterator.SIPpIteratorTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'ami-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+sipp-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ connect-ami: 'True'</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor-timeout: 30</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'single'</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ # Alice subscribes and unsubscribes</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'mwi_subscription_sub_unsub.xml', 'port': '5061', 'target': '127.0.0.1'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'none'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # Make sure the susbscription is cleaned</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'none'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'PJSIPShowSubscriptionsInbound'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # Alice subscribes then waits for the server to timeout the subscription</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'mwi_subscription_server_timeout.xml', 'port': '5061', 'target': '127.0.0.1'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'none'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # Make sure the susbscription is cleaned</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'none'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'PJSIPShowSubscriptionsInbound'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # Alice subscribes and then sends a 5xx in response to the NOTIFY</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'mwi_subscription_term.xml', 'port': '5061', 'target': '127.0.0.1'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'none'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # Make sure the susbscription is cleaned</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'none'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'PJSIPShowSubscriptionsInbound'}}</span><br><span style="color: hsl(120, 100%, 40%);">+ # indicate no more scenarios to run, send testComplete Event</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'scenario': {'Name': 'done'},</span><br><span style="color: hsl(120, 100%, 40%);">+ 'action': {'Action': 'UserEvent', 'UserEvent': 'testComplete'}}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'InboundSubscriptionDetail'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ stop_test:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'UserEvent'</span><br><span style="color: hsl(120, 100%, 40%);">+ UserEvent: 'testComplete'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: 1</span><br><span style="color: hsl(120, 100%, 40%);">+ stop_test:</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/subscriptions/mwi/tests.yaml b/tests/channels/pjsip/subscriptions/mwi/tests.yaml</span><br><span>index 3636508..753aab9 100644</span><br><span>--- a/tests/channels/pjsip/subscriptions/mwi/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/subscriptions/mwi/tests.yaml</span><br><span>@@ -9,3 +9,4 @@</span><br><span> - test: 'no_accept_header'</span><br><span> - test: 'sub_setup_teardown'</span><br><span> - test: 'sub_setup_teardown_drop_options'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'sub_term_leakcheck'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/20083">change 20083</a>. To unsubscribe, or for help writing mail filters, 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/c/testsuite/+/20083"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Ia4b7ed52649fa102be0af7145036abfea5dd3c4b </div>
<div style="display:none"> Gerrit-Change-Number: 20083 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>