[asterisk-commits] jrose: trunk r370225 - /trunk/main/channel_internal_api.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 18 14:48:13 CDT 2012
Author: jrose
Date: Wed Jul 18 14:48:09 2012
New Revision: 370225
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370225
Log:
callid logging: Issue test events when the callid is changed for a channel
Modified:
trunk/main/channel_internal_api.c
Modified: trunk/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel_internal_api.c?view=diff&rev=370225&r1=370224&r2=370225
==============================================================================
--- trunk/main/channel_internal_api.c (original)
+++ trunk/main/channel_internal_api.c Wed Jul 18 14:48:09 2012
@@ -43,6 +43,7 @@
#include "asterisk/data.h"
#include "asterisk/indications.h"
#include "asterisk/channel_internal.h"
+#include "asterisk/test.h"
/*!
* \brief Main Channel structure associated with a channel.
@@ -846,20 +847,28 @@
}
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 ((option_debug >= 3) || (ast_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= 3)) {
- 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);
- }
-
+ ast_callid_strnprint(call_identifier_from, sizeof(call_identifier_from), chan->callid);
+ ast_debug(3, "Channel Call ID changing from %s to %s\n", call_identifier_from, call_identifier_to);
/* unbind if already set */
ast_callid_unref(chan->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)
{
More information about the asterisk-commits
mailing list