[svn-commits] rmudgett: branch dvossel/generic_aoc r258302 - in /team/dvossel/generic_aoc: ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 21 10:19:24 CDT 2010


Author: rmudgett
Date: Wed Apr 21 10:19:22 2010
New Revision: 258302

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258302
Log:
Merged revisions 257834,257909,257944,257971,258010,258087,258131,258172,258212,258250,258301 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/rmudgett/aoc_event

................
  r257834 | root | 2010-04-19 13:22:35 -0500 (Mon, 19 Apr 2010) | 19 lines
  
  Merged revisions 257813 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r257813 | root | 2010-04-19 13:17:32 -0500 (Mon, 19 Apr 2010) | 12 lines
    
    Merged revisions 257810 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r257810 | twilson | 2010-04-19 12:57:41 -0500 (Mon, 19 Apr 2010) | 5 lines
      
      Fix incomplete CDR merge from r195881
      
      Because res/res_features.c was removed and main/cdr.c added, these changes
      didn't make it to trunk and the 1.6.x branches
    ........
  ................
................
  r257909 | root | 2010-04-19 14:29:49 -0500 (Mon, 19 Apr 2010) | 35 lines
  
  Merged revisions 257860 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r257860 | root | 2010-04-19 14:17:57 -0500 (Mon, 19 Apr 2010) | 28 lines
    
    Merged revisions 257851,257857 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ................
      r257851 | mmichelson | 2010-04-19 13:42:31 -0500 (Mon, 19 Apr 2010) | 12 lines
      
      Commit compromise I suggested on review 608.
      
      This allows for multiple SRV queries to be done
      from the dialplan for the same service on a single call while
      still allowing one to bypass the call to SRVQUERY if they so
      please.
      
      Taking action since no comments had been left for a while.
      This can easily be reverted if needed. External tests
      still pass.
    ................
      r257857 | jpeeler | 2010-04-19 14:10:18 -0500 (Mon, 19 Apr 2010) | 8 lines
      
      Blocked revisions 257856 via svnmerge
      
      ........
        r257856 | jpeeler | 2010-04-19 14:09:46 -0500 (Mon, 19 Apr 2010) | 1 line
        
        make app_voicemail compile with IMAP_STORAGE
      ........
    ................
  ................
................
  r257944 | root | 2010-04-19 15:21:38 -0500 (Mon, 19 Apr 2010) | 16 lines
  
  Merged revisions 257930 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r257930 | root | 2010-04-19 15:17:46 -0500 (Mon, 19 Apr 2010) | 9 lines
    
    Merged revisions 257883 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r257883 | tilghman | 2010-04-19 14:23:41 -0500 (Mon, 19 Apr 2010) | 2 lines
      
      Bad merge fix
    ........
  ................
................
  r257971 | root | 2010-04-19 17:22:44 -0500 (Mon, 19 Apr 2010) | 24 lines
  
  Merged revisions 257952 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r257952 | root | 2010-04-19 17:17:47 -0500 (Mon, 19 Apr 2010) | 17 lines
    
    Merged revisions 257947,257949 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r257947 | qwell | 2010-04-19 16:49:30 -0500 (Mon, 19 Apr 2010) | 6 lines
      
      Don't consider a missing indications.conf to be a critical error.
      
      There were many changes in revision 176627 which would avoid the error that a
      missing config would have caused.  Other than this, there are no other config
      files (including asterisk.conf, surprisingly) that are required.
    ........
      r257949 | qwell | 2010-04-19 16:57:56 -0500 (Mon, 19 Apr 2010) | 1 line
      
      Change log message to match severity.
    ........
  ................
................
  r258010 | root | 2010-04-20 08:23:11 -0500 (Tue, 20 Apr 2010) | 19 lines
  
  Merged revisions 257990 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r257990 | root | 2010-04-20 08:17:44 -0500 (Tue, 20 Apr 2010) | 12 lines
    
    Merged revisions 257988 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r257988 | lmadsen | 2010-04-20 07:38:47 -0500 (Tue, 20 Apr 2010) | 4 lines
      
      Update supported file extensions in doxygen.
      
      Updated the doxygen \arg line after looking at the file for some other Asterisk documentation
      and noticing they weren't up to date. Thanks to seanbright for looking at the code for me :)
    ........
  ................
................
  r258087 | root | 2010-04-20 12:23:06 -0500 (Tue, 20 Apr 2010) | 31 lines
  
  Merged revisions 258067 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r258067 | root | 2010-04-20 12:17:48 -0500 (Tue, 20 Apr 2010) | 24 lines
    
    Merged revisions 258065 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ................
      r258065 | jpeeler | 2010-04-20 12:06:19 -0500 (Tue, 20 Apr 2010) | 17 lines
      
      Merged revisions 258029 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r258029 | jpeeler | 2010-04-20 11:16:33 -0500 (Tue, 20 Apr 2010) | 11 lines
        
        Play correct prompt when voicemail store failure occurs after attempted forward.
        
        If a user's mailbox was full and a message was attempted to be forwarded to
        said box, warnings on the console would indicate failure. However, the played
        prompt was that of success (vm-msgsaved). Now storage failure is taken into
        account and the correct prompt (vm-mailboxfull) is played when appropriate.
        
        ABE-2123
        SWP-1262
      ........
    ................
  ................
................
  r258131 | root | 2010-04-20 13:23:20 -0500 (Tue, 20 Apr 2010) | 22 lines
  
  Merged revisions 258110 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r258110 | root | 2010-04-20 13:17:46 -0500 (Tue, 20 Apr 2010) | 15 lines
    
    Merged revisions 258106 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r258106 | lmadsen | 2010-04-20 13:01:28 -0500 (Tue, 20 Apr 2010) | 7 lines
      
      Add missing 'useragent' field to sip-friends.sql file.
      
      (closes issue #17171)
      Reported by: thehar
      Patches: 
            sip-friends.patch uploaded by thehar (license 831)
      Tested by: pabelanger, thehar
    ........
  ................
................
  r258172 | root | 2010-04-20 14:22:58 -0500 (Tue, 20 Apr 2010) | 27 lines
  
  Merged revisions 258152 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r258152 | root | 2010-04-20 14:17:46 -0500 (Tue, 20 Apr 2010) | 20 lines
    
    Merged revisions 258147,258149 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r258147 | lmadsen | 2010-04-20 13:38:39 -0500 (Tue, 20 Apr 2010) | 8 lines
      
      Add example dialplan for dialing ISN numbers (http://www.freenum.org).
      Minor tweaks and documentation added by me.
      
      (closes issue #17058)
      Reported by: pprindeville
      Patches: 
            freenum.patch#5 uploaded by pprindeville (license 347)
      Tested by: lmadsen
    ........
      r258149 | lmadsen | 2010-04-20 14:02:49 -0500 (Tue, 20 Apr 2010) | 1 line
      
      Add 'soft hangup' alias per Steve Johnson on asterisk-users.
    ........
  ................
................
  r258212 | root | 2010-04-21 07:23:11 -0500 (Wed, 21 Apr 2010) | 16 lines
  
  Merged revisions 258192 via svnmerge from 
  file:///srv/subversion/repos/asterisk/team/group/CCSS
  
  ................
    r258192 | root | 2010-04-21 07:17:47 -0500 (Wed, 21 Apr 2010) | 9 lines
    
    Merged revisions 258190 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r258190 | jmls | 2010-04-21 06:27:27 -0500 (Wed, 21 Apr 2010) | 2 lines
      
      Added a new feature to audiohooks so that you can mute either read / write or both types of frames - this allows for MixMonitor to mute either side of the conversation without affecting the conversation itself.
    ........
  ................
................
  r258250 | root | 2010-04-21 08:23:04 -0500 (Wed, 21 Apr 2010) | 1 line
  
  automerge cancel
................
  r258301 | rmudgett | 2010-04-21 09:56:39 -0500 (Wed, 21 Apr 2010) | 36 lines
  
  Merged revisions 258230,258268 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/team/group/CCSS
  
  ................
    r258230 | root | 2010-04-21 08:17:45 -0500 (Wed, 21 Apr 2010) | 14 lines
    
    Merged revisions 258227-258228 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r258227 | jmls | 2010-04-21 07:48:32 -0500 (Wed, 21 Apr 2010) | 1 line
      
      Added CHANGES entry for new MixMonitorMute AMI command.
    ........
      r258228 | jmls | 2010-04-21 08:08:44 -0500 (Wed, 21 Apr 2010) | 2 lines
      
      Added NEW ACTIONS entry for new MixMonitorMute AMI command.
      Added State and Direction variables for new MixMonitorMute AMI command.
    ........
  ................
    r258268 | root | 2010-04-21 09:17:44 -0500 (Wed, 21 Apr 2010) | 13 lines
    
    Merged revisions 258256,258265 via svnmerge from 
    file:///srv/subversion/repos/asterisk/trunk
    
    ........
      r258256 | jmls | 2010-04-21 08:24:28 -0500 (Wed, 21 Apr 2010) | 1 line
      
      fix whitespace issue
    ........
      r258265 | lmadsen | 2010-04-21 08:26:28 -0500 (Wed, 21 Apr 2010) | 1 line
      
      Fix the \brief description in the res_calendar_*.c files.
    ........
  ................
................

Modified:
    team/dvossel/generic_aoc/   (props changed)
    team/dvossel/generic_aoc/CHANGES
    team/dvossel/generic_aoc/apps/app_mixmonitor.c
    team/dvossel/generic_aoc/apps/app_voicemail.c
    team/dvossel/generic_aoc/configs/cli_aliases.conf.sample
    team/dvossel/generic_aoc/configs/extensions.conf.sample
    team/dvossel/generic_aoc/contrib/scripts/sip-friends.sql
    team/dvossel/generic_aoc/doc/manager_1_1.txt
    team/dvossel/generic_aoc/doc/tex/manager.tex
    team/dvossel/generic_aoc/formats/format_pcm.c
    team/dvossel/generic_aoc/include/asterisk/audiohook.h
    team/dvossel/generic_aoc/include/asterisk/frame.h
    team/dvossel/generic_aoc/main/audiohook.c
    team/dvossel/generic_aoc/main/frame.c
    team/dvossel/generic_aoc/main/indications.c
    team/dvossel/generic_aoc/res/res_calendar_caldav.c
    team/dvossel/generic_aoc/res/res_calendar_exchange.c
    team/dvossel/generic_aoc/res/res_calendar_icalendar.c
    team/dvossel/generic_aoc/res/res_mutestream.c

Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- aoc_event-integrated (original)
+++ aoc_event-integrated Wed Apr 21 10:19:22 2010
@@ -1,1 +1,1 @@
-/team/group/CCSS:1-257792
+/team/group/CCSS:1-258300

Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- generic_aoc-integrated (original)
+++ generic_aoc-integrated Wed Apr 21 10:19:22 2010
@@ -1,1 +1,1 @@
-/team/rmudgett/aoc_event:1-257808
+/team/rmudgett/aoc_event:1-258301

Modified: team/dvossel/generic_aoc/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/CHANGES?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/CHANGES (original)
+++ team/dvossel/generic_aoc/CHANGES Wed Apr 21 10:19:22 2010
@@ -357,6 +357,8 @@
    location than the first.
  * Added new event "JabberStatus" in the Jabber module to monitor buddies
    status.
+ * Added a "MixMonitorMute" AMI action for muting inbound and/or outbound audio
+   in a MixMonitor recording.
  * Added Advice-Of-Charge events (AOC-S, AOC-D, and AOC-E) in the new
    aoc event class.
 

Modified: team/dvossel/generic_aoc/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/apps/app_mixmonitor.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/apps/app_mixmonitor.c (original)
+++ team/dvossel/generic_aoc/apps/app_mixmonitor.c Wed Apr 21 10:19:22 2010
@@ -46,6 +46,7 @@
 #include "asterisk/app.h"
 #include "asterisk/channel.h"
 #include "asterisk/autochan.h"
+#include "asterisk/manager.h"
 
 /*** DOCUMENTATION
 	<application name="MixMonitor" language="en_US">
@@ -124,7 +125,27 @@
 			<ref type="application">MixMonitor</ref>
 		</see-also>
 	</application>
-		
+	<manager name="MixMonitorMute" language="en_US">
+		<synopsis>
+			Mute / unMute a Mixmonitor recording.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Used to specify the channel to mute.</para>
+			</parameter>
+			<parameter name="Direction">
+				<para>Which part of the recording to mute:  read, write or both (from channel, to channel or both channels).</para>
+			</parameter>
+			<parameter name="State">
+				<para>Turn mute on or off : 1 to turn on, 0 to turn off.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action may be used to mute a MixMonitor recording.</para>
+		</description>
+	</manager>
+
  ***/
 
 #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
@@ -606,6 +627,73 @@
 	return CLI_SUCCESS;
 }
 
+/*! \brief  Mute / unmute  a MixMonitor channel */
+static int manager_mute_mixmonitor(struct mansession *s, const struct message *m)
+{
+	struct ast_channel *c = NULL;
+
+	const char *name = astman_get_header(m, "Channel");
+	const char *id = astman_get_header(m, "ActionID");
+	const char *state = astman_get_header(m, "State");
+	const char *direction = astman_get_header(m,"Direction");
+
+	int clearmute = 1;
+
+	enum ast_audiohook_flags flag;
+
+	if (ast_strlen_zero(direction)) {
+		astman_send_error(s, m, "No direction specified. Must be read, write or both");
+		return AMI_SUCCESS;
+	}
+
+	if (!strcasecmp(direction, "read")) {
+		flag = AST_AUDIOHOOK_MUTE_READ;
+	} else  if (!strcasecmp(direction, "write")) {
+		flag = AST_AUDIOHOOK_MUTE_WRITE;
+	} else  if (!strcasecmp(direction, "both")) {
+		flag = AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE;
+	} else {
+		astman_send_error(s, m, "Invalid direction specified. Must be read, write or both");
+		return AMI_SUCCESS;
+	}
+
+	if (ast_strlen_zero(name)) {
+		astman_send_error(s, m, "No channel specified");
+		return AMI_SUCCESS;
+	}
+
+	if (ast_strlen_zero(state)) {
+		astman_send_error(s, m, "No state specified");
+		return AMI_SUCCESS;
+	}
+
+	clearmute = ast_false(state);
+	c = ast_channel_get_by_name(name);
+
+	if (!c) {
+		astman_send_error(s, m, "No such channel");
+		return AMI_SUCCESS;
+	}
+
+	if (ast_audiohook_set_mute(c, mixmonitor_spy_type, flag, clearmute)) {
+		c = ast_channel_unref(c);
+		astman_send_error(s, m, "Cannot set mute flag");
+		return AMI_SUCCESS;
+	}
+
+	astman_append(s, "Response: Success\r\n");
+
+	if (!ast_strlen_zero(id)) {
+		astman_append(s, "ActionID: %s\r\n", id);
+	}
+
+	astman_append(s, "\r\n");
+
+	c = ast_channel_unref(c);
+
+	return AMI_SUCCESS;
+}
+
 static struct ast_cli_entry cli_mixmonitor[] = {
 	AST_CLI_DEFINE(handle_cli_mixmonitor, "Execute a MixMonitor command")
 };
@@ -617,6 +705,7 @@
 	ast_cli_unregister_multiple(cli_mixmonitor, ARRAY_LEN(cli_mixmonitor));
 	res = ast_unregister_application(stop_app);
 	res |= ast_unregister_application(app);
+	res |= ast_manager_unregister("MixMonitorMute");
 	
 	return res;
 }
@@ -628,6 +717,7 @@
 	ast_cli_register_multiple(cli_mixmonitor, ARRAY_LEN(cli_mixmonitor));
 	res = ast_register_application_xml(app, mixmonitor_exec);
 	res |= ast_register_application_xml(stop_app, stop_mixmonitor_exec);
+	res |= ast_manager_register_xml("MixMonitorMute", 0, manager_mute_mixmonitor);
 
 	return res;
 }

Modified: team/dvossel/generic_aoc/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/apps/app_voicemail.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/apps/app_voicemail.c (original)
+++ team/dvossel/generic_aoc/apps/app_voicemail.c Wed Apr 21 10:19:22 2010
@@ -2053,6 +2053,26 @@
 	return 0;
 }
 
+static int imap_check_limits(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu, int msgnum)
+{
+	/* Check if mailbox is full */
+	check_quota(vms, vmu->imapfolder);
+	if (vms->quota_limit && vms->quota_usage >= vms->quota_limit) {
+		ast_debug(1, "*** QUOTA EXCEEDED!! %u >= %u\n", vms->quota_usage, vms->quota_limit);
+		ast_play_and_wait(chan, "vm-mailboxfull");
+		return -1;
+	}
+	
+	/* Check if we have exceeded maxmsg */
+	if (msgnum >= vmu->maxmsg  - inprocess_count(vmu->mailbox, vmu->context, 0)) {
+		ast_log(AST_LOG_WARNING, "Unable to leave message since we will exceed the maximum number of messages allowed (%u > %u)\n", msgnum, vmu->maxmsg);
+		ast_play_and_wait(chan, "vm-mailboxfull");
+		return -1;
+	}
+
+	return 0;
+}
+
 /*!
  * \brief Gets the number of messages that exist in a mailbox folder.
  * \param context
@@ -2086,11 +2106,16 @@
 	STRING str;
 	int ret; /* for better error checking */
 	char *imap_flags = NIL;
+	int msgcount = (messagecount(vmu->context, vmu->mailbox, "INBOX") + messagecount(vmu->context, vmu->mailbox, "Old"));
 
     /* Back out early if this is a greeting and we don't want to store greetings in IMAP */
     if (msgnum < 0 && !imapgreetings) {
         return 0;
     }
+	
+	if (imap_check_limits(chan, vms, vmu, msgcount)) {
+		return -1;
+	}
 
 	/* Set urgent flag for IMAP message */
 	if (!ast_strlen_zero(flag) && !strcmp(flag, "Urgent")) {
@@ -4483,7 +4508,7 @@
 #ifdef IMAP_STORAGE
 				{
 					/* Convert body to native line terminators for IMAP backend */
-					char *line = passdata, *next;
+					char *line = ast_str_buffer(str1), *next;
 					do {
 						/* Terminate line before outputting it to the file */
 						if ((next = strchr(line, '\n'))) {
@@ -5084,6 +5109,7 @@
 	char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
 	const char *frombox = mbox(vmu, imbox);
 	int recipmsgnum;
+	int res = 0;
 
 	ast_log(AST_LOG_NOTICE, "Copying message from %s@%s to %s@%s\n", vmu->mailbox, vmu->context, recip->mailbox, recip->context);
 
@@ -5121,11 +5147,12 @@
 		}
 	} else {
 		ast_log(AST_LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
+		res = -1;
 	}
 	ast_unlock_path(todir);
 	notify_new_message(chan, recip, NULL, recipmsgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), flag);
 	
-	return 0;
+	return res;
 }
 #endif
 #if !(defined(IMAP_STORAGE) || defined(ODBC_STORAGE))
@@ -5620,21 +5647,8 @@
 		/* set variable for compatibility */
 		pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", "IMAP_STORAGE");
 
-		/* Check if mailbox is full */
-		check_quota(vms, vmu->imapfolder);
-		if (vms->quota_limit && vms->quota_usage >= vms->quota_limit) {
-			ast_debug(1, "*** QUOTA EXCEEDED!! %u >= %u\n", vms->quota_usage, vms->quota_limit);
-			ast_play_and_wait(chan, "vm-mailboxfull");
-			ast_free(tmp);
-			return -1;
-		}
-		
-		/* Check if we have exceeded maxmsg */
-		if (msgnum >= vmu->maxmsg  - inprocess_count(vmu->mailbox, vmu->context, 0)) {
-			ast_log(AST_LOG_WARNING, "Unable to leave message since we will exceed the maximum number of messages allowed (%u > %u)\n", msgnum, vmu->maxmsg);
-			ast_play_and_wait(chan, "vm-mailboxfull");
-			ast_free(tmp);
-			return -1;
+		if ((res = imap_check_limits(chan, vms, vmu, msgnum))) {
+			goto leave_vm_out;
 		}
 #else
 		if (count_messages(vmu, dir) >= vmu->maxmsg - inprocess_count(vmu->mailbox, vmu->context, +1)) {
@@ -6959,6 +6973,7 @@
 		/* Forward VoiceMail */
 		long duration = 0;
 		struct vm_state vmstmp;
+		int copy_msg_result = 0;
 		memcpy(&vmstmp, vms, sizeof(vmstmp));
 
  		RETRIEVE(dir, curmsg, sender->mailbox, sender->context);
@@ -6980,7 +6995,7 @@
 					if (!dstvms->mailstream) {
 						ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
 					} else {
-						STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, dstvms->curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str);
+						copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, dstvms->curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str);
 						run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str); 
 					}
 				} else {
@@ -6992,7 +7007,7 @@
 				/* NULL category for IMAP storage */
 				sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, dstvms->curbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vmstmp.fn, vmstmp.introfn, fmt, duration, attach_user_voicemail, chan, NULL, urgent_str);
 #else
-				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str);
+				copy_msg_result = copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str);
 #endif
 				saved_messages++;
 				AST_LIST_REMOVE_CURRENT(list);
@@ -7001,7 +7016,7 @@
 					break;
 			}
 			AST_LIST_TRAVERSE_SAFE_END;
-			if (saved_messages > 0) {
+			if (saved_messages > 0 && !copy_msg_result) {
 				/* give confirmation that the message was saved */
 				/* commented out since we can't forward batches yet
 				if (saved_messages == 1)
@@ -7015,8 +7030,12 @@
 				if (ast_strlen_zero(vmstmp.introfn))
 #endif
 				res = ast_play_and_wait(chan, "vm-msgsaved");
-			}	
+			}
 #ifndef IMAP_STORAGE
+			else {
+				/* with IMAP, mailbox full warning played by imap_check_limits */
+				res = ast_play_and_wait(chan, "vm-mailboxfull");
+			}
 			/* Restore original message without prepended message if backup exists */
 			make_file(msgfile, sizeof(msgfile), dir, curmsg);
 			strcpy(textfile, msgfile);

Modified: team/dvossel/generic_aoc/configs/cli_aliases.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configs/cli_aliases.conf.sample?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/configs/cli_aliases.conf.sample (original)
+++ team/dvossel/generic_aoc/configs/cli_aliases.conf.sample Wed Apr 21 10:19:22 2010
@@ -153,6 +153,7 @@
 show version files=core show file version
 show profile=core show profile
 clear profile=core clear profile
+soft hangup=channel request hangup
 
 [asterisk12](asterisk12_tpl)
 ; add any additional custom commands you want below here, for example:
@@ -181,6 +182,7 @@
 restart now=core restart now
 restart gracefully=core restart gracefully
 restart when convenient=core restart when convenient
+soft hangup=channel request hangup
 
 [asterisk14](asterisk14_tpl)
 ; add any additional custom commands you want below here.

Modified: team/dvossel/generic_aoc/configs/extensions.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configs/extensions.conf.sample?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/configs/extensions.conf.sample (original)
+++ team/dvossel/generic_aoc/configs/extensions.conf.sample Wed Apr 21 10:19:22 2010
@@ -150,6 +150,11 @@
 ;
 TRUNKMSD=1					; MSD digits to strip (usually 1 or 0)
 ;TRUNK=IAX2/user:pass at provider
+
+;FREENUMDOMAIN=mydomain.com                     ; domain to send on outbound
+                                                ; freenum calls (uses outbound-freenum
+                                                ; context)
+
 ;
 ; WARNING WARNING WARNING WARNING
 ; If you load any other extension configuration engine, such as pbx_ael.so,
@@ -390,6 +395,45 @@
 ; being passed to the switch routine.
 ;
 ; eswitch => IAX2/context@${CURSERVER}
+
+; The following two contexts are a template to enable the ability to dial
+; ISN numbers. For more information about what an ISN number is, please see
+; http://www.freenum.org.
+;
+; This is the dialing hook.  use:
+; include => outbound-freenum
+
+[outbound-freenum]
+; We'll add more digits as needed. The purpose is to dial things
+; like extension numbers at domains (ITAD number) so we're matching
+; on lengths of 1 through 6 prior to the separator (the asterisk [*])
+;
+exten => _X*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+exten => _XX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+exten => _XXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+exten => _XXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+exten => _XXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+exten => _XXXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
+
+[outbound-freenum2]
+; This is the handler which performs the dialing logic. It is called
+; from the [outbound-freenum] context
+;
+exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN})
+same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)})                                ; make sure the suffix is all digits as well
+same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != "${SUFFIX}"]?i:)       ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document
+same => n,Set(TIMEOUT(absolute)=10800)
+same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)})     ; perform our lookup with freenum.org
+same => n,GotoIf($["${isnresult}" != ""]?:notfound)
+same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" == ""]?dial:)             ; check if we set the FREENUMDOMAIN global variable in [global]
+same => n,Set(SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)})                   ;    if we did set it, then we'll use it for our outbound dialing domain
+same => n(dial),Dial(SIP/${isnresult},40)
+same => n,Goto(fn-${DIALSTATUS})
+
+exten => fn-BUSY,1,Busy()
+
+exten => _fn-.,1,NoOp(ISN: ${DIALSTATUS})
+same => n,Congestion()
 
 [macro-trunkdial]
 ;

Modified: team/dvossel/generic_aoc/contrib/scripts/sip-friends.sql
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/contrib/scripts/sip-friends.sql?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/contrib/scripts/sip-friends.sql (original)
+++ team/dvossel/generic_aoc/contrib/scripts/sip-friends.sql Wed Apr 21 10:19:22 2010
@@ -49,6 +49,7 @@
   `rtpkeepalive` varchar(15),
   `lastms` int(11) NOT NULL default '-1',
   `setvar` varchar(200),
+  `useragent` varchar(50),
   PRIMARY KEY  (`name`),
   INDEX host (host, port),
   INDEX ipaddr (ipaddr, port)

Modified: team/dvossel/generic_aoc/doc/manager_1_1.txt
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/doc/manager_1_1.txt?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/doc/manager_1_1.txt (original)
+++ team/dvossel/generic_aoc/doc/manager_1_1.txt Wed Apr 21 10:19:22 2010
@@ -290,7 +290,17 @@
 		CoreReloadTime: 22:35:17
 		CoreCurrentCalls: 20
 
-		
+- Action: MixMonitorMute
+	Modules: app_mixmonitor.c
+	Purpose: 
+		Mute / unMute a Mixmonitor recording.
+	Variables: 
+		ActionId: <id> Action ID for this transaction. Will be returned.
+		Channel: the channel MixMonitor is running on
+		Direction: Which part of the recording to mute:  read, write or both (from
+			channel, to channel or both channels).
+		State: Turn mute on or off : 1 to turn on, 0 to turn off.
+
 * NEW EVENTS
 ------------
 

Modified: team/dvossel/generic_aoc/doc/tex/manager.tex
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/doc/tex/manager.tex?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/doc/tex/manager.tex (original)
+++ team/dvossel/generic_aoc/doc/tex/manager.tex Wed Apr 21 10:19:22 2010
@@ -163,6 +163,7 @@
  DestinationContext:      -- Destination context (cdr_manager)
  DestinationChannel:      -- Destination channel (cdr_manager)
  DestUniqueID:            -- UniqueID of destination (dial event)
+ Direction: <type>        -- Audio to mute (read | write | both) 
  Disposition:             -- Call disposition (CDR manager)
  Domain: <domain>         -- DNS domain
  Duration: <secs>         -- Duration of call (cdr_manager)
@@ -231,6 +232,7 @@
  SrcUniqueID:             -- UniqueID of source (dial event)
  StartTime:               -- Start time of call (cdr_manager)
  State:                   -- Channel state
+ State: <1 | 0>           -- Mute flag
  Status:                  -- Registration status (Registry events SIP)
  Status:                  -- Extension status (Extensionstate)
  Status:                  -- Peer status (if monitored)  ** Will change name **

Modified: team/dvossel/generic_aoc/formats/format_pcm.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/formats/format_pcm.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/formats/format_pcm.c (original)
+++ team/dvossel/generic_aoc/formats/format_pcm.c Wed Apr 21 10:19:22 2010
@@ -19,7 +19,7 @@
 /*! \file
  *
  * \brief Flat, binary, ulaw PCM file format.
- * \arg File name extension: pcm, ulaw, ul, mu
+ * \arg File name extension: alaw, al, alw, pcm, ulaw, ul, mu, ulw, g722, au
  * 
  * \ingroup formats
  */

Modified: team/dvossel/generic_aoc/include/asterisk/audiohook.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/include/asterisk/audiohook.h?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/include/asterisk/audiohook.h (original)
+++ team/dvossel/generic_aoc/include/asterisk/audiohook.h Wed Apr 21 10:19:22 2010
@@ -62,6 +62,8 @@
 	 * slinfactories. We will flush the factories if they contain too many samples.
 	 */
 	AST_AUDIOHOOK_SMALL_QUEUE = (1 << 3),
+	AST_AUDIOHOOK_MUTE_READ = (1 << 4),     /*!< audiohook should be mute frames read */
+	AST_AUDIOHOOK_MUTE_WRITE = (1 << 5),    /*!< audiohook should be mute frames written */
 };
 
 #define AST_AUDIOHOOK_SYNC_TOLERANCE 100 /*< Tolerance in milliseconds for audiohooks synchronization */
@@ -277,6 +279,16 @@
  */
 int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume);
 
+/*! \brief Mute frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param source Type of audiohook
+ * \param flag which direction to set / clear
+ * \param clear set or clear muted frames on direction based on flag parameter
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_audiohook_set_mute(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/dvossel/generic_aoc/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/include/asterisk/frame.h?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/include/asterisk/frame.h (original)
+++ team/dvossel/generic_aoc/include/asterisk/frame.h Wed Apr 21 10:19:22 2010
@@ -729,6 +729,11 @@
 	}
 }
 
+/*!
+ * \brief Clear all audio samples from an ast_frame. The frame must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR 
+ */
+int ast_frame_clear(struct ast_frame *frame);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/dvossel/generic_aoc/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/audiohook.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/main/audiohook.c (original)
+++ team/dvossel/generic_aoc/main/audiohook.c Wed Apr 21 10:19:22 2010
@@ -127,6 +127,7 @@
 	int our_factory_ms;
 	int other_factory_samples;
 	int other_factory_ms;
+	int muteme = 0;
 
 	/* Update last feeding time to be current */
 	*rwtime = ast_tvnow();
@@ -149,6 +150,17 @@
 		}
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
+	}
+
+	/* swap frame data for zeros if mute is required */
+	if ((ast_test_flag(audiohook, AST_AUDIOHOOK_MUTE_READ) && (direction == AST_AUDIOHOOK_DIRECTION_READ)) ||
+		(ast_test_flag(audiohook, AST_AUDIOHOOK_MUTE_WRITE) && (direction == AST_AUDIOHOOK_DIRECTION_WRITE)) ||
+		(ast_test_flag(audiohook, AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE) == (AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE))) {
+			muteme = 1;
+	}
+
+	if (muteme && frame->datalen > 0) {
+		ast_frame_clear(frame);
 	}
 
 	/* Write frame out to respective factory */
@@ -1001,3 +1013,37 @@
 
 	return 0;
 }
+
+/*! \brief Mute frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param source Type of audiohook
+ * \param flag which flag to set / clear
+ * \param clear set or clear
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_audiohook_set_mute(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear)
+{
+	struct ast_audiohook *audiohook = NULL;
+
+	ast_channel_lock(chan);
+
+	/* Ensure the channel has audiohooks on it */
+	if (!chan->audiohooks) {
+		ast_channel_unlock(chan);
+		return -1;
+	}
+
+	audiohook = find_audiohook_by_source(chan->audiohooks, source);
+
+	if (audiohook) {
+		if (clear) {
+			ast_clear_flag(audiohook, flag);
+		} else {
+			ast_set_flag(audiohook, flag);
+		}
+	}
+
+	ast_channel_unlock(chan);
+
+	return (audiohook ? 0 : -1);
+}

Modified: team/dvossel/generic_aoc/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/frame.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/main/frame.c (original)
+++ team/dvossel/generic_aoc/main/frame.c Wed Apr 21 10:19:22 2010
@@ -1587,3 +1587,15 @@
 
 	return 0;
 }
+
+int ast_frame_clear(struct ast_frame *frame)
+{
+	struct ast_frame *next;
+
+	for (next = AST_LIST_NEXT(frame, frame_list);
+		 frame;
+		 frame = next, next = frame ? AST_LIST_NEXT(frame, frame_list) : NULL) {
+		memset(frame->data.ptr, 0, frame->datalen);
+	}
+	return 0;
+}

Modified: team/dvossel/generic_aoc/main/indications.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/indications.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/main/indications.c (original)
+++ team/dvossel/generic_aoc/main/indications.c Wed Apr 21 10:19:22 2010
@@ -1038,8 +1038,8 @@
 	cfg = ast_config_load2(config, "indications", config_flags);
 
 	if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEINVALID) {
-		ast_log(LOG_ERROR, "Can't find indications config file %s.\n", config);
-		return -1;
+		ast_log(LOG_WARNING, "Can't find indications config file %s.\n", config);
+		return 0;
 	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
 		return 0;
 	}

Modified: team/dvossel/generic_aoc/res/res_calendar_caldav.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/res/res_calendar_caldav.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/res/res_calendar_caldav.c (original)
+++ team/dvossel/generic_aoc/res/res_calendar_caldav.c Wed Apr 21 10:19:22 2010
@@ -17,7 +17,7 @@
  */
 
 /*! \file
- * \brief Resource for handling iCalnedar calendars
+ * \brief Resource for handling CalDAV calendars
  */
 
 /*** MODULEINFO

Modified: team/dvossel/generic_aoc/res/res_calendar_exchange.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/res/res_calendar_exchange.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/res/res_calendar_exchange.c (original)
+++ team/dvossel/generic_aoc/res/res_calendar_exchange.c Wed Apr 21 10:19:22 2010
@@ -17,7 +17,7 @@
  */
 
 /*! \file
- * \brief Resource for handling iCalnedar calendars
+ * \brief Resource for handling MS Exchange calendars
  */
 
 /*** MODULEINFO

Modified: team/dvossel/generic_aoc/res/res_calendar_icalendar.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/res/res_calendar_icalendar.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/res/res_calendar_icalendar.c (original)
+++ team/dvossel/generic_aoc/res/res_calendar_icalendar.c Wed Apr 21 10:19:22 2010
@@ -17,7 +17,7 @@
  */
 
 /*! \file
- * \brief Resource for handling iCalnedar calendars
+ * \brief Resource for handling iCalendar calendars
  */
 
 /*** MODULEINFO

Modified: team/dvossel/generic_aoc/res/res_mutestream.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/res/res_mutestream.c?view=diff&rev=258302&r1=258301&r2=258302
==============================================================================
--- team/dvossel/generic_aoc/res/res_mutestream.c (original)
+++ team/dvossel/generic_aoc/res/res_mutestream.c Wed Apr 21 10:19:22 2010
@@ -116,19 +116,6 @@
 	.destroy = destroy_callback
 };
 
-/*! \brief Wipe out all audio samples from an ast_frame. Clean it. */
-static void ast_frame_clear(struct ast_frame *frame)
-{
-	struct ast_frame *next;
-
-	for (next = AST_LIST_NEXT(frame, frame_list);
-		frame;
-		frame = next, next = frame ? AST_LIST_NEXT(frame, frame_list) : NULL) {
-		memset(frame->data.ptr, 0, frame->datalen);
-        }
-}
-
-
 /*! \brief The callback from the audiohook subsystem. We basically get a frame to have fun with */
 static int mute_callback(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
 {




More information about the svn-commits mailing list