<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9037">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins2: Verified
  George Joseph: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip/message:  Add test for passing message through confbridge<br><br>Alice and Bob call a confbridge.  Alice waits a few seconds to make sure<br>Bob is in the bridge then sends an in-dialog MESSAGE with a text/html<br>body.  Bob gets the MESSAGE and verifies that Content-Type was preserved<br>and that the body is intact.<br><br>Change-Id: Icde9beeb210ba42be5d9bc391f0e3ab6c11c3479<br>(cherry picked from commit 3fd342d085a38c8ff86da415c87ad230a2583ed1)<br>---<br>A tests/channels/pjsip/message/message_confbridge/configs/ast1/confbridge.conf<br>A tests/channels/pjsip/message/message_confbridge/configs/ast1/extensions.conf<br>A tests/channels/pjsip/message/message_confbridge/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/message/message_confbridge/sipp/message_recv.xml<br>A tests/channels/pjsip/message/message_confbridge/sipp/message_send.xml<br>A tests/channels/pjsip/message/message_confbridge/test-config.yaml<br>M tests/channels/pjsip/message/tests.yaml<br>7 files changed, 284 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/message/message_confbridge/configs/ast1/confbridge.conf b/tests/channels/pjsip/message/message_confbridge/configs/ast1/confbridge.conf<br>new file mode 100644<br>index 0000000..c92b171<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/configs/ast1/confbridge.conf<br>@@ -0,0 +1,40 @@<br>+[general]<br>+<br>+[user_profile]<br>+type = user<br>+admin = no<br>+pin = 1111<br>+marked = yes<br>+startmuted = no<br>+announce_user_count = yes<br>+announce_user_count_all = 1<br>+announce_join_leave = yes<br>+<br>+[user_menu]<br>+type = menu<br>+1 = toggle_mute<br>+2 = leave_conference<br>+<br>+[admin_profile]<br>+type = user<br>+admin = yes<br>+pin = 2222<br>+marked = yes<br>+startmuted = yes<br>+announce_user_count = yes<br>+announce_user_count_all = 1<br>+announce_join_leave = yes<br>+<br>+[admin_menu]<br>+type = menu<br>+1 = toggle_mute<br>+2 = admin_toggle_conference_lock<br>+3 = leave_conference<br>+<br>+<br>+[default_bridge]<br>+type = bridge<br>+<br>+[default_user]<br>+type = user<br>+<br>diff --git a/tests/channels/pjsip/message/message_confbridge/configs/ast1/extensions.conf b/tests/channels/pjsip/message/message_confbridge/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..75494f4<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/configs/ast1/extensions.conf<br>@@ -0,0 +1,6 @@<br>+[general]<br>+<br>+[default]<br>+exten = confbridge,1,Answer()<br>+same = n,ConfBridge(default_bridge)<br>+<br>diff --git a/tests/channels/pjsip/message/message_confbridge/configs/ast1/pjsip.conf b/tests/channels/pjsip/message/message_confbridge/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..df91cee<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/configs/ast1/pjsip.conf<br>@@ -0,0 +1,34 @@<br>+[local]<br>+type=transport<br>+protocol=udp<br>+bind=0.0.0.0<br>+<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[alice]<br>+type=aor<br>+contact=sip:alice@127.0.0.1:5061<br>+max_contacts=1<br>+<br>+[alice]<br>+type=endpoint<br>+context=default<br>+aors=alice<br>+direct_media=no<br>+disallow=all<br>+allow=ulaw<br>+<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[bob]<br>+type=aor<br>+contact=sip:bob@127.0.0.1:5062<br>+max_contacts=1<br>+<br>+[bob]<br>+type=endpoint<br>+context=default<br>+aors=bob<br>+direct_media=no<br>+disallow=all<br>+allow=ulaw<br>diff --git a/tests/channels/pjsip/message/message_confbridge/sipp/message_recv.xml b/tests/channels/pjsip/message/message_confbridge/sipp/message_recv.xml<br>new file mode 100644<br>index 0000000..5af8837<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/sipp/message_recv.xml<br>@@ -0,0 +1,84 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="INVITE to echo with SDP in initial INVITE"><br>+<br>+    <Global variables="extn" /><br>+<br>+    <send><br>+    <![CDATA[<br>+      INVITE sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: "Bob" <sip:[service]@[local_ip]:[local_port]>;tag=SIPPID-[pid]-[call_number]<br>+      To: conf <sip:[$extn]@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: [cseq] INVITE<br>+      Contact: "Bob" <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+      Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, PRACK, REGISTER, REFER, MESSAGE<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio 6000 RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+    ]]><br>+    </send><br>+<br>+    <recv response="100" optional="true" /><br>+    <recv response="200" /><br>+<br>+    <send><br>+    <![CDATA[<br>+      ACK sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      [last_Call-ID:]<br>+      CSeq: [cseq] ACK<br>+      [last_Contact:]<br>+      [last_Allow:]<br>+      Content-Length: 0<br>+    ]]><br>+    </send><br>+<br>+    <recv request="MESSAGE" timeout="15000"><br>+        <action><br>+            <ereg regexp="text/html" search_in="hdr" header="Content-Type:" check_it="true" assign_to="dummy"/><br>+            <ereg regexp="<head><body>this is a test</body></html>" search_in="body" check_it="true" assign_to="dummy"/><br>+        </action><br>+    </recv><br>+<br>+    <send><br>+    <![CDATA[<br>+      SIP/2.0 202 Accepted<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      [last_Call-ID:]<br>+      [last_CSeq:]<br>+      Allow: INVITE, ACK, MESSAGE, BYE<br>+      Content-Length: 0<br>+    ]]><br>+    </send><br>+<br>+    <send><br>+    <![CDATA[<br>+      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+      [last_Via:]<br>+      From: "Bob" <sip:[service]@[local_ip]:[local_port]>;tag=SIPPID-[pid]-[call_number]<br>+      To: conf <sip:[$extn]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+      [last_Call-ID:]<br>+      CSeq: [cseq+1] BYE<br>+      [last_Contact:]<br>+      Content-Length: 0<br>+    ]]><br>+    </send><br>+<br>+    <recv response="200" /><br>+<br>+    <Reference variables="dummy" /><br>+</scenario><br>diff --git a/tests/channels/pjsip/message/message_confbridge/sipp/message_send.xml b/tests/channels/pjsip/message/message_confbridge/sipp/message_send.xml<br>new file mode 100644<br>index 0000000..0f64b9f<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/sipp/message_send.xml<br>@@ -0,0 +1,87 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="INVITE to echo with SDP in initial INVITE"><br>+<br>+    <Global variables="extn" /><br>+<br>+    <send><br>+    <![CDATA[<br>+      INVITE sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: "Alice" <sip:[service]@[local_ip]:[local_port]>;tag=SIPPID-[pid]-[call_number]<br>+      To: conf <sip:[$extn]@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: [cseq] INVITE<br>+      Contact: "Alice" <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+      Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, PRACK, REGISTER, REFER, MESSAGE<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio 6000 RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+    ]]><br>+    </send><br>+<br>+    <recv response="100" optional="true"/><br>+    <recv response="200"/><br>+<br>+    <send><br>+    <![CDATA[<br>+      ACK sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      [last_Call-ID:]<br>+      CSeq: [cseq] ACK<br>+      [last_Contact:]<br>+      [last_Allow:]<br>+      Content-Length: 0<br>+    ]]><br>+    </send><br>+<br>+    <!-- Give the other scenario a chance to join the bridge --><br>+    <pause milliseconds="5000" /><br>+<br>+    <send><br>+    <![CDATA[<br>+      MESSAGE sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      [last_Call-ID:]<br>+      CSeq: [cseq+1] MESSAGE<br>+      [last_Contact:]<br>+      [last_Allow:]<br>+      Content-Type: text/html<br>+      Content-Length: [len]<br>+<br>+      <head><body>this is a test</body></html><br>+    ]]><br>+    </send><br>+<br>+    <recv response="202" /><br>+<br>+    <pause milliseconds="2000"/><br>+<br>+    <send><br>+    <![CDATA[<br>+      BYE sip:[$extn]@[remote_ip]:[remote_port] SIP/2.0<br>+      [last_Via:]<br>+      [last_From:]<br>+      [last_To:]<br>+      [last_Call-ID:]<br>+      CSeq: [cseq+1] BYE<br>+      [last_Contact:]<br>+      Content-Length: 0<br>+    ]]><br>+    </send><br>+<br>+    <recv response="200" /><br>+<br>+</scenario><br>diff --git a/tests/channels/pjsip/message/message_confbridge/test-config.yaml b/tests/channels/pjsip/message/message_confbridge/test-config.yaml<br>new file mode 100644<br>index 0000000..8501f72<br>--- /dev/null<br>+++ b/tests/channels/pjsip/message/message_confbridge/test-config.yaml<br>@@ -0,0 +1,32 @@<br>+testinfo:<br>+    summary: 'Test sending an in dialog MESSAGE to a confbridge.'<br>+    description: |<br>+        Alice and Bob call a confbridge.  Alice waits a few seconds to make sure<br>+        Bob is in the bridge then sends an in-dialog MESSAGE with a text/html<br>+        body.  Bob gets the MESSAGE and verifies that Content-Type was preserved<br>+        and that the body is intact.  <br>+<br>+properties:<br>+    dependencies:<br>+        - app : 'sipp'<br>+        - asterisk : 'res_pjsip'<br>+        - asterisk : 'res_pjsip_messaging'<br>+        - asterisk : 'bridge_softmix'<br>+        - asterisk : 'app_confbridge'<br>+    tags:<br>+        - pjsip<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: test-object-config<br>+        typename: 'sipp.SIPpTestCase'<br>+<br>+test-object-config:<br>+    reactor-timeout: 20<br>+    test-iterations:<br>+        -<br>+             scenarios:<br>+                - { 'key-args': { 'scenario': 'message_recv.xml', '-p': '5061', '-s': 'alice' },<br>+                    'ordered-args': [ '-set', 'extn', 'confbridge' ] }<br>+                - { 'key-args': { 'scenario': 'message_send.xml', '-p': '5062', '-s': 'bob' },<br>+                    'ordered-args': [ '-set', 'extn', 'confbridge' ] }<br>diff --git a/tests/channels/pjsip/message/tests.yaml b/tests/channels/pjsip/message/tests.yaml<br>index ff65d54..ab504d9 100644<br>--- a/tests/channels/pjsip/message/tests.yaml<br>+++ b/tests/channels/pjsip/message/tests.yaml<br>@@ -9,3 +9,4 @@<br>     - test: 'message_retrans'<br>     - test: 'message_send_ami'<br>     - test: 'message_to_uri'<br>+    - test: 'message_confbridge'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9037">change 9037</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/9037"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 13.21 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Icde9beeb210ba42be5d9bc391f0e3ab6c11c3479 </div>
<div style="display:none"> Gerrit-Change-Number: 9037 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>