summaryrefslogtreecommitdiff
path: root/channels/pjsip
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-01-13 12:09:45 +0000
committerJoshua Colp <jcolp@digium.com>2015-01-13 12:09:45 +0000
commit0e631a541dc8881861ded54a2bd66227e2233a57 (patch)
treea8adf954adbe984c8b07bb64e4d83da9318a6268 /channels/pjsip
parent4dd6b6ff5974d87fd754e47962472437a784736b (diff)
chan_pjsip: Add configure check for 'pjsip_get_dest_info' function.
The 'pjsip_get_dest_info' function is used to determine if the signaling transport of the dialog is secure or not. This function was added in PJSIP 2.3 and does not exist in earlier versions. This configure check allows Asterisk to build and run with older versions at the loss of the 'secure' argument for the PJSIP CHANNEL dialplan function. Usage of this argument will require upgrading to PJSIP 2.3. ASTERISK-24665 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/4329/ ........ Merged revisions 430546 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/pjsip')
-rw-r--r--channels/pjsip/dialplan_functions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c
index 704f6a4b2..91044a618 100644
--- a/channels/pjsip/dialplan_functions.c
+++ b/channels/pjsip/dialplan_functions.c
@@ -592,11 +592,16 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const
dlg = channel->session->inv_session->dlg;
if (!strcmp(type, "secure")) {
+#ifdef HAVE_PJSIP_GET_DEST_INFO
pjsip_host_info dest;
pj_pool_t *pool = pjsip_endpt_create_pool(ast_sip_get_pjsip_endpoint(), "secure-check", 128, 128);
pjsip_get_dest_info(dlg->target, NULL, pool, &dest);
snprintf(buf, buflen, "%d", dest.flag & PJSIP_TRANSPORT_SECURE ? 1 : 0);
pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
+#else
+ ast_log(LOG_WARNING, "Asterisk has been built against a version of pjproject which does not have the required functionality to support the 'secure' argument. Please upgrade to version 2.3 or later.\n");
+ return -1;
+#endif
} else if (!strcmp(type, "target_uri")) {
pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->target, buf, buflen);
buf_copy = ast_strdupa(buf);