Skip to content
Snippets Groups Projects
Commit 5e4ee607 authored by Jonathan Rose's avatar Jonathan Rose
Browse files

callid logging: Issue test events when the callid is changed for a channel

parent 4a4189b0
Branches
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") ...@@ -43,6 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/data.h" #include "asterisk/data.h"
#include "asterisk/indications.h" #include "asterisk/indications.h"
#include "asterisk/channel_internal.h" #include "asterisk/channel_internal.h"
#include "asterisk/test.h"
/*! /*!
* \brief Main Channel structure associated with a channel. * \brief Main Channel structure associated with a channel.
...@@ -846,20 +847,28 @@ struct ast_callid *ast_channel_callid(const struct ast_channel *chan) ...@@ -846,20 +847,28 @@ struct ast_callid *ast_channel_callid(const struct ast_channel *chan)
} }
void ast_channel_callid_set(struct ast_channel *chan, struct ast_callid *callid) void ast_channel_callid_set(struct ast_channel *chan, struct ast_callid *callid)
{ {
char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
call_identifier_from[0] = '\0';
ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
if (chan->callid) { if (chan->callid) {
ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
if ((option_debug >= 3) || (ast_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= 3)) { ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
char call_identifier_from[AST_CALLID_BUFFER_LENGTH];
char call_identifier_to[AST_CALLID_BUFFER_LENGTH];
ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
ast_callid_strnprint(call_identifier_to, sizeof(call_identifier_to), callid);
ast_log(LOG_DEBUG, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
}
/* unbind if already set */ /* unbind if already set */
ast_callid_unref(chan->callid); ast_callid_unref(chan->callid);
} }
chan->callid = ast_callid_ref(callid); chan->callid = ast_callid_ref(callid);
ast_test_suite_event_notify("CallIDChange",
"State: CallIDChange\r\n"
"Channel: %s\r\n"
"CallID: %s\r\n"
"PriorCallID: %s\r\n",
ast_channel_name(chan),
call_identifier_to,
call_identifier_from);
} }
void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state value) void ast_channel_state_set(struct ast_channel *chan, enum ast_channel_state value)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment