<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1164/">https://reviewboard.asterisk.org/r/1164/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">i have walked about this review and i think it would be the easiest way to use a common flag for debuging like DEV_MODE.
then the patch would look like this:
Index: include/asterisk/channel.h
===================================================================
--- include/asterisk/channel.h        (Revision 348991)
+++ include/asterisk/channel.h        (Arbeitskopie)
@@ -1421,8 +1421,15 @@
* \param chan channel to hang up
* \return Returns 0 on success, -1 on failure.
*/
-int ast_hangup(struct ast_channel *chan);
+#ifdef AST_DEVMODE
+#define ast_hangup(chan)        __ast_hangup_debug(chan,__PRETTY_FUNCTION__,__FILE__,__LINE__)
+#else
+#define ast_hangup(chan)        __ast_hangup(chan)
+#endif
+int __ast_hangup_debug(struct ast_channel *chan, const char *func, const char *file, const int line);
+int __ast_hangup(struct ast_channel *chan);
+
/*!
* \brief Softly hangup up a channel
*
Index: main/channel.c
===================================================================
--- main/channel.c        (Revision 348991)
+++ main/channel.c        (Arbeitskopie)
@@ -2771,8 +2771,19 @@
        }
}
+
+/*! \brief Debug output whom started Hangup on a channel */
+int __ast_hangup_debug(struct ast_channel *chan, const char *func, const char *file, const int line)
+{
+
+        if (!chan->masq) {
+                ast_debug(1, "Starting hangup process on channel '%s' - called by %s() in %s, line %d\n", chan->name, func, file, line);
+        }
+        return __ast_hangup(chan);
+}
+
/*! \brief Hangup a channel */
-int ast_hangup(struct ast_channel *chan)
+int __ast_hangup(struct ast_channel *chan)
{
        char extra_str[64]; /* used for cel logging below */
still very easy but it really could help to find some issues easier.</pre>
<br />
<p>- schmidts</p>
<br />
<p>On April 7th, 2011, 6:21 a.m., Olle E Johansson wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Olle E Johansson.</div>
<p style="color: grey;"><i>Updated April 7, 2011, 6:21 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">In many cases when I develop crazy code, I get weird hangups. It may only happen to me, but it does happen. I need to know when a hangup process is initiated and by whom. This small patch is a first step towards that goal.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested in various versions of Asterisk. Seems to give me the output I need.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/19080">19080</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/include/asterisk/channel.h <span style="color: grey">(313005)</span></li>
<li>/trunk/main/channel.c <span style="color: grey">(313005)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1164/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>