[Asterisk-code-review] res_pjsip: Give error when TLS transport configured but not supported. (asterisk[18])

Friendly Automation asteriskteam at digium.com
Wed Mar 31 10:17:41 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15714 )

Change subject: res_pjsip: Give error when TLS transport configured but not supported.
......................................................................

res_pjsip: Give error when TLS transport configured but not supported.

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

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



diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index 6e449c3..830b038 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -800,8 +800,8 @@
 			res = pjsip_tcp_transport_start3(ast_sip_get_pjsip_endpoint(), &cfg,
 				&temp_state->state->factory);
 		}
-#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0
 	} else if (transport->type == AST_TRANSPORT_TLS) {
+#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0
 		static int option = 1;
 
 		if (transport->async_operations > 1 && ast_compare_versions(pj_get_version(), "2.5.0") < 0) {
@@ -831,6 +831,10 @@
 				&temp_state->state->host, NULL, transport->async_operations,
 				&temp_state->state->factory);
 		}
+#else
+		ast_log(LOG_ERROR, "Transport: %s: PJSIP has not been compiled with TLS transport support, ensure OpenSSL development packages are installed\n",
+			ast_sorcery_object_get_id(obj));
+		return -1;
 #endif
 	} else if ((transport->type == AST_TRANSPORT_WS) || (transport->type == AST_TRANSPORT_WSS)) {
 		if (transport->cos || transport->tos) {

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I058af496021ff870ccec2d8cbade637b348ab80b
Gerrit-Change-Number: 15714
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/20210331/c6befbb5/attachment.html>


More information about the asterisk-code-review mailing list