[Asterisk-code-review] res pjsip endpoint identifier ip.c: Remove unnecessary requi... (asterisk[13])

Jenkins2 asteriskteam at digium.com
Thu Jan 11 13:27:50 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7898 )

Change subject: res_pjsip_endpoint_identifier_ip.c: Remove unnecessary requirement.
......................................................................

res_pjsip_endpoint_identifier_ip.c: Remove unnecessary requirement.

The requirement that "ip" must be in the endpoint identify_by list to
allow the type=identify method to identify the endpoint is not necessary.
The "ip" identifier method can match one and only one endpoint.  To even
work, the "ip" identifier method configuration must explicitly specify the
identified endpoint.  Therefore, why bother configuring the type=identify
identifier in the first place?  The requirement only adds the potential
for configuration errors for no benefit.  Even worse, those configuration
errors cannot be detected when the configuration loads.  The requirement
was introduced with the ASTERISK_27206 patch.

* Remove the code change that enforces the requiremnt.  Listing the "ip"
method in the identify_by value is simply documentation.

Change-Id: Ia057f92a33fb5d9f51dc5d5692e3d5ee1a6f2c11
---
M res/res_pjsip_endpoint_identifier_ip.c
1 file changed, 0 insertions(+), 7 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_endpoint_identifier_ip.c b/res/res_pjsip_endpoint_identifier_ip.c
index 5324af7..2341722 100644
--- a/res/res_pjsip_endpoint_identifier_ip.c
+++ b/res/res_pjsip_endpoint_identifier_ip.c
@@ -229,14 +229,7 @@
 	}
 
 	endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", match->endpoint_name);
-
 	if (endpoint) {
-		if (!(endpoint->ident_method & AST_SIP_ENDPOINT_IDENTIFY_BY_IP)) {
-			ast_debug(3, "Endpoint '%s' found for '%s' but 'ip' method not supported'\n", match->endpoint_name,
-				ast_sockaddr_stringify(&addr));
-			ao2_cleanup(endpoint);
-			return NULL;
-		}
 		ast_debug(3, "Retrieved endpoint %s\n", ast_sorcery_object_get_id(endpoint));
 	} else {
 		ast_log(LOG_WARNING, "Identify section '%s' points to endpoint '%s' but endpoint could not be looked up\n",

-- 
To view, visit https://gerrit.asterisk.org/7898
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia057f92a33fb5d9f51dc5d5692e3d5ee1a6f2c11
Gerrit-Change-Number: 7898
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180111/d41e0382/attachment.html>


More information about the asterisk-code-review mailing list