Merge "channels/pjsip/dialplan_functions: Add an option for extracting the SIP call-id"
authorMatt Jordan <mjordan@digium.com>
Sat, 5 Sep 2015 23:43:50 +0000 (18:43 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Sat, 5 Sep 2015 23:43:50 +0000 (18:43 -0500)
CHANGES
channels/pjsip/dialplan_functions.c

diff --git a/CHANGES b/CHANGES
index 322419d..8c8329c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -177,6 +177,18 @@ cdr_adaptive_odbc
    names. This setting is configurable for cdr_adaptive_odbc via the
    quoted_identifiers in configuration file cdr_adaptive_odbc.conf.
 
+
+------------------------------------------------------------------------------
+--- Functionality changes from Asterisk 13.5.0 to Asterisk 13.6.0 ------------
+------------------------------------------------------------------------------
+
+Dialplan Functions
+------------------
+ * The CHANNEL function, when used on a PJSIP channel, now exposes a 'call-id'
+   extraction option when using with the 'pjsip' signalling option. It will
+   return the SIP Call-ID associated with the INVITE request that established
+   the PJSIP channel.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 13.4.0 to Asterisk 13.5.0 ------------
 ------------------------------------------------------------------------------
index 24daac8..b86cfad 100644 (file)
                                <literal>type</literal> parameter must be provided. It specifies
                                which signalling parameter to read.</para>
                                <enumlist>
+                                       <enum name="call-id">
+                                               <para>The SIP call-id.</para>
+                                       </enum>
                                        <enum name="secure">
                                                <para>Whether or not the signalling uses a secure transport.</para>
                                                <enumlist>
@@ -594,6 +597,8 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const
        if (ast_strlen_zero(type)) {
                ast_log(LOG_WARNING, "You must supply a type field for 'pjsip' information\n");
                return -1;
+       } else if (!strcmp(type, "call-id")) {
+               snprintf(buf, buflen, "%.*s", (int) pj_strlen(&dlg->call_id->id), pj_strbuf(&dlg->call_id->id));
        } else if (!strcmp(type, "secure")) {
 #ifdef HAVE_PJSIP_GET_DEST_INFO
                pjsip_host_info dest;