From: Joshua C. Colp Date: Thu, 26 Mar 2020 22:42:27 +0000 (-0300) Subject: res_pjsip: Don't set endpoint to unavailable in all cases. X-Git-Tag: 13.33.0-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69805a772e8536546004a35bedc14af3896dc2a4;p=thirdparty%2Fasterisk.git res_pjsip: Don't set endpoint to unavailable in all cases. 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 --- diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index c88b1b8fd7..c4fe0b64f4 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -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),