summaryrefslogtreecommitdiff
path: root/channels/pjsip
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-01-13 12:06:50 +0000
committerJoshua Colp <jcolp@digium.com>2015-01-13 12:06:50 +0000
commit056f11ac65fb698ca26fd9a85e1eb81dbc2df381 (patch)
treee065b8c85b89a8fc80f3c0c1644549d945b9bc31 /channels/pjsip
parent368ecf13bf81d00b5b50d71a849116addf59a3bb (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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430546 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 03e4cbe1f..6069159f9 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);