[asterisk-commits] pjsip distributor.c: Ignore messages until fully booted. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 9 16:17:34 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: pjsip_distributor.c: Ignore messages until fully booted.
......................................................................


pjsip_distributor.c: Ignore messages until fully booted.

We should not be processing any incoming messages until we are fully
booted.  We may not have dialplan or other needed configuration loaded
yet.

ASTERISK-26089 #close
Reported by: Scott Griepentrog

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I584aefb4f34b885a8927e1f13a2c64babd606264
---
M CHANGES
M res/res_pjsip/pjsip_distributor.c
2 files changed, 13 insertions(+), 1 deletion(-)

Approvals:
  Scott Griepentrog: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/CHANGES b/CHANGES
index 43dc18f..56daf17 100644
--- a/CHANGES
+++ b/CHANGES
@@ -397,6 +397,9 @@
    into the "reg_server" field in the ps_contacts table to facilitate
    multi-server setups.
 
+ * When starting Asterisk, received traffic will now be ignored until Asterisk
+   has loaded all modules and is fully booted.
+
 res_hep
 ------------------
  * Added a new option, 'uuid_type', that sets the preferred source of the Homer
diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index 3867eae..288a3e0 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -290,11 +290,20 @@
 
 static pj_bool_t distributor(pjsip_rx_data *rdata)
 {
-	pjsip_dialog *dlg = find_dialog(rdata);
+	pjsip_dialog *dlg;
 	struct distributor_dialog_data *dist = NULL;
 	struct ast_taskprocessor *serializer = NULL;
 	pjsip_rx_data *clone;
 
+	if (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+		/*
+		 * Ignore everything until we are fully booted.  Let the
+		 * peer retransmit messages until we are ready.
+		 */
+		return PJ_TRUE;
+	}
+
+	dlg = find_dialog(rdata);
 	if (dlg) {
 		ast_debug(3, "Searching for serializer on dialog %s for %s\n",
 			dlg->obj_name, pjsip_rx_data_get_info(rdata));

-- 
To view, visit https://gerrit.asterisk.org/2982
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I584aefb4f34b885a8927e1f13a2c64babd606264
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-commits mailing list