[Asterisk-code-review] res pjsip: Ignore empty TLS configuration (asterisk[master])

Jenkins2 asteriskteam at digium.com
Tue Nov 7 11:05:14 CST 2017


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

Change subject: res_pjsip: Ignore empty TLS configuration
......................................................................

res_pjsip: Ignore empty TLS configuration

When using realtime, fields that are not explicitly set by an
administrator are still presented to sorcery as empty strings. Handle
this case explicitly.

In this particular case, if any of these fields are required for TLS
support, their existence should be validated in the 'apply' handler once
we have a complete transport definition.

ASTERISK-27032 #close
Reported by: seanchann.zhou

Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7
---
M res/res_pjsip/config_transport.c
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index 0c804b8..2f29456 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -683,6 +683,11 @@
 		return -1;
 	}
 
+	if (ast_strlen_zero(var->value)) {
+		/* Ignore empty options */
+		return 0;
+	}
+
 	if (!ast_file_is_readable(var->value)) {
 		ast_log(LOG_ERROR, "Transport: %s: %s %s is either missing or not readable\n",
 			ast_sorcery_object_get_id(obj), var->name, var->value);

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7
Gerrit-Change-Number: 7007
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph 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/20171107/00cf9e14/attachment.html>


More information about the asterisk-code-review mailing list