[Asterisk-code-review] res_pjsip: Don't set endpoint to unavailable in all cases. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Thu Mar 26 17:51:04 CDT 2020


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14034 )


Change subject: res_pjsip: Don't set endpoint to unavailable in all cases.
......................................................................

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
---
M res/res_pjsip/pjsip_options.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/14034/1

diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index c88b1b8..c4fe0b6 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1667,8 +1667,11 @@
 		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),

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14034
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164
Gerrit-Change-Number: 14034
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200326/d64c47d5/attachment-0001.html>


More information about the asterisk-code-review mailing list