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

George Joseph asteriskteam at digium.com
Mon Apr 6 09:15:39 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14057 )

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 2c30580..579165f 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/+/14057
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164
Gerrit-Change-Number: 14057
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200406/32168899/attachment-0001.html>


More information about the asterisk-code-review mailing list