[asterisk-commits] kmoore: branch 12 r411670 - /branches/12/res/res_pjsip_pubsub.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 3 06:57:16 CDT 2014


Author: kmoore
Date: Thu Apr  3 06:57:10 2014
New Revision: 411670

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411670
Log:
res_pjsip_pubsub: Add test event for state change

This adds a test event when subscription state changes so that
integration tests may trigger new actions at the appropriate times.

Review: https://reviewboard.asterisk.org/r/3383/

Modified:
    branches/12/res/res_pjsip_pubsub.c

Modified: branches/12/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_pubsub.c?view=diff&rev=411670&r1=411669&r2=411670
==============================================================================
--- branches/12/res/res_pjsip_pubsub.c (original)
+++ branches/12/res/res_pjsip_pubsub.c Thu Apr  3 06:57:10 2014
@@ -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)




More information about the asterisk-commits mailing list