diff --git a/CHANGES b/CHANGES index 9402b41f10..d7034d345e 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,13 @@ app_voicemail * Added 'fromstring' field to the voicemail boxes. If set, it will override the global 'fromstring' field on a per-mailbox basis. +func_channel +------------------ + * Added CHANNEL(callid) to retrieve the call log tag associated with the + channel. e.g., [C-00000000] Dialplan now has access to the call log + search key associated with the channel so it can be saved in case there + is a problem with the call. + res_pjsip ------------------ * A new transport parameter 'symmetric_transport' has been added. diff --git a/funcs/func_channel.c b/funcs/func_channel.c index e816dcae00..26ef1b2b87 100644 --- a/funcs/func_channel.c +++ b/funcs/func_channel.c @@ -235,6 +235,10 @@ ASTERISK_REGISTER_FILE() R/W The maximum number of forwards allowed. + + R/O Call identifier log tag associated with the channel + e.g., [C-00000000]. + @@ -452,6 +456,16 @@ static int func_channel_read(struct ast_channel *chan, const char *function, ast_channel_lock(chan); snprintf(buf, len, "%d", ast_max_forwards_get(chan)); ast_channel_unlock(chan); + } else if (!strcasecmp(data, "callid")) { + ast_callid callid; + + buf[0] = '\0'; + ast_channel_lock(chan); + callid = ast_channel_callid(chan); + if (callid) { + ast_callid_strnprint(buf, len, callid); + } + ast_channel_unlock(chan); } else if (!ast_channel_tech(chan) || !ast_channel_tech(chan)->func_channel_read || ast_channel_tech(chan)->func_channel_read(chan, function, data, buf, len)) { ast_log(LOG_WARNING, "Unknown or unavailable item requested: '%s'\n", data); ret = -1;