<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/3348/">https://reviewboard.asterisk.org/r/3348/</a>
     </td>
    </tr>
   </table>
   <br />











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/3348/diff/2/?file=55972#file55972line56" style="color: black; font-weight: bold; text-decoration: underline;">/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/subscribe.py</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">56</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">reactor</span><span class="o">.</span><span class="n">callLater</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">check_cb</span><span class="p">)</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">57</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">58</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">def</span> <span class="nf">check_cb</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">59</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">got_mwi_cb</span><span class="p">:</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">60</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">LOGGER</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Callback for Alice has not been executed. Failing "</span> \</pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">61</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                    <span class="s">"the test!"</span><span class="p">)</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">62</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="bp">self</span><span class="o">.</span><span class="n">fail_test</span><span class="p">()</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This isn't necessary. The reactor already has a timeout, so there's no need to try to reimplement the timeout logic yourself.</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/3348/diff/2/?file=55973#file55973line9" style="color: black; font-weight: bold; text-decoration: underline;">/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/test-config.yaml</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">9</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="l-Scalar-Plain">minversion</span><span class="p-Indicator">:</span> <span class="s">'13.0.0'</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This should work for 12.0.0 as well.</pre>
</div>
<br />



<p>- Mark Michelson</p>


<br />
<p>On March 14th, 2014, 2:24 p.m. UTC, jbigelow wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By jbigelow.</div>


<p style="color: grey;"><i>Updated March 14, 2014, 2:24 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-23343">ASTERISK-23343</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
testsuite
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This test depends on some changes in the PJSIP python library pjsua.py. The plan is to submit this upstream. See in-line with this description below.

This basic nominal test ensures that a mailbox on an AOR for an enpoint can be subscribed to for MWI and that a NOTIFY is received. It creates endpoint "alice" with subscribing to MWI. Upon receiving a notify for message summary indicating no messages the test will be marked as passed otherwise it will be failed.

The other two tests on ASTERISK-23343 aren't currently possible with the PJSUA API v1 and are up for review at https://reviewboard.asterisk.org/r/3354/ with using SIPp.

Note: the following patch for pjsua.py adds modify_account() which isn't currently used by the testsuite but was added for possible future use.

Index: pjsip-apps/src/python/pjsua.py
===================================================================
--- pjsip-apps/src/python/pjsua.py      (revision 4791)
+++ pjsip-apps/src/python/pjsua.py      (working copy)
@@ -775,6 +775,7 @@
     use_srtp = 0
     srtp_secure_signaling = 1
     rtp_transport_cfg = None
+    mwi_enabled = False
 
     def __init__(self, domain="", username="", password="", 
                  display="", registrar="", proxy=""):
@@ -865,6 +866,7 @@
         self.ka_data = cfg.ka_data
         self.use_srtp = cfg.use_srtp
         self.srtp_secure_signaling = cfg.srtp_secure_signaling
+        self.mwi_enabled = cfg.mwi_enabled
         if (self.rtp_transport_cfg is not None):
             self.rtp_transport_cfg._cvt_from_pjsua(cfg.rtp_transport_cfg)
 
@@ -896,6 +898,7 @@
         cfg.ka_data = self.ka_data
         cfg.use_srtp = self.use_srtp
         cfg.srtp_secure_signaling = self.srtp_secure_signaling
+        cfg.mwi_enabled = self.mwi_enabled
 
         if (self.rtp_transport_cfg is not None):
             cfg.rtp_transport_cfg = self.rtp_transport_cfg._cvt_to_pjsua()
@@ -2337,6 +2340,18 @@
         self._err_check("create_account_for_transport()", self, err)
         return Account(self, acc_id, cb)
 
+    def modify_account(self, acc_id, acc_config):
+        """Modify configuration of a pjsua account.
+
+        Keyword arguments:
+        acc_id      -- ID of the account to be modified.
+        acc_config  -- New account configuration.
+
+        """
+        lck = self.auto_lock()
+        err = _pjsua.acc_modify(acc_id, acc_config._cvt_to_pjsua())
+        self._err_check("modify_account()", self, err)
+
     def hangup_all(self):
         """Hangup all calls.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">* Ensured tests pass on multiple executions
* Ensured the testsuite & Asterisk logs looked good.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml <span style="color: grey">(4836)</span></li>

 <li>/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/test-config.yaml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/subscribe.py <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/configs/ast1/pjsip.conf <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/configs/ast1/modules.conf <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/asterisk/trunk/lib/python/asterisk/pjsua_mod.py <span style="color: grey">(4836)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/3348/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>