[asterisk-dev] [Code Review] 3348: Test Suite: MWI subscription test for PJSIP

jbigelow reviewboard at asterisk.org
Thu Mar 13 16:27:39 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3348/
-----------------------------------------------------------

(Updated March 13, 2014, 4:27 p.m.)


Review request for Asterisk Developers.


Changes
-------

Updated to handle the scenario of the on_mwi_info() callback not be called.


Bugs: ASTERISK-23343
    https://issues.asterisk.org/jira/browse/ASTERISK-23343


Repository: testsuite


Description
-------

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.

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.


Diffs (updated)
-----

  /asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml 4836 
  /asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/test-config.yaml PRE-CREATION 
  /asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/subscribe.py PRE-CREATION 
  /asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/configs/ast1/pjsip.conf PRE-CREATION 
  /asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/basic_mailbox_subscribe/configs/ast1/modules.conf PRE-CREATION 
  /asterisk/trunk/lib/python/asterisk/pjsua_mod.py 4836 

Diff: https://reviewboard.asterisk.org/r/3348/diff/


Testing
-------

* Ensured tests pass on multiple executions
* Ensured the testsuite & Asterisk logs looked good.


Thanks,

jbigelow

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140313/243e984c/attachment-0001.html>


More information about the asterisk-dev mailing list