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

(Updated April 3, 2014, 6:57 a.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 411670


Repository: testsuite


Description
-------

This fixes a race condition in the tests/channels/pjsip/ami/show_subscriptions 
test where the PJSIPShowSubscriptionsInbound AMI command would be issued before 
states had finished transitioning resulting in the response containing "NULL" 
instead of "ACTIVE". This also requires the following patch that adds a test 
event when Asterisk is compiled in development mode:

Index: res/res_pjsip_pubsub.c
===================================================================
--- res/res_pjsip_pubsub.c      (revision 410980)
+++ res/res_pjsip_pubsub.c      (working copy)
@@ -42,6 +42,7 @@
 #include "asterisk/res_pjsip.h"
 #include "asterisk/callerid.h"
 #include "asterisk/manager.h"
+#include "asterisk/test.h"
 #include "res_pjsip/include/res_pjsip_private.h"

 /*** DOCUMENTATION
@@ -464,8 +465,18 @@

 int ast_sip_subscription_send_request(struct ast_sip_subscription *sub, 
pjsip_tx_data *tdata)
 {
-       return pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
+       struct ast_sip_endpoint *endpoint = 
ast_sip_subscription_get_endpoint(sub);
+       int res = pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
                        tdata) == PJ_SUCCESS ? 0 : -1;
+
+       ast_test_suite_event_notify("SUBSCRIPTION_STATE_SET",
+               "StateText: %s\r\n"
+               "Endpoint: %s\r\n",
+               pjsip_evsub_get_state_name(ast_sip_subscription_get_evsub(sub)),
+               ast_sorcery_object_get_id(endpoint));
+
+       ao2_cleanup(endpoint);
+       return res;
 }

 static void subscription_datastore_destroy(void *obj)


Diffs
-----

  asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py 
4885 

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


Testing
-------

Verified that the race was resolved by using state transition test events 
instead of the successful callback of the SIPp scenario.


Thanks,

opticron

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to