[asterisk-commits] mmichelson: branch group/issue8824 r185811 - in /team/group/issue8824: ./ inc...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 1 09:24:31 CDT 2009


Author: mmichelson
Date: Wed Apr  1 09:24:23 2009
New Revision: 185811

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185811
Log:
BUMP! BUMP! BUMP! BUMP! BUMP! BUMP! AUTO! M! ER! GGGGGG


Modified:
    team/group/issue8824/   (props changed)
    team/group/issue8824/CHANGES
    team/group/issue8824/include/asterisk/stringfields.h
    team/group/issue8824/main/channel.c
    team/group/issue8824/main/manager.c

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr  1 09:24:23 2009
@@ -1,1 +1,1 @@
-/trunk:1-185681
+/trunk:1-185806

Modified: team/group/issue8824/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/CHANGES?view=diff&rev=185811&r1=185810&r2=185811
==============================================================================
--- team/group/issue8824/CHANGES (original)
+++ team/group/issue8824/CHANGES Wed Apr  1 09:24:23 2009
@@ -62,6 +62,11 @@
     'rpid' and 'pai'. Setting sendrpid to 'rpid' will cause Remote-Party-ID
     header to be sent (equivalent to setting sendrpid=yes) and setting
     sendrpid to 'pai' will cause P-Asserted-Identity header to be sent.
+
+Asterisk Manager Interface
+--------------------------
+ * The Hangup action now accepts a Cause header which may be used to
+   set the channel's hangup cause.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.1 to Asterisk 1.6.2  -------------

Modified: team/group/issue8824/include/asterisk/stringfields.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/include/asterisk/stringfields.h?view=diff&rev=185811&r1=185810&r2=185811
==============================================================================
--- team/group/issue8824/include/asterisk/stringfields.h (original)
+++ team/group/issue8824/include/asterisk/stringfields.h Wed Apr  1 09:24:23 2009
@@ -290,7 +290,7 @@
 		if (*__p__ != (*ptr)) {											\
 			__ast_string_field_release_active((x)->__field_mgr_pool, (*ptr));				\
 		}													\
-		memcpy((void *) *__p__, __d__, __dlen__);								\
+		memcpy(* (void **) __p__, __d__, __dlen__);								\
 	}														\
 	} while (0)
 

Modified: team/group/issue8824/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/main/channel.c?view=diff&rev=185811&r1=185810&r2=185811
==============================================================================
--- team/group/issue8824/main/channel.c (original)
+++ team/group/issue8824/main/channel.c Wed Apr  1 09:24:23 2009
@@ -3111,6 +3111,13 @@
 					ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF);
 					chan->emulate_dtmf_digit = 0;
 					ast_log(LOG_DTMF, "DTMF end emulation of '%c' queued on %s\n", f->subclass, chan->name);
+					if (chan->audiohooks) {
+						struct ast_frame *old_frame = f;
+						f = ast_audiohook_write_list(chan, chan->audiohooks, AST_AUDIOHOOK_DIRECTION_READ, f);
+						if (old_frame != f) {
+							ast_frfree(old_frame);
+						}
+					}
 				}
 			}
 			break;

Modified: team/group/issue8824/main/manager.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/main/manager.c?view=diff&rev=185811&r1=185810&r2=185811
==============================================================================
--- team/group/issue8824/main/manager.c (original)
+++ team/group/issue8824/main/manager.c Wed Apr  1 09:24:23 2009
@@ -1759,22 +1759,39 @@
 static char mandescr_hangup[] =
 "Description: Hangup a channel\n"
 "Variables: \n"
-"	Channel: The channel name to be hungup\n";
+"	Channel: The channel name to be hungup\n"
+"	Cause: numeric hangup cause\n";
 
 static int action_hangup(struct mansession *s, const struct message *m)
 {
 	struct ast_channel *c = NULL;
+	int causecode = 0; /* all values <= 0 mean 'do not set hangupcause in channel' */
 	const char *name = astman_get_header(m, "Channel");
+	const char *cause = astman_get_header(m, "Cause");
 	if (ast_strlen_zero(name)) {
 		astman_send_error(s, m, "No channel specified");
 		return 0;
+	}
+	if (!ast_strlen_zero(cause)) {
+		char *endptr;
+		causecode = strtol(cause, &endptr, 10);
+		if (causecode < 0 || causecode > 127 || *endptr != '\0') {
+			ast_log(LOG_NOTICE, "Invalid 'Cause: %s' in manager action Hangup\n", cause);
+			/* keep going, better to hangup without cause than to not hang up at all */
+			causecode = 0; /* do not set channel's hangupcause */
+		}
 	}
 	c = ast_get_channel_by_name_locked(name);
 	if (!c) {
 		astman_send_error(s, m, "No such channel");
 		return 0;
 	}
-	ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
+	if (causecode > 0) {
+		ast_debug(1, "Setting hangupcause of channel %s to %d (is %d now)\n",
+				c->name, causecode, c->hangupcause);
+		c->hangupcause = causecode;
+	}
+	ast_softhangup_nolock(c, AST_SOFTHANGUP_EXPLICIT);
 	ast_channel_unlock(c);
 	astman_send_ack(s, m, "Channel Hungup");
 	return 0;




More information about the asterisk-commits mailing list