From 0e631a541dc8881861ded54a2bd66227e2233a57 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 13 Jan 2015 12:09:45 +0000 Subject: 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 --- channels/pjsip/dialplan_functions.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'channels/pjsip') 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); -- cgit v1.2.3