[asterisk-commits] qwell: trunk r309300 - /trunk/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 2 15:08:43 CST 2011


Author: qwell
Date: Wed Mar  2 15:08:39 2011
New Revision: 309300

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309300
Log:
Add HangupRequest manager event, to specify when/where a channel gets hung up.

(closes issue #18226)
Reported by: clegall_proformatique
Patches: 
      asterisk_1.8_293157_hanguprequests.svn.patch uploaded by clegall proformatique (license 1139)

Modified:
    trunk/main/channel.c

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=309300&r1=309299&r2=309300
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed Mar  2 15:08:39 2011
@@ -1496,6 +1496,11 @@
 	/* Yeah, let's not change a lock-critical value without locking */
 	if (!ast_channel_trylock(chan)) {
 		chan->_softhangup |= AST_SOFTHANGUP_DEV;
+		manager_event(EVENT_FLAG_CALL, "HangupRequest",
+			"Channel: %s\r\n"
+			"Uniqueid: %s\r\n",
+			chan->name,
+			chan->uniqueid);
 		ast_channel_unlock(chan);
 	}
 	return ast_queue_frame(chan, &f);
@@ -1515,6 +1520,13 @@
 		if (cause < 0)
 			f.data.uint32 = chan->hangupcause;
 
+		manager_event(EVENT_FLAG_CALL, "HangupRequest",
+			"Channel: %s\r\n"
+			"Uniqueid: %s\r\n"
+			"Cause: %d\r\n",
+			chan->name,
+			chan->uniqueid,
+			cause);
 		ast_channel_unlock(chan);
 	}
 
@@ -2661,6 +2673,13 @@
 
 	ast_channel_lock(chan);
 	res = ast_softhangup_nolock(chan, cause);
+	manager_event(EVENT_FLAG_CALL, "SoftHangupRequest",
+		"Channel: %s\r\n"
+		"Uniqueid: %s\r\n"
+		"Cause: %d\r\n",
+		chan->name,
+		chan->uniqueid,
+		cause);
 	ast_channel_unlock(chan);
 
 	return res;




More information about the asterisk-commits mailing list