]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pjsip_distributor.c: Ignore messages until fully booted. 47/2947/2
authorRichard Mudgett <rmudgett@digium.com>
Thu, 2 Jun 2016 17:51:31 +0000 (12:51 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 7 Jun 2016 18:16:18 +0000 (13:16 -0500)
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

CHANGES
res/res_pjsip/pjsip_distributor.c

diff --git a/CHANGES b/CHANGES
index 41c7bc2b366d97569149487eff5d5bf9b24439aa..8d740f13a637c7bd4cf43f3930b9ff5408664bbb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -52,6 +52,9 @@ res_pjsip
    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
index 3867eaea0c8c838df76c590e7760b1c88ffa2e87..288a3e00a883c8565472a1dbf0c257bdb6e43976 100644 (file)
@@ -290,11 +290,20 @@ static pjsip_module endpoint_mod = {
 
 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));