[svn-commits] rmudgett: branch rmudgett/misdn_facility r185839 - in /team/rmudgett/misdn_fa...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 1 09:33:30 CDT 2009


Author: rmudgett
Date: Wed Apr  1 09:33:22 2009
New Revision: 185839

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185839
Log:
Merged revisions 185811 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

........
  r185811 | mmichelson | 2009-04-01 09:24:23 -0500 (Wed, 01 Apr 2009) | 3 lines
  
  BUMP! BUMP! BUMP! BUMP! BUMP! BUMP! AUTO! M! ER! GGGGGG
........

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

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- misdn_facility (original)
+++ misdn_facility Wed Apr  1 09:33:22 2009
@@ -1,1 +1,1 @@
-/team/group/issue8824:1-185732
+/team/group/issue8824:1-185838

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr  1 09:33:22 2009
@@ -1,1 +1,1 @@
-/trunk:1-185681
+/trunk:1-185806

Modified: team/rmudgett/misdn_facility/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/CHANGES?view=diff&rev=185839&r1=185838&r2=185839
==============================================================================
--- team/rmudgett/misdn_facility/CHANGES (original)
+++ team/rmudgett/misdn_facility/CHANGES Wed Apr  1 09:33:22 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 for CCBS/CCNR feature ------------------------------

Modified: team/rmudgett/misdn_facility/include/asterisk/stringfields.h
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/include/asterisk/stringfields.h?view=diff&rev=185839&r1=185838&r2=185839
==============================================================================
--- team/rmudgett/misdn_facility/include/asterisk/stringfields.h (original)
+++ team/rmudgett/misdn_facility/include/asterisk/stringfields.h Wed Apr  1 09:33:22 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/rmudgett/misdn_facility/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/main/channel.c?view=diff&rev=185839&r1=185838&r2=185839
==============================================================================
--- team/rmudgett/misdn_facility/main/channel.c (original)
+++ team/rmudgett/misdn_facility/main/channel.c Wed Apr  1 09:33:22 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/rmudgett/misdn_facility/main/manager.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/main/manager.c?view=diff&rev=185839&r1=185838&r2=185839
==============================================================================
--- team/rmudgett/misdn_facility/main/manager.c (original)
+++ team/rmudgett/misdn_facility/main/manager.c Wed Apr  1 09:33:22 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 svn-commits mailing list