[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r312554 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Apr 2 10:19:35 CDT 2011


Author: may
Date: Sat Apr  2 10:19:21 2011
New Revision: 312554

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=312554
Log:
Merged revisions 311770,311822,311893,311949,311998,312041,312145,312239,312316,312401,312439,312480,312523 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/may/ooh323_ipv6

................
  r311770 | root | 2011-03-29 02:21:24 +0400 (Tue, 29 Mar 2011) | 16 lines
  
  Merged revisions 311752 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r311752 | russell | 2011-03-28 17:00:46 -0500 (Mon, 28 Mar 2011) | 9 lines
    
    Merged revisions 311751 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r311751 | russell | 2011-03-28 17:00:01 -0500 (Mon, 28 Mar 2011) | 2 lines
      
      Cross-reference VoiceMail() and VoiceMailMain() in the xml docs.
    ........
  ................
................
  r311822 | root | 2011-03-29 13:21:16 +0400 (Tue, 29 Mar 2011) | 21 lines
  
  Merged revisions 311806 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r311806 | tilghman | 2011-03-29 03:33:44 -0500 (Tue, 29 Mar 2011) | 14 lines
    
    Merged revisions 311799 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r311799 | tilghman | 2011-03-29 02:08:39 -0500 (Tue, 29 Mar 2011) | 7 lines
      
      Remove extraneous check from integer-type fields.
      
      (closes issue #19027)
       Reported by: mlehner
       
      Review: https://reviewboard.asterisk.org/r/1149/
    ........
  ................
................
  r311893 | root | 2011-03-30 06:21:49 +0400 (Wed, 30 Mar 2011) | 16 lines
  
  Merged revisions 311875 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r311875 | rmudgett | 2011-03-29 20:57:00 -0500 (Tue, 29 Mar 2011) | 9 lines
    
    Merged revisions 311874 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r311874 | rmudgett | 2011-03-29 20:56:05 -0500 (Tue, 29 Mar 2011) | 1 line
      
      Update some setup_dahdi_int() comments.
    ........
  ................
................
  r311949 | root | 2011-03-31 11:21:27 +0400 (Thu, 31 Mar 2011) | 20 lines
  
  Merged revisions 311931 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r311931 | tilghman | 2011-03-31 01:44:08 -0500 (Thu, 31 Mar 2011) | 13 lines
    
    Merged revisions 311930 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r311930 | tilghman | 2011-03-31 01:43:18 -0500 (Thu, 31 Mar 2011) | 6 lines
      
      Incorrect default example; the field is actually internally named "clid", not "callerid".
      
      (closes issue #19040)
      Reported by: wcselby
      Tested by: tilghman
    ........
  ................
................
  r311998 | root | 2011-03-31 22:21:23 +0400 (Thu, 31 Mar 2011) | 9 lines
  
  Merged revisions 311981 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r311981 | rmudgett | 2011-03-31 12:51:04 -0500 (Thu, 31 Mar 2011) | 1 line
    
    Fix function reference in comment.
  ........
................
  r312041 | root | 2011-04-01 00:21:32 +0400 (Fri, 01 Apr 2011) | 28 lines
  
  Merged revisions 312023 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312023 | rmudgett | 2011-03-31 15:12:34 -0500 (Thu, 31 Mar 2011) | 21 lines
    
    Merged revisions 312022 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r312022 | rmudgett | 2011-03-31 15:11:40 -0500 (Thu, 31 Mar 2011) | 14 lines
      
      chan_misdn segfaults when DEBUG_THREADS is enabled.
      
      The segfault happens because jb->mutexjb is uninitialized from the
      ast_malloc().  The internals of ast_mutex_init() were assuming a nonzero
      value meant mutex tracking initialization had already happened.  Recent
      changes to mutex tracking code to reduce excessive memory consumption
      exposed this uninitialized value.
      
      Converted misdn_jb_init() to use ast_calloc() instead of ast_malloc().
      Also eliminated redundant zero initialization code in the routine.
      
      (closes issue #18975)
      Reported by: irroot
    ........
  ................
................
  r312145 | root | 2011-04-01 12:23:24 +0400 (Fri, 01 Apr 2011) | 43 lines
  
  Merged revisions 312118 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312118 | alecdavis | 2011-04-01 02:43:00 -0500 (Fri, 01 Apr 2011) | 36 lines
    
    Merged revisions 312117 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ................
      r312117 | alecdavis | 2011-04-01 20:32:12 +1300 (Fri, 01 Apr 2011) | 29 lines
      
      Merged revisions 312103 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.6.2
      
      ................
        r312103 | alecdavis | 2011-04-01 20:25:54 +1300 (Fri, 01 Apr 2011) | 22 lines
        
        Merged revisions 312070 via svnmerge from 
        https://origsvn.digium.com/svn/asterisk/branches/1.4
        
        ........
          r312070 | alecdavis | 2011-04-01 19:46:56 +1300 (Fri, 01 Apr 2011) | 16 lines
          
          app_voicemail: close_mailbox needs to respect additional messages while mailbox is open.
          
          close_mailbox leave gaps in message sequence if messages are deleted and new messages
          arrive during this time, this is because the shuffle down to slot 0, only shuffles
          the number of pre-existing messages when mailbox is opened, ignoring new arrivals.
          
          Fix: in close_mailbox re-evaluate number of messages before the shuffle, this then includes new arrivals.
          
          Happens on filebased or ODBC storage.
          
          (issues #19032,#18582,#18692,#18998)
          Reported by: alecdavis,tootai,afosorio
          
          Review: https://reviewboard.asterisk.org/r/1153/
        ........
      ................
    ................
  ................
................
  r312239 | root | 2011-04-01 13:23:12 +0400 (Fri, 01 Apr 2011) | 50 lines
  
  Merged revisions 312212 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312212 | alecdavis | 2011-04-01 04:08:39 -0500 (Fri, 01 Apr 2011) | 43 lines
    
    Merged revisions 312211 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ................
      r312211 | alecdavis | 2011-04-01 22:03:11 +1300 (Fri, 01 Apr 2011) | 36 lines
      
      Merged revisions 312210 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.6.2
      
      ................
        r312210 | alecdavis | 2011-04-01 21:47:29 +1300 (Fri, 01 Apr 2011) | 29 lines
        
        Merged revisions 312174 via svnmerge from 
        https://origsvn.digium.com/svn/asterisk/branches/1.4
        
        ........
          r312174 | alecdavis | 2011-04-01 21:29:49 +1300 (Fri, 01 Apr 2011) | 23 lines
          
          voicemail: get real last_message_index and count_messages, ODBC resequence
          
          change last_message_index to read the max msgnum stored in the database
          change count_messages to actually count the number of messages.
          
          last_message_index change:
            This fixed overwriting of the last message if msgnum=0 was missing.
            Previously every incoming message would overwrite msgnum=1.
          count_messages change:
            allows us to detect when requencing is required in opneA_mailbox.
          resequence enabled for ODBC storage:
            Assists with fixing up corrupt databases with gaps, but only when
            a user actively opens there mailboxes.
          
          (closes issue #18692,#18582,#19032)
          Reported by: elguero
          Patches: 
                based on odbc_resequence_mailbox2.1.diff uploaded by elguero (license 37)
          Tested by: elguero, nivek, alecdavis
          
          Review: https://reviewboard.asterisk.org/r/1153/
        ........
      ................
    ................
  ................
................
  r312316 | root | 2011-04-01 15:23:09 +0400 (Fri, 01 Apr 2011) | 39 lines
  
  Merged revisions 312289 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312289 | tilghman | 2011-04-01 05:59:32 -0500 (Fri, 01 Apr 2011) | 32 lines
    
    Merged revisions 312286,312288 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ................
      r312286 | tilghman | 2011-04-01 05:44:33 -0500 (Fri, 01 Apr 2011) | 2 lines
      
      Reload must react correctly against a possibly changed table, so dropping the conditional reload flag.
    ................
      r312288 | tilghman | 2011-04-01 05:58:45 -0500 (Fri, 01 Apr 2011) | 21 lines
      
      Merged revisions 312287 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.6.2
      
      ................
        r312287 | tilghman | 2011-04-01 05:51:24 -0500 (Fri, 01 Apr 2011) | 14 lines
        
        Merged revisions 312285 via svnmerge from 
        https://origsvn.digium.com/svn/asterisk/branches/1.4
        
        ........
          r312285 | tilghman | 2011-04-01 05:36:42 -0500 (Fri, 01 Apr 2011) | 7 lines
          
          Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code.
          
          (issue #18969)
           Reported by: oej
           Patches: 
                 20110315__issue18969__14.diff.txt uploaded by tilghman (license 14)
        ........
      ................
    ................
  ................
................
  r312401 | root | 2011-04-01 21:21:46 +0400 (Fri, 01 Apr 2011) | 20 lines
  
  Merged revisions 312384 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r312384 | jrose | 2011-04-01 12:01:01 -0500 (Fri, 01 Apr 2011) | 13 lines
    
    New Feature for chan_dahdi.  4 length pattern matching.
    
    In chan_dahdi.conf, the user can now use length 4 patterns in addition to the usual length 2 patterns.  The s
    ntax remains the same and the method used to track the pattern history will only change when using the length
     4 patterns.
    
    (closes issue SWP-3250)
    Code:
            jrose
            rmudgett
    Review Board URL:
            http://reviewboard.digium.internal/r/111/
  ........
................
  r312439 | root | 2011-04-01 22:21:14 +0400 (Fri, 01 Apr 2011) | 9 lines
  
  Merged revisions 312423 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r312423 | jrose | 2011-04-01 12:28:33 -0500 (Fri, 01 Apr 2011) | 2 lines
    
    Fixing bad line break from 312384
  ........
................
  r312480 | root | 2011-04-02 02:21:27 +0400 (Sat, 02 Apr 2011) | 39 lines
  
  Merged revisions 312462 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312462 | rmudgett | 2011-04-01 16:36:53 -0500 (Fri, 01 Apr 2011) | 32 lines
    
    Merged revisions 312461 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r312461 | rmudgett | 2011-04-01 16:31:39 -0500 (Fri, 01 Apr 2011) | 25 lines
      
      CallCompletionRequest()/CallCompletionCancel() exit non-zero if fail.
      
      The CallCompletionRequest()/CallCompletionCancel() dialplan applications
      exit nonzero on normal failure conditions.  The nonzero exit causes the
      dialplan to hangup immediately.  The dialplan author has no opportunity to
      report success/failure to the user.
      
      * Made always return zero so the dialplan can continue.
      
      * Made set CC_REQUEST_RESULT/CC_REQUEST_REASON and
      CC_CANCEL_RESULT/CC_CANCEL_REASON channel variables respectively.  Also
      documented the values set.
      
      * Reduced the warning about no core instance in CallCompletionCancel() to
      a debug message.  It is a normal event and should not be output at the
      WARNING level.
      
      (closes issue #18763)
      Reported by: p_lindheimer
      Patches:
            ccss.patch uploaded by p lindheimer (license 558) Modified
      Tested by: p_lindheimer, rmudgett
      
      JIRA SWP-3042
    ........
  ................
................
  r312523 | root | 2011-04-02 03:20:40 +0400 (Sat, 02 Apr 2011) | 36 lines
  
  Merged revisions 312510 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r312510 | rmudgett | 2011-04-01 18:17:05 -0500 (Fri, 01 Apr 2011) | 29 lines
    
    Merged revisions 312509 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r312509 | rmudgett | 2011-04-01 18:15:42 -0500 (Fri, 01 Apr 2011) | 22 lines
      
      When a call going out an NT-PTMP port gets rejected, Asterisk crashes.
      
      If a call is sent to an ISDN phone that rejects the call with
      RELEASE_COMPLETE(cause: call reject(21), or busy(17)) Asterisk crashes.
      
      I could not get my setup to crash.  However, I could see the possibility
      from a race condition between queuing an AST_CONTROL_BUSY to the core and
      then queueing an AST_CONTROL_HANGUP.  If the AST_CONTROL_BUSY is processed
      before the AST_CONTROL_HANGUP is queued, the ast_channel could be
      destroyed out from under chan_misdn.
      
      Avoid this particular crash scenario by not queueing the
      AST_CONTROL_HANGUP if the AST_CONTROL_BUSY was queued.
      
      (closes issue #18408)
      Reported by: wimpy
      Patches:
            issue18408_v1.8.patch uploaded by rmudgett (license 664)
      Tested by: rmudgett, wimpy
      
      JIRA SWP-2679
    ........
  ................
................

Modified:
    team/may/ooh323_ipv6_direct_rtp/   (props changed)
    team/may/ooh323_ipv6_direct_rtp/CHANGES
    team/may/ooh323_ipv6_direct_rtp/addons/cdr_mysql.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c
    team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c
    team/may/ooh323_ipv6_direct_rtp/configs/cdr_mysql.conf.sample
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/dsp.h
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/select.h
    team/may/ooh323_ipv6_direct_rtp/main/asterisk.c
    team/may/ooh323_ipv6_direct_rtp/main/ccss.c
    team/may/ooh323_ipv6_direct_rtp/main/dsp.c

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
--- svnmerge-custom (original)
+++ svnmerge-custom Sat Apr  2 10:19:21 2011
@@ -1,1 +1,1 @@
-/team/may/ooh323_ipv6:1-311739
+/team/may/ooh323_ipv6:1-312553

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Apr  2 10:19:21 2011
@@ -1,1 +1,1 @@
-/trunk:1-311704
+/trunk:1-312522

Modified: team/may/ooh323_ipv6_direct_rtp/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/CHANGES?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/CHANGES (original)
+++ team/may/ooh323_ipv6_direct_rtp/CHANGES Sat Apr  2 10:19:21 2011
@@ -27,6 +27,11 @@
 Asterisk HTTP Server
 --------------------------
  * The HTTP Server can bind to IPv6 addresses.
+
+chan_dahdi
+--------------------------
+ * Busy tone patterns featuring 2 silence and 2 tone lengths can now be used
+   with busydetect.  usage example: busypattern=200,200,200,600
 
 CLI Changes
 --------------------------

Modified: team/may/ooh323_ipv6_direct_rtp/addons/cdr_mysql.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/cdr_mysql.c?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/cdr_mysql.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/cdr_mysql.c Sat Apr  2 10:19:21 2011
@@ -428,7 +428,7 @@
 	int res;
 	struct ast_config *cfg;
 	struct ast_variable *var;
-	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+	struct ast_flags config_flags = { 0 };
 	struct column *entry;
 	char *temp;
 	struct ast_str *compat;
@@ -439,6 +439,9 @@
 	my_bool my_bool_true = 1;
 #endif
 
+	/* Cannot use a conditionally different flag, because the table layout may
+	 * have changed, which is not detectable by config file change detection,
+	 * but should still cause the configuration to be re-parsed. */
 	cfg = ast_config_load(config, config_flags);
 	if (!cfg) {
 		ast_log(LOG_WARNING, "Unable to load config for mysql CDR's: %s\n", config);

Modified: team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c Sat Apr  2 10:19:21 2011
@@ -201,6 +201,9 @@
 				</variable>
 			</variablelist>
 		</description>
+		<see-also>
+			<ref type="application">VoiceMailMain</ref>
+		</see-also>
 	</application>
 	<application name="VoiceMailMain" language="en_US">
 		<synopsis>
@@ -259,6 +262,9 @@
 				</enum>
 			</enumlist>
 		</description>
+		<see-also>
+			<ref type="application">VoiceMail</ref>
+		</see-also>
 	</application>
 	<application name="MailboxExists" language="en_US">
 		<synopsis>
@@ -3397,7 +3403,7 @@
 		ast_odbc_release_obj(obj);
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-yuck:	
+yuck:
 	if (f)
 		fclose(f);
 	if (fd > -1)
@@ -3413,7 +3419,8 @@
  * This method is used when mailboxes are stored in an ODBC back end.
  * Typical use to set the msgnum would be to take the value returned from this method and add one to it.
  *
- * \return the value of zero or greaterto indicate the last message index in use, -1 to indicate none.
+ * \return the value of zero or greater to indicate the last message index in use, -1 to indicate none.
+
  */
 static int last_message_index(struct ast_vm_user *vmu, char *dir)
 {
@@ -3428,7 +3435,8 @@
 	struct odbc_obj *obj;
 	obj = ast_odbc_request_obj(odbc_database, 0);
 	if (obj) {
-		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir=?", odbc_table);
+		snprintf(sql, sizeof(sql), "SELECT msgnum FROM %s WHERE dir=? order by msgnum desc limit 1", odbc_table);
+
 		stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
 		if (!stmt) {
 			ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -3437,7 +3445,12 @@
 		}
 		res = SQLFetch(stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-			ast_log(AST_LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
+			if (res == SQL_NO_DATA) {
+				ast_log(AST_LOG_DEBUG, "Directory '%s' has no messages and therefore no index was retrieved.\n", dir);
+			} else {
+				ast_log(AST_LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
+			}
+
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 			ast_odbc_release_obj(obj);
 			goto yuck;
@@ -3450,12 +3463,13 @@
 			goto yuck;
 		}
 		if (sscanf(rowdata, "%30d", &x) != 1)
-			ast_log(AST_LOG_WARNING, "Failed to read message count!\n");
+			ast_log(AST_LOG_WARNING, "Failed to read message index!\n");
 		SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 		ast_odbc_release_obj(obj);
+		return x;
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-yuck:	
+yuck:
 	return x - 1;
 }
 
@@ -3510,25 +3524,63 @@
 		ast_odbc_release_obj(obj);
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-yuck:	
+yuck:
 	return x;
 }
 
 /*!
- * \brief returns the one-based count for messages.
+ * \brief returns the number of messages found.
  * \param vmu
  * \param dir the folder the mailbox folder to look for messages. Used to construct the SQL where clause.
  *
  * This method is used when mailboxes are stored in an ODBC back end.
- * The message index is zero-based, the first message will be index 0. For convenient display it is good to have the
- * one-based messages.
- * This method just calls last_message_index and returns +1 of its value.
  *
- * \return the value greater than zero on success to indicate the one-based count of messages, less than zero on error.
+ * \return The count of messages being zero or more, less than zero on error.
  */
 static int count_messages(struct ast_vm_user *vmu, char *dir)
 {
-	return last_message_index(vmu, dir) + 1;
+	int x = 0;
+	int res;
+	SQLHSTMT stmt;
+	char sql[PATH_MAX];
+	char rowdata[20];
+	char *argv[] = { dir };
+	struct generic_prepare_struct gps = { .sql = sql, .argc = 1, .argv = argv };
+
+	struct odbc_obj *obj;
+	obj = ast_odbc_request_obj(odbc_database, 0);
+	if (obj) {
+		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir=?", odbc_table);
+		stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
+		if (!stmt) {
+			ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
+			ast_odbc_release_obj(obj);
+			goto yuck;
+		}
+		res = SQLFetch(stmt);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+			ast_log(AST_LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
+			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
+			ast_odbc_release_obj(obj);
+			goto yuck;
+		}
+		res = SQLGetData(stmt, 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+			ast_log(AST_LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
+			ast_odbc_release_obj(obj);
+			goto yuck;
+		}
+		if (sscanf(rowdata, "%30d", &x) != 1)
+			ast_log(AST_LOG_WARNING, "Failed to read message count!\n");
+		SQLFreeHandle (SQL_HANDLE_STMT, stmt);
+		ast_odbc_release_obj(obj);
+		return x;
+	} else
+		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
+yuck:
+	return x - 1;
+
 }
 
 /*!
@@ -5093,7 +5145,6 @@
 	if (obj) {
 		ast_odbc_release_obj(obj);
 	}
-
 	return x;
 }
 
@@ -6020,7 +6071,7 @@
 	return res;
 }
 
-#if !defined(IMAP_STORAGE) && !defined(ODBC_STORAGE)
+#if !defined(IMAP_STORAGE)
 static int resequence_mailbox(struct ast_vm_user *vmu, char *dir, int stopcount)
 {
     /* we know the actual number of messages, so stop process when number is hit */
@@ -7765,21 +7816,21 @@
 
 	if (last_msg < -1) {
 		return last_msg;
-#ifndef ODBC_STORAGE
 	} else if (vms->lastmsg != last_msg) {
-		ast_log(LOG_NOTICE, "Resequencing mailbox: %s, expected %d but found %d message(s) in box with max threshold of %d.\n", vms->curdir, last_msg + 1, vms->lastmsg + 1, vmu->maxmsg);
-        resequence_mailbox(vmu, vms->curdir, count_msg);
+		ast_log(LOG_NOTICE, "Resequencing Mailbox: %s, expected %d but found %d message(s) in box with max threshold of %d.\n", vms->curdir, last_msg + 1, vms->lastmsg + 1, vmu->maxmsg);
+		resequence_mailbox(vmu, vms->curdir, count_msg);
+	}
+
+	return 0;
+}
 #endif
-	}
-
-	return 0;
-}
-#endif
 
 static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
 {
 	int x = 0;
+
 #ifndef IMAP_STORAGE
+	int last_msg_idx;
 	int res = 0, nummsg;
 	char fn2[PATH_MAX];
 #endif
@@ -7795,8 +7846,14 @@
 		return ERROR_LOCK_PATH;
 	}
 
+	/* update count as message may have arrived while we've got mailbox open */
+	last_msg_idx = last_message_index(vmu, vms->curdir);
+	if (last_msg_idx != vms->lastmsg) {
+		ast_log(AST_LOG_WARNING, "%d messages received after mailbox opened.\n", last_msg_idx - vms->lastmsg);
+	}
+
 	/* must check up to last detected message, just in case it is erroneously greater than maxmsg */
-	for (x = 0; x < vms->lastmsg + 1; x++) {
+	for (x = 0; x < last_msg_idx + 1; x++) {
 		if (!vms->deleted[x] && ((strcasecmp(vms->curbox, "INBOX") && strcasecmp(vms->curbox, "Urgent")) || !vms->heard[x] || (vms->heard[x] && !ast_test_flag(vmu, VM_MOVEHEARD)))) {
 			/* Save this message.  It's not in INBOX or hasn't been heard */
 			make_file(vms->fn, sizeof(vms->fn), vms->curdir, x);
@@ -10202,7 +10259,7 @@
 #endif
 			break;
 
-		case '8': /* Forward the current messgae */
+		case '8': /* Forward the current message */
 			if (vms.lastmsg > -1) {
 				cmd = forward_message(chan, context, &vms, vmu, vmfmts, 0, record_gain, in_urgent);
 				if (cmd == ERROR_LOCK_PATH) {

Modified: team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c Sat Apr  2 10:19:21 2011
@@ -571,9 +571,7 @@
 					}
 					break;
 				case SQL_INTEGER:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						int integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (int) record.event_type;
@@ -590,9 +588,7 @@
 					}
 					break;
 				case SQL_BIGINT:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						long long integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (long long) record.event_type;
@@ -609,9 +605,7 @@
 					}
 					break;
 				case SQL_SMALLINT:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						short integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (short) record.event_type;
@@ -628,9 +622,7 @@
 					}
 					break;
 				case SQL_TINYINT:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						char integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (char) record.event_type;
@@ -647,9 +639,7 @@
 					}
 					break;
 				case SQL_BIT:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						char integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (char) record.event_type;
@@ -669,9 +659,7 @@
 					break;
 				case SQL_NUMERIC:
 				case SQL_DECIMAL:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						double number = 0.0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							number = (double)record.event_type;
@@ -690,9 +678,7 @@
 				case SQL_FLOAT:
 				case SQL_REAL:
 				case SQL_DOUBLE:
-					if (ast_strlen_zero(colptr)) {
-						continue;
-					} else {
+					{
 						double number = 0.0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							number = (double) record.event_type;

Modified: team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c Sat Apr  2 10:19:21 2011
@@ -1115,15 +1115,10 @@
 	 */
 	int busycount;
 	/*!
-	 * \brief Length of "busy" tone on time.
-	 * \note Set from the "busypattern" value read in from chan_dahdi.conf
+	 * \brief Busy cadence pattern description.
+	 * \note Set from the "busypattern" value read from chan_dahdi.conf
 	 */
-	int busy_tonelength;
-	/*!
-	 * \brief Length of "busy" tone off time.
-	 * \note Set from the "busypattern" value read in from chan_dahdi.conf
-	 */
-	int busy_quietlength;
+	struct ast_dsp_busy_pattern busy_cadence;
 	/*!
 	 * \brief Bitmapped call progress detection flags. CALLPROGRESS_xxx values.
 	 * \note Bits set from the "callprogress" and "faxdetect" values read in from chan_dahdi.conf
@@ -9542,7 +9537,7 @@
 					ast_dsp_set_call_progress_zone(i->dsp, progzone);
 				if (i->busydetect && CANBUSYDETECT(i)) {
 					ast_dsp_set_busy_count(i->dsp, i->busycount);
-					ast_dsp_set_busy_pattern(i->dsp, i->busy_tonelength, i->busy_quietlength);
+					ast_dsp_set_busy_pattern(i->dsp, &i->busy_cadence);
 				}
 			}
 		}
@@ -12615,8 +12610,7 @@
 		}
 		tmp->busydetect = conf->chan.busydetect;
 		tmp->busycount = conf->chan.busycount;
-		tmp->busy_tonelength = conf->chan.busy_tonelength;
-		tmp->busy_quietlength = conf->chan.busy_quietlength;
+		tmp->busy_cadence = conf->chan.busy_cadence;
 		tmp->callprogress = conf->chan.callprogress;
 		tmp->waitfordialtone = conf->chan.waitfordialtone;
 		tmp->cancallforward = conf->chan.cancallforward;
@@ -15120,7 +15114,7 @@
 				ast_cli(a->fd, "    Busy Detector Debug: Enabled\n");
 #endif
 				ast_cli(a->fd, "    Busy Count: %d\n", tmp->busycount);
-				ast_cli(a->fd, "    Busy Pattern: %d,%d\n", tmp->busy_tonelength, tmp->busy_quietlength);
+				ast_cli(a->fd, "    Busy Pattern: %d,%d,%d,%d\n", tmp->busy_cadence.pattern[0], tmp->busy_cadence.pattern[1], (tmp->busy_cadence.length == 4) ? tmp->busy_cadence.pattern[2] : 0, (tmp->busy_cadence.length == 4) ? tmp->busy_cadence.pattern[3] : 0);
 			}
 			ast_cli(a->fd, "TDD: %s\n", tmp->tdd ? "yes" : "no");
 			ast_cli(a->fd, "Relax DTMF: %s\n", tmp->dtmfrelax ? "yes" : "no");
@@ -16663,6 +16657,41 @@
 #define PROC_DAHDI_OPT_NOCHAN  (1 << 0)
 /*! process_dahdi() - No warnings on non-existing cofiguration keywords */
 #define PROC_DAHDI_OPT_NOWARN  (1 << 1)
+
+static void parse_busy_pattern(struct ast_variable *v, struct ast_dsp_busy_pattern *busy_cadence)
+{
+	int count_pattern = 0;
+	int norval = 0;
+	char *temp = NULL;
+
+	for (; ;) {
+		/* Scans the string for the next value in the pattern. If none, it checks to see if any have been entered so far. */
+		if(!sscanf(v->value, "%30d", &norval) && count_pattern == 0) { 
+			ast_log(LOG_ERROR, "busypattern= expects either busypattern=tonelength,quietlength or busypattern=t1length, q1length, t2length, q2length at line %d.\n", v->lineno);
+			break;
+		}
+
+		busy_cadence->pattern[count_pattern] = norval; 
+		
+		count_pattern++;
+		if (count_pattern == 4) {
+			break;
+		}
+
+		temp = strchr(v->value, ',');
+		if (temp == NULL) {
+			break;
+		}
+		v->value = temp + 1;
+	}
+	busy_cadence->length = count_pattern;
+
+	if (count_pattern % 2 != 0) { 
+		/* The pattern length must be divisible by two */
+		ast_log(LOG_ERROR, "busypattern= expects either busypattern=tonelength,quietlength or busypattern=t1length, q1length, t2length, q2length at line %d.\n", v->lineno);
+	}
+	
+}
 
 static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct ast_variable *v, int reload, int options)
 {
@@ -16789,9 +16818,7 @@
 		} else if (!strcasecmp(v->name, "busycount")) {
 			confp->chan.busycount = atoi(v->value);
 		} else if (!strcasecmp(v->name, "busypattern")) {
-			if (sscanf(v->value, "%30d,%30d", &confp->chan.busy_tonelength, &confp->chan.busy_quietlength) != 2) {
-				ast_log(LOG_ERROR, "busypattern= expects busypattern=tonelength,quietlength at line %d.\n", v->lineno);
-			}
+			parse_busy_pattern(v, &confp->chan.busy_cadence);
 		} else if (!strcasecmp(v->name, "callprogress")) {
 			confp->chan.callprogress &= ~CALLPROGRESS_PROGRESS;
 			if (ast_true(v->value))
@@ -17824,7 +17851,8 @@
  * \brief Setup DAHDI channel driver.
  *
  * \param reload enum: load_module(0), reload(1), restart(2).
- * \param base_conf Default config parameters.  So cc_params can be properly destroyed.
+ * \param default_conf Default config parameters.  So cc_params can be properly destroyed.
+ * \param base_conf Default config parameters per section.  So cc_params can be properly destroyed.
  * \param conf Local config parameters.  So cc_params can be properly destroyed.
  *
  * \retval 0 on success.
@@ -17988,7 +18016,7 @@
 	if (ucfg) {
 		const char *chans;
 
-		/* Reset base_conf, so things dont leak from dahdi_chan.conf */
+		/* Reset base_conf, so things don't leak from dahdi_chan.conf */
 		deep_copy_dahdi_chan_conf(base_conf, default_conf);
 		process_dahdi(base_conf, "", ast_variable_browse(ucfg, "general"), 1, 0);
 

Modified: team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/channels/chan_misdn.c Sat Apr  2 10:19:21 2011
@@ -681,7 +681,7 @@
 static enum event_response_e
 cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data);
 
-static void send_cause2ast(struct ast_channel *ast, struct misdn_bchannel*bc, struct chan_list *ch);
+static int send_cause2ast(struct ast_channel *ast, struct misdn_bchannel *bc, struct chan_list *ch);
 
 static void cl_queue_chan(struct chan_list *chan);
 
@@ -8364,8 +8364,7 @@
 		cb_log(2, port, " --> hangup\n");
 		ch->need_hangup = 0;
 		ch->need_queue_hangup = 0;
-		if (ch->ast) {
-			send_cause2ast(ch->ast, bc, ch);
+		if (ch->ast && send_cause2ast(ch->ast, bc, ch)) {
 			ast_hangup(ch->ast);
 		}
 		return;
@@ -8373,13 +8372,15 @@
 
 	if (!ch->need_queue_hangup) {
 		cb_log(2, port, " --> No need to queue hangup\n");
+		return;
 	}
 
 	ch->need_queue_hangup = 0;
 	if (ch->ast) {
-		send_cause2ast(ch->ast, bc, ch);
-		ast_queue_hangup_with_cause(ch->ast, bc->cause);
-		cb_log(2, port, " --> queue_hangup\n");
+		if (send_cause2ast(ch->ast, bc, ch)) {
+			ast_queue_hangup_with_cause(ch->ast, bc->cause);
+			cb_log(2, port, " --> queue_hangup\n");
+		}
 	} else {
 		cb_log(1, port, "Cannot hangup chan, no ast\n");
 	}
@@ -8653,26 +8654,31 @@
 	}
 }
 
-
-
-static void send_cause2ast(struct ast_channel *ast, struct misdn_bchannel *bc, struct chan_list *ch) {
+/*!
+ * \retval -1 if can hangup after calling.
+ * \retval 0 if cannot hangup after calling.
+ */
+static int send_cause2ast(struct ast_channel *ast, struct misdn_bchannel *bc, struct chan_list *ch)
+{
+	int can_hangup;
+
 	if (!ast) {
 		chan_misdn_log(1, 0, "send_cause2ast: No Ast\n");
-		return;
+		return 0;
 	}
 	if (!bc) {
 		chan_misdn_log(1, 0, "send_cause2ast: No BC\n");
-		return;
+		return 0;
 	}
 	if (!ch) {
 		chan_misdn_log(1, 0, "send_cause2ast: No Ch\n");
-		return;
+		return 0;
 	}
 
 	ast->hangupcause = bc->cause;
 
+	can_hangup = -1;
 	switch (bc->cause) {
-
 	case AST_CAUSE_UNALLOCATED:
 	case AST_CAUSE_NO_ROUTE_TRANSIT_NET:
 	case AST_CAUSE_NO_ROUTE_DESTINATION:
@@ -8699,15 +8705,16 @@
 			chan_misdn_log(1, bc ? bc->port : 0, "Queued busy already\n");
 			break;
 		}
+		ch->need_busy = 0;
 
 		chan_misdn_log(1, bc ? bc->port : 0, " --> * SEND: Queue Busy pid:%d\n", bc ? bc->pid : -1);
-
 		ast_queue_control(ast, AST_CONTROL_BUSY);
 
-		ch->need_busy = 0;
-
-		break;
-	}
+		/* The BUSY is likely to cause a hangup or the user needs to hear it. */
+		can_hangup = 0;
+		break;
+	}
+	return can_hangup;
 }
 
 
@@ -12453,38 +12460,33 @@
 /* allocates the jb-structure and initialize the elements*/
 struct misdn_jb *misdn_jb_init(int size, int upper_threshold)
 {
-	int i;
 	struct misdn_jb *jb;
 
-	jb = ast_malloc(sizeof(*jb));
+	jb = ast_calloc(1, sizeof(*jb));
 	if (!jb) {
 	    chan_misdn_log(-1, 0, "No free Mem for jb\n");
 	    return NULL;
 	}
 	jb->size = size;
 	jb->upper_threshold = upper_threshold;
-	jb->wp = 0;
-	jb->rp = 0;
-	jb->state_full = 0;
-	jb->state_empty = 0;
-	jb->bytes_wrote = 0;
-	jb->samples = ast_malloc(size * sizeof(char));
+	//jb->wp = 0;
+	//jb->rp = 0;
+	//jb->state_full = 0;
+	//jb->state_empty = 0;
+	//jb->bytes_wrote = 0;
+	jb->samples = ast_calloc(size, sizeof(*jb->samples));
 	if (!jb->samples) {
 		ast_free(jb);
 		chan_misdn_log(-1, 0, "No free Mem for jb->samples\n");
 		return NULL;
 	}
 
-	jb->ok = ast_malloc(size * sizeof(char));
+	jb->ok = ast_calloc(size, sizeof(*jb->ok));
 	if (!jb->ok) {
 		ast_free(jb->samples);
 		ast_free(jb);
 		chan_misdn_log(-1, 0, "No free Mem for jb->ok\n");
 		return NULL;
-	}
-
-	for (i = 0; i < size; i++) {
-		jb->ok[i] = 0;
 	}
 
 	ast_mutex_init(&jb->mutexjb);

Modified: team/may/ooh323_ipv6_direct_rtp/configs/cdr_mysql.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/configs/cdr_mysql.conf.sample?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/configs/cdr_mysql.conf.sample (original)
+++ team/may/ooh323_ipv6_direct_rtp/configs/cdr_mysql.conf.sample Sat Apr  2 10:19:21 2011
@@ -42,18 +42,19 @@
 ;static "<value>" => <column>
 ;alias <cdrvar> => <column>
 alias start => calldate
-alias callerid => clid
-;alias src => src
-;alias dst => dst
-;alias dcontext => dcontext
-;alias channel => channel
-;alias dstchannel => dstchannel
-;alias lastapp => lastapp
-;alias lastdata => lastdata
-;alias duration => duration
-;alias billsec => billsec
-;alias disposition => disposition
-;alias amaflags => amaflags
-;alias accountcode => accountcode
-;alias userfield => userfield
-;alias uniqueid => uniqueid
+;alias clid => <a_field_not_named_clid>
+;alias src => <a_field_not_named_src>
+;alias dst => <a_field_not_named_dst>
+;alias dcontext => <a_field_not_named_dcontext>
+;alias channel => <a_field_not_named_channel>
+;alias dstchannel => <a_field_not_named_dstchannel>
+;alias lastapp => <a_field_not_named_lastapp>
+;alias lastdata => <a_field_not_named_lastdata>
+;alias duration => <a_field_not_named_duration>
+;alias billsec => <a_field_not_named_billsec>
+;alias disposition => <a_field_not_named_disposition>
+;alias amaflags => <a_field_not_named_amaflags>
+;alias accountcode => <a_field_not_named_accountcode>
+;alias userfield => <a_field_not_named_userfield>
+;alias uniqueid => <a_field_not_named_uniqueid>
+

Modified: team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h (original)
+++ team/may/ooh323_ipv6_direct_rtp/include/asterisk/channel.h Sat Apr  2 10:19:21 2011
@@ -1020,7 +1020,7 @@
 	/*!
 	 * \brief All softhangup flags.
 	 *
-	 * This can be used as an argument to ast_channel_softhangup_clear
+	 * This can be used as an argument to ast_channel_clear_softhangup()
 	 * to clear all softhangup flags from a channel.
 	 */
 	AST_SOFTHANGUP_ALL =       (0xFFFFFFFF)

Modified: team/may/ooh323_ipv6_direct_rtp/include/asterisk/dsp.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/include/asterisk/dsp.h?view=diff&rev=312554&r1=312553&r2=312554
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/include/asterisk/dsp.h (original)
+++ team/may/ooh323_ipv6_direct_rtp/include/asterisk/dsp.h Sat Apr  2 10:19:21 2011
@@ -59,6 +59,13 @@
 
 struct ast_dsp;
 
+struct ast_dsp_busy_pattern {
+	/*! Number of elements. */
+	int length;
+	/*! Pattern elements in on/off time durations. */
+	int pattern[4];
+};

[... 297 lines stripped ...]



More information about the asterisk-commits mailing list