Skip to content
Snippets Groups Projects
Commit 78d0b9d9 authored by Matt Jordan's avatar Matt Jordan
Browse files

channels/pjsip/dialplan_functions: Add an option for extracting the SIP call-id

This patch adds a new option to the CHANNEL function that allows for the
extraction of the SIP call-id. It is used in conjunction with the 'pjsip'
option, and will return the Call-ID of the INVITE request that established
the PJSIP channel.

ASTERISK-25352

Change-Id: I278d1f8bcfe3a53c5aa1dadebc14e92b0abd476a
parent d238cf33
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,17 @@ ...@@ -8,6 +8,17 @@
=== ===
============================================================================== ==============================================================================
------------------------------------------------------------------------------
--- 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 ------------ --- Functionality changes from Asterisk 13.4.0 to Asterisk 13.5.0 ------------
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
......
...@@ -318,6 +318,9 @@ ...@@ -318,6 +318,9 @@
<literal>type</literal> parameter must be provided. It specifies <literal>type</literal> parameter must be provided. It specifies
which signalling parameter to read.</para> which signalling parameter to read.</para>
<enumlist> <enumlist>
<enum name="call-id">
<para>The SIP call-id.</para>
</enum>
<enum name="secure"> <enum name="secure">
<para>Whether or not the signalling uses a secure transport.</para> <para>Whether or not the signalling uses a secure transport.</para>
<enumlist> <enumlist>
...@@ -594,6 +597,8 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const ...@@ -594,6 +597,8 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const
if (ast_strlen_zero(type)) { if (ast_strlen_zero(type)) {
ast_log(LOG_WARNING, "You must supply a type field for 'pjsip' information\n"); ast_log(LOG_WARNING, "You must supply a type field for 'pjsip' information\n");
return -1; 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")) { } else if (!strcmp(type, "secure")) {
#ifdef HAVE_PJSIP_GET_DEST_INFO #ifdef HAVE_PJSIP_GET_DEST_INFO
pjsip_host_info dest; pjsip_host_info dest;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment