]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Don't set endpoint to unavailable in all cases.
authorJoshua C. Colp <jcolp@sangoma.com>
Thu, 26 Mar 2020 22:42:27 +0000 (19:42 -0300)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 6 Apr 2020 14:05:55 +0000 (09:05 -0500)
When an AOR is modified endpoints are updated that reference
the AOR so they can start receiving updates and reflect the
correct state. If this is the case then we shouldn't change
the endpoint to be offline if it does not reference the AOR
but instead only when the endpoint is completely updated for
all its AORs.

ASTERISK-28056
patches:
  pjsip_options-aor.diff submitted by jhord (license 6978)

Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164

res/res_pjsip/pjsip_options.c

index 2c305802fe63c8bb878801072f1832d4132572a8..579165fdde42f3a0f278cf3c8fc8225f58835bf4 100644 (file)
@@ -1667,8 +1667,11 @@ static int sip_options_synchronize_endpoint(void *obj, void *arg, int flags)
                ao2_unlock(task_data.endpoint_state_compositor);
 
                ao2_ref(task_data.endpoint_state_compositor, -1);
-       } else {
-               /* If there is none then they may have referenced an invalid AOR or none at all */
+       } else if (!aor) {
+               /* If no explicit AOR is specified we are updating the endpoint itself, so then set
+                * it to offline if no endpoint compositor exists as they referenced an invalid AOR
+                * or none at all
+                */
                ast_debug(3, "Endpoint '%s' has no AORs feeding it, setting it to offline state as default\n",
                        ast_sorcery_object_get_id(endpoint));
                ast_sip_persistent_endpoint_update_state(ast_sorcery_object_get_id(endpoint),