[svn-commits] murf: branch murf/bug8221 r48065 - in /team/murf/bug8221: ./ apps/ channels/ ...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Nov 27 12:04:05 MST 2006


Author: murf
Date: Mon Nov 27 13:04:05 2006
New Revision: 48065

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48065
Log:
Merged revisions 48032-48034,48039-48040,48048,48050,48056,48062 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r48032 | oej | 2006-11-26 23:44:40 -0700 (Sun, 26 Nov 2006) | 2 lines

Change error message (imported from 1.4)

................
r48033 | oej | 2006-11-26 23:59:20 -0700 (Sun, 26 Nov 2006) | 2 lines

Doxygen updates

................
r48034 | rizzo | 2006-11-27 07:47:15 -0700 (Mon, 27 Nov 2006) | 5 lines

remove an extra comma in an initializer

Detected by: AST_DEVMODE=yes


................
r48039 | file | 2006-11-27 08:33:56 -0700 (Mon, 27 Nov 2006) | 18 lines

Merged revisions 48038 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48038 | file | 2006-11-27 10:32:19 -0500 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48037 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48037 | file | 2006-11-27 10:30:37 -0500 (Mon, 27 Nov 2006) | 2 lines

Do not reference the freed outgoing structure in the debug message. (issue #8425 reported by arkadia)

........

................

................
r48040 | file | 2006-11-27 08:48:57 -0700 (Mon, 27 Nov 2006) | 2 lines

More fixes for referencing a structure after it has been freed. (issue #8425 reported by arkadia)

................
r48048 | russell | 2006-11-27 10:19:47 -0700 (Mon, 27 Nov 2006) | 9 lines

Blocked revisions 48046 via svnmerge

........
r48046 | russell | 2006-11-27 12:17:40 -0500 (Mon, 27 Nov 2006) | 2 lines

Remove a couple of unused variables (issue #8380, casper)

........

................
r48050 | tilghman | 2006-11-27 10:31:56 -0700 (Mon, 27 Nov 2006) | 18 lines

Merged revisions 48049 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48049 | tilghman | 2006-11-27 11:20:37 -0600 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48045 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48045 | tilghman | 2006-11-27 11:15:54 -0600 (Mon, 27 Nov 2006) | 2 lines

Random MOH wasn't really random (bug 8381)

........

................

................
r48056 | file | 2006-11-27 11:10:59 -0700 (Mon, 27 Nov 2006) | 18 lines

Merged revisions 48054 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48054 | file | 2006-11-27 13:06:50 -0500 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48053 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48053 | file | 2006-11-27 13:03:57 -0500 (Mon, 27 Nov 2006) | 2 lines

Use the proper function to get the new message count instead of always using the filesystem. (issue #8421 reported by slimey)

........

................

................
r48062 | rizzo | 2006-11-27 11:51:10 -0700 (Mon, 27 Nov 2006) | 3 lines

staticize a global variable and remove an unused field structure.


................

Modified:
    team/murf/bug8221/   (props changed)
    team/murf/bug8221/apps/app_voicemail.c
    team/murf/bug8221/channels/chan_sip.c
    team/murf/bug8221/funcs/func_cdr.c
    team/murf/bug8221/include/asterisk/doxyref.h
    team/murf/bug8221/include/asterisk/threadstorage.h
    team/murf/bug8221/main/http.c
    team/murf/bug8221/pbx/pbx_spool.c
    team/murf/bug8221/res/res_musiconhold.c

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Nov 27 13:04:05 2006
@@ -1,1 +1,1 @@
-/trunk:1-48028
+/trunk:1-48064

Modified: team/murf/bug8221/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/apps/app_voicemail.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/apps/app_voicemail.c (original)
+++ team/murf/bug8221/apps/app_voicemail.c Mon Nov 27 13:04:05 2006
@@ -6970,22 +6970,13 @@
 			}
 		}
 		AST_LIST_TRAVERSE(&users, vmu, list) {
-			char dirname[256];
-			DIR *vmdir;
-			struct dirent *vment;
-			int vmcount = 0;
-			char count[12];
+			int newmsgs = 0, oldmsgs = 0;
+			char count[12], tmp[256] = "";
 
 			if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
-				make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
-				if ((vmdir = opendir(dirname))) {
-					/* No matter what the format of VM, there will always be a .txt file for each message. */
-					while ((vment = readdir(vmdir)))
-						if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
-							vmcount++;
-					closedir(vmdir);
-				}
-				snprintf(count,sizeof(count),"%d",vmcount);
+				snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+				inboxcount(tmp, &newmsgs, &oldmsgs);
+				snprintf(count,sizeof(count),"%d",newmsgs);
 				ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			}
 		}

Modified: team/murf/bug8221/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/channels/chan_sip.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/channels/chan_sip.c (original)
+++ team/murf/bug8221/channels/chan_sip.c Mon Nov 27 13:04:05 2006
@@ -12331,7 +12331,8 @@
 			if (sipmethod == SIP_INVITE) {
 				/* First we ACK */
 				transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
-					ast_log(LOG_WARNING, "INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Got 481 on Invite. Assuming INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
 				if (owner)
 					ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 				sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);

Modified: team/murf/bug8221/funcs/func_cdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/funcs/func_cdr.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/funcs/func_cdr.c (original)
+++ team/murf/bug8221/funcs/func_cdr.c Mon Nov 27 13:04:05 2006
@@ -129,7 +129,7 @@
 "  For example, 'start', 'answer', and 'end' will be retrieved as epoch\n"
 "  values, when the 'u' option is passed, but formatted as YYYY-MM-DD HH:MM:SS\n"
 "  otherwise.  Similarly, disposition and amaflags will return their raw\n"
-"  integral values.\n",
+"  integral values.\n"
 "  Here is a list of all the available cdr field names:\n"
 "    clid          lastdata       disposition\n"
 "    src           start          amaflags\n"

Modified: team/murf/bug8221/include/asterisk/doxyref.h
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/include/asterisk/doxyref.h?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/include/asterisk/doxyref.h (original)
+++ team/murf/bug8221/include/asterisk/doxyref.h Mon Nov 27 13:04:05 2006
@@ -40,7 +40,6 @@
  *  \arg \ref AstENUM : The IETF way to redirect from phone numbers to VoIP calls
  *  \arg \ref AstHTTP
  *  \arg \ref AstSpeech
- *  \arg \ref DataStores
  *  \arg \ref ConfigFiles
  *  \arg \ref SoundFiles included in the Asterisk distribution
  *  \arg \ref AstCREDITS : A Thank You to contributors
@@ -65,6 +64,10 @@
 /*! \page AstAPI Asterisk API
  *  \section Asteriskapi Asterisk API
  *  Some generic documents on the Asterisk architecture
+ *
+ *  \arg \ref AstThreadStorage
+ *  \arg \ref DataStores
+ *
  *  \subsection model_txt Generic Model
  *  \verbinclude model.txt
  *  \subsection channel_txt Channels

Modified: team/murf/bug8221/include/asterisk/threadstorage.h
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/include/asterisk/threadstorage.h?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/include/asterisk/threadstorage.h (original)
+++ team/murf/bug8221/include/asterisk/threadstorage.h Mon Nov 27 13:04:05 2006
@@ -19,8 +19,12 @@
 /*!
  * \file threadstorage.h
  * \author Russell Bryant <russell at digium.com>
- *
  * \brief Definitions to aid in the use of thread local storage
+ */
+
+/*!
+ * \page AstThreadStorage The Asterisk Thread Storage API
+ *
  *
  * The POSIX threads (pthreads) API provides the ability to define thread
  * specific data.  The functions and structures defined here are intended
@@ -34,6 +38,8 @@
  * 200 times a second).  Instead of doing the equivalent of that many calls
  * to malloc() and free() per second, thread local storage is used to keep a
  * list of unused frame structures so that they can be continuously reused.
+ *
+ * - \ref threadstorage.h
  */
 
 #ifndef ASTERISK_THREADSTORAGE_H
@@ -86,7 +92,7 @@
  *
  * Example usage:
  * \code
- * AST_THREADSTORAGE(my_buf, my_init, my_cleanup);
+ * AST_THREADSTORAGE_CUSTOM(my_buf, my_init, my_cleanup);
  * \endcode
  */
 #define AST_THREADSTORAGE_CUSTOM(name, c_init, c_cleanup) \

Modified: team/murf/bug8221/main/http.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/main/http.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/main/http.c (original)
+++ team/murf/bug8221/main/http.c Mon Nov 27 13:04:05 2006
@@ -72,7 +72,7 @@
 #ifdef DO_SSL
 #include <openssl/ssl.h>
 #include <openssl/err.h>
-SSL_CTX* ssl_ctx;
+static SSL_CTX* ssl_ctx;
 #endif /* DO_SSL */
 
 /* SSL support */
@@ -92,7 +92,6 @@
 	SSL *ssl;	/* ssl state */
 #endif
 	struct sockaddr_in requestor;
-	ast_http_callback callback;
 };
 
 /*!

Modified: team/murf/bug8221/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/pbx/pbx_spool.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/pbx/pbx_spool.c (original)
+++ team/murf/bug8221/pbx/pbx_spool.c Mon Nov 27 13:04:05 2006
@@ -387,8 +387,8 @@
 					now += o->retrytime;
 					if (o->callingpid && (o->callingpid == ast_mainpid)) {
 						safe_append(o, time(NULL), "DelayedRetry");
+						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 						free_outgoing(o);
-						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 					} else {
 						/* Increment retries */
 						o->retries++;
@@ -403,20 +403,20 @@
 					return now;
 				} else {
 					ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt%s\n", o->tech, o->dest, o->retries - 1, ((o->retries - 1) != 1) ? "s" : "");
+					remove_from_queue(o, "Expired");
 					free_outgoing(o);
-					remove_from_queue(o, "Expired");
 					return 0;
 				}
 			} else {
+				remove_from_queue(o, "Failed");
 				free_outgoing(o);
 				ast_log(LOG_WARNING, "Invalid file contents in %s, deleting\n", fn);
 				fclose(f);
-				remove_from_queue(o, "Failed");
 			}
 		} else {
+			remove_from_queue(o, "Failed");
 			free_outgoing(o);
 			ast_log(LOG_WARNING, "Unable to open %s: %s, deleting\n", fn, strerror(errno));
-			remove_from_queue(o, "Failed");
 		}
 	} else
 		ast_log(LOG_WARNING, "Out of memory :(\n");

Modified: team/murf/bug8221/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/res/res_musiconhold.c?view=diff&rev=48065&r1=48064&r2=48065
==============================================================================
--- team/murf/bug8221/res/res_musiconhold.c (original)
+++ team/murf/bug8221/res/res_musiconhold.c Mon Nov 27 13:04:05 2006
@@ -205,7 +205,7 @@
 		if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
 			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
 		}
-		state->save_pos = state->pos + 1;
+		state->save_pos = state->pos;
 	}
 }
 
@@ -216,32 +216,29 @@
 	int tries;
 
 	if (state->save_pos) {
-		state->pos = state->save_pos - 1;
+		state->pos = state->save_pos;
 		state->save_pos = 0;
-	} else {
+	}
+
+	state->samples = 0;
+	if (chan->stream) {
+		ast_closestream(chan->stream);
+		chan->stream = NULL;
+		state->pos++;
+		state->pos %= state->class->total_files;
+	}
+
+	if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
 		/* Try 20 times to find something good */
-		for (tries=0;tries < 20;tries++) {
-			state->samples = 0;
-			if (chan->stream) {
-				ast_closestream(chan->stream);
-				chan->stream = NULL;
-				state->pos++;
-			}
-
-			if (ast_test_flag(state->class, MOH_RANDOMIZE))
-				state->pos = ast_random();
-
-			state->pos %= state->class->total_files;
+		for (tries = 0; tries < 20; tries++) {
+			state->pos = rand() % state->class->total_files;
 
 			/* check to see if this file's format can be opened */
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
 				break;
-
-		}
-	}
-
-	state->pos = state->pos % state->class->total_files;
-	
+		}
+	}
+
 	if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
 		ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
 		state->pos++;



More information about the svn-commits mailing list