[svn-commits] seanbright: branch seanbright/resolve-shadow-warnings r115504 - in /team/sean...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 6 18:12:54 CDT 2008


Author: seanbright
Date: Tue May  6 18:12:54 2008
New Revision: 115504

URL: http://svn.digium.com/view/asterisk?view=rev&rev=115504
Log:
Merged revisions 115302,115305,115309,115313,115315,115321,115324,115328-115329,115334,115337,115342,115344,115416,115419,115423,115473 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r115302 | tilghman | 2008-05-05 15:42:36 -0400 (Mon, 05 May 2008) | 2 lines

Note change for ExecIf syntax (caught by jmls on IRC)

................
r115305 | russell | 2008-05-05 15:50:24 -0400 (Mon, 05 May 2008) | 13 lines

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

........
r115304 | russell | 2008-05-05 14:49:25 -0500 (Mon, 05 May 2008) | 5 lines

Avoid putting opaque="" in Digest authentication.  This patch came from switchvox.
It fixes authentication with Primus in Canada, and has been in use for a very long
time without causing problems with any other providers.
(closes issue AST-36)

........

................
r115309 | tilghman | 2008-05-05 15:57:28 -0400 (Mon, 05 May 2008) | 10 lines

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

........
r115308 | tilghman | 2008-05-05 14:55:55 -0500 (Mon, 05 May 2008) | 2 lines

Err, the documentation on the return value of ast_odbc_backslash_is_escape is exactly backwards.

........

................
r115313 | tilghman | 2008-05-05 16:22:08 -0400 (Mon, 05 May 2008) | 10 lines

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

........
r115312 | tilghman | 2008-05-05 15:17:55 -0500 (Mon, 05 May 2008) | 2 lines

Reverse order, such that user configs override default selections

........

................
r115315 | russell | 2008-05-05 16:28:17 -0400 (Mon, 05 May 2008) | 2 lines

Remove my rant, since I have now replaced the rant with code.

................
r115321 | mmichelson | 2008-05-05 17:43:21 -0400 (Mon, 05 May 2008) | 21 lines

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

........
r115320 | mmichelson | 2008-05-05 16:41:34 -0500 (Mon, 05 May 2008) | 13 lines

Don't consider a caller "handled" until the caller is bridged with
a queue member. There was too much of an opportunity for the member
to hang up (either during a delay, announcement, or overly long
agi) between the time that he answered the phone and the time when
he actually was bridged with the caller. The consequence of this
was that if the member hung up in that interval, then proper
abandonment details would not be noted in the queue log if the caller
were to hang up at any point after the member hangup.

(closes issue #12561)
Reported by: ablackthorn


........

................
r115324 | russell | 2008-05-05 18:01:56 -0400 (Mon, 05 May 2008) | 2 lines

Simplify code by using a taskprocessor for dispatching events in the Asterisk core.

................
r115328 | file | 2008-05-05 18:13:57 -0400 (Mon, 05 May 2008) | 10 lines

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

........
r115327 | file | 2008-05-05 19:10:05 -0300 (Mon, 05 May 2008) | 2 lines

Make sure that either the main speex library contains preprocess functions or that speexdsp does. If both fail then speex stuff can not be built.

........

................
r115329 | mmichelson | 2008-05-05 18:14:06 -0400 (Mon, 05 May 2008) | 15 lines

#execing the same file multiple times led to warning messages saying that the same file was
being #included twice. This was due to the fact that #exec created a temporary file which
was then #included. The name of the temporary file was the name of the #exec'd file, with
the Unix timestamp and thread ID concatenated. The issue was that if multiple #exec statements
of the same file were reached in the same second, then the result was that the temporary files
would have duplicate names. To resolve this, the temporary file now has microsecond resolution
for the timestamp portion.

(closes issue #12574)
Reported by: jmls
Patches:
      12574.patch uploaded by putnopvut (license 60)
Tested by: jmls, putnopvut


................
r115334 | tilghman | 2008-05-05 19:00:31 -0400 (Mon, 05 May 2008) | 15 lines

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

........
r115333 | tilghman | 2008-05-05 17:50:31 -0500 (Mon, 05 May 2008) | 7 lines

Separate verbose output from CLI output, by using a preamble.
(closes issue #12402)
 Reported by: Corydon76
 Patches: 
       20080410__no_verbose_in_rx_output.diff.txt uploaded by Corydon76 (license 14)
       20080501__no_verbose_in_rx_output__1.4.diff.txt uploaded by Corydon76 (license 14)

........

................
r115337 | tilghman | 2008-05-05 19:38:15 -0400 (Mon, 05 May 2008) | 2 lines

Merge refcounting of res_odbc

................
r115342 | file | 2008-05-06 09:55:44 -0400 (Tue, 06 May 2008) | 10 lines

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

........
r115341 | file | 2008-05-06 10:54:15 -0300 (Tue, 06 May 2008) | 2 lines

Add in missing argument.

........

................
r115344 | russell | 2008-05-06 11:14:55 -0400 (Tue, 06 May 2008) | 2 lines

Change some NOTICE log messages to debug.

................
r115416 | tilghman | 2008-05-06 15:32:29 -0400 (Tue, 06 May 2008) | 10 lines

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

........
r115415 | tilghman | 2008-05-06 14:31:39 -0500 (Tue, 06 May 2008) | 2 lines

Don't print the terminating NUL.  (Closes issue #12589)

........

................
r115419 | qwell | 2008-05-06 15:38:44 -0400 (Tue, 06 May 2008) | 15 lines

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

........
r115418 | qwell | 2008-05-06 14:34:58 -0500 (Tue, 06 May 2008) | 7 lines

Switch to using ast_random() rather than just rand().
This does not fix the bug reported, but I believe it is correct.

(from issue #12446)
Patches:
      bug_12446.diff uploaded by snuffy (license 35)

........

................
r115423 | qwell | 2008-05-06 15:55:45 -0400 (Tue, 06 May 2008) | 23 lines

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

................
r115422 | qwell | 2008-05-06 14:55:29 -0500 (Tue, 06 May 2008) | 15 lines

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

........
r115421 | qwell | 2008-05-06 14:54:57 -0500 (Tue, 06 May 2008) | 7 lines

read requires an argument on some non-bash shells

(closes issue #12593)
Reported by: bkruse
Patches:
      getilbc.sh_12593_v1.diff uploaded by bkruse (license 132)

........

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

................
r115473 | mmichelson | 2008-05-06 16:15:02 -0400 (Tue, 06 May 2008) | 3 lines

Get refcounter to build with LOW_MEMORY defined


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

Modified:
    team/seanbright/resolve-shadow-warnings/   (props changed)
    team/seanbright/resolve-shadow-warnings/Makefile
    team/seanbright/resolve-shadow-warnings/UPGRADE.txt
    team/seanbright/resolve-shadow-warnings/apps/app_queue.c
    team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in
    team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
    team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
    team/seanbright/resolve-shadow-warnings/codecs/codec_speex.c
    team/seanbright/resolve-shadow-warnings/configure
    team/seanbright/resolve-shadow-warnings/configure.ac
    team/seanbright/resolve-shadow-warnings/contrib/scripts/get_ilbc_source.sh
    team/seanbright/resolve-shadow-warnings/funcs/func_speex.c
    team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in
    team/seanbright/resolve-shadow-warnings/include/asterisk/res_odbc.h
    team/seanbright/resolve-shadow-warnings/main/asterisk.c
    team/seanbright/resolve-shadow-warnings/main/config.c
    team/seanbright/resolve-shadow-warnings/main/event.c
    team/seanbright/resolve-shadow-warnings/main/logger.c
    team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c
    team/seanbright/resolve-shadow-warnings/res/res_odbc.c
    team/seanbright/resolve-shadow-warnings/utils/refcounter.c

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May  6 18:12:54 2008
@@ -1,1 +1,1 @@
-/trunk:1-115301
+/trunk:1-115503

Modified: team/seanbright/resolve-shadow-warnings/Makefile
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/Makefile?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/Makefile (original)
+++ team/seanbright/resolve-shadow-warnings/Makefile Tue May  6 18:12:54 2008
@@ -351,7 +351,7 @@
 	@exit 1
 
 menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts
-	menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
+	menuselect/menuselect --check-deps menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
 
 $(MOD_SUBDIRS_EMBED_LDSCRIPT):
 	@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
@@ -821,16 +821,16 @@
 nmenuconfig: nmenuselect
 
 menuselect: menuselect/menuselect menuselect-tree
-	- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+	- at menuselect/menuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 cmenuselect: menuselect/cmenuselect menuselect-tree
-	- at menuselect/cmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+	- at menuselect/cmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 gmenuselect: menuselect/gmenuselect menuselect-tree
-	- at menuselect/gmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+	- at menuselect/gmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 nmenuselect: menuselect/nmenuselect menuselect-tree
-	- at menuselect/nmenuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+	- at menuselect/nmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 # options for make in menuselect/
 MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
@@ -869,4 +869,4 @@
 asterisk.pdf:
 	$(MAKE) -C doc/tex asterisk.pdf
 
-.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell main/version.c include/asterisk/version.h installdirs
+.PHONY: menuselect menuselect.makeopts main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell main/version.c include/asterisk/version.h installdirs

Modified: team/seanbright/resolve-shadow-warnings/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/UPGRADE.txt?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/UPGRADE.txt (original)
+++ team/seanbright/resolve-shadow-warnings/UPGRADE.txt Tue May  6 18:12:54 2008
@@ -110,6 +110,8 @@
   instead.
 * While app_directory has always relied on having a voicemail.conf or users.conf file
   correctly set up, it now is dependent on app_voicemail being compiled as well.
+* The arguments in ExecIf changed a bit, to be more like other applications.
+  The syntax is now ExecIf(<cond>?appiftrue(args):appiffalse(args)).
 
 Dialplan Functions:
 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_queue.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_queue.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_queue.c Tue May  6 18:12:54 2008
@@ -3294,7 +3294,6 @@
 		/* Ah ha!  Someone answered within the desired timeframe.  Of course after this
 		   we will always return with -1 so that it is hung up properly after the
 		   conversation.  */
-		qe->handled++;
 		if (!strcmp(qe->chan->tech->type, "Zap"))
 			ast_channel_setoption(qe->chan, AST_OPTION_TONE_VERIFY, &nondataquality, sizeof(nondataquality), 0);
 		if (!strcmp(peer->tech->type, "Zap"))
@@ -3348,7 +3347,6 @@
 				/* Agent must have hung up */
 				ast_log(LOG_WARNING, "Agent on %s hungup on the customer.\n", peer->name);
 				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "AGENTDUMP", "%s", "");
-				record_abandoned(qe);
 				if (qe->parent->eventwhencalled)
 					manager_event(EVENT_FLAG_AGENT, "AgentDump",
 							"Queue: %s\r\n"
@@ -3628,6 +3626,7 @@
 			} else
 				ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
 		}
+		qe->handled++;
 		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
 													(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
 		if (update_cdr && qe->chan->cdr) 

Modified: team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in (original)
+++ team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in Tue May  6 18:12:54 2008
@@ -32,6 +32,7 @@
 RADIUS=@PBX_RADIUS@
 SPEEX=@PBX_SPEEX@
 SPEEXDSP=@PBX_SPEEXDSP@
+SPEEX_PREPROCESS=@PBX_SPEEX_PREPROCESS@
 SQLITE3=@PBX_SQLITE3@
 SQLITE=@PBX_SQLITE@
 SS7=@PBX_SS7@

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c Tue May  6 18:12:54 2008
@@ -1590,20 +1590,7 @@
 	ao2_unlink(iax_peercallno_pvts, pvt);
 }
 
-/*!
- * \todo XXX Note that this function contains a very expensive operation that
- * happens for *every* incoming media frame.  It iterates through every
- * possible call number, locking and unlocking each one, to try to match the
- * incoming frame to an active call.  Call numbers can be up to 2^15, 32768.
- * So, for a call with a local call number of 20000, every incoming audio
- * frame would require 20000 mutex lock and unlock operations.  Ouch.
- *
- * It's a shame that IAX2 media frames carry the source call number instead of
- * the destination call number.  If they did, this lookup wouldn't be needed.
- * However, it's too late to change that now.  Instead, we need to come up with
- * a better way of indexing active calls so that these frequent lookups are not
- * so expensive.
- *
+/*
  * \note Calling this function while holding another pvt lock can cause a deadlock.
  */
 static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked, int full_frame)

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_sip.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_sip.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_sip.c Tue May  6 18:12:54 2008
@@ -15055,6 +15055,7 @@
 	char resp[256];
 	char resp_hash[256];
 	char uri[256];
+	char opaque[256] = "";
 	char cnonce[80];
 	const char *username;
 	const char *secret;
@@ -15103,11 +15104,17 @@
 	else
 		snprintf(resp, sizeof(resp), "%s:%s:%s", a1_hash, p->nonce, a2_hash);
 	ast_md5_hash(resp_hash, resp);
+
+	/* only include the opaque string if it's set */
+	if (!ast_strlen_zero(p->opaque)) {
+	  snprintf(opaque, sizeof(opaque), ", opaque=\"%s\"", p->opaque);
+	}
+
 	/* XXX We hard code our qop to "auth" for now.  XXX */
 	if (!ast_strlen_zero(p->qop))
-		snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\", qop=auth, cnonce=\"%s\", nc=%08x", username, p->realm, uri, p->nonce, resp_hash, p->opaque, cnonce, p->noncecount);
+		snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\"%s, qop=auth, cnonce=\"%s\", nc=%08x", username, p->realm, uri, p->nonce, resp_hash, opaque, cnonce, p->noncecount);
 	else
-		snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"", username, p->realm, uri, p->nonce, resp_hash, p->opaque);
+		snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\"%s", username, p->realm, uri, p->nonce, resp_hash, opaque);
 
 	append_history(p, "AuthResp", "Auth response sent for %s in realm %s - nc %d", username, p->realm, p->noncecount);
 
@@ -21966,7 +21973,7 @@
 	/* Done, tell the manager */
 	manager_event(EVENT_FLAG_SYSTEM, "ChannelReload", "ChannelType: SIP\r\nReloadReason: %s\r\nRegistry_Count: %d\r\nPeer_Count: %d\r\nUser_Count: %d\r\n", channelreloadreason2txt(reason), registry_count, peer_count, user_count);
 	run_end = time(0);
-	ast_log(LOG_NOTICE, "reload_config done...Runtime= %d sec\n", (int)(run_end-run_start));
+	ast_debug(4, "reload_config done...Runtime= %d sec\n", (int)(run_end-run_start));
 
 	return 0;
 }
@@ -22485,7 +22492,7 @@
 	sip_send_all_registers();
 	end_poke = time(0);
 	
-	ast_log(LOG_NOTICE, "do_reload finished. peer poke/prune reg contact time = %d sec.\n", (int)(end_poke-start_poke));
+	ast_debug(4, "do_reload finished. peer poke/prune reg contact time = %d sec.\n", (int)(end_poke-start_poke));
 
 	ast_debug(4, "--------------- SIP reload done\n");
 

Modified: team/seanbright/resolve-shadow-warnings/codecs/codec_speex.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/codecs/codec_speex.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/codecs/codec_speex.c (original)
+++ team/seanbright/resolve-shadow-warnings/codecs/codec_speex.c Tue May  6 18:12:54 2008
@@ -32,6 +32,7 @@
 
 /*** MODULEINFO
 	<depend>speex</depend>
+	<depend>speex_preprocess</depend>
 	<use>speexdsp</use>
  ***/
 

Modified: team/seanbright/resolve-shadow-warnings/configure.ac
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/configure.ac?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/configure.ac (original)
+++ team/seanbright/resolve-shadow-warnings/configure.ac Tue May  6 18:12:54 2008
@@ -1323,7 +1323,18 @@
 
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
 
+# See if the main speex library contains the preprocess functions
+AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
+if test "${PBX_SPEEX_PREPROCESS}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
 AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
+if test "${PBX_SPEEXDSP}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
+AC_SUBST(PBX_SPEEX_PREPROCESS)
 
 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
 

Modified: team/seanbright/resolve-shadow-warnings/contrib/scripts/get_ilbc_source.sh
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/contrib/scripts/get_ilbc_source.sh?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/contrib/scripts/get_ilbc_source.sh (original)
+++ team/seanbright/resolve-shadow-warnings/contrib/scripts/get_ilbc_source.sh Tue May  6 18:12:54 2008
@@ -18,7 +18,7 @@
 echo "If you have not done so, you can abort the script now."
 echo "***"
 
-read
+read tmp
 
 wget -P codecs/ilbc http://www.ietf.org/rfc/rfc3951.txt
 

Modified: team/seanbright/resolve-shadow-warnings/funcs/func_speex.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/funcs/func_speex.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_speex.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_speex.c Tue May  6 18:12:54 2008
@@ -31,6 +31,8 @@
 
 /*** MODULEINFO
 	<depend>speex</depend>
+	<depend>speex_preprocess</depend>
+	<use>speexdsp</use>
  ***/
 
 #include "asterisk.h"

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in Tue May  6 18:12:54 2008
@@ -723,6 +723,12 @@
 
 /* Define to indicate the ${SPEEXDSP_DESCRIP} library version */
 #undef HAVE_SPEEXDSP_VERSION
+
+/* Define this to indicate the ${SPEEX_PREPROCESS_DESCRIP} library */
+#undef HAVE_SPEEX_PREPROCESS
+
+/* Define to indicate the ${SPEEX_PREPROCESS_DESCRIP} library version */
+#undef HAVE_SPEEX_PREPROCESS_VERSION
 
 /* Define to indicate the ${SPEEX_DESCRIP} library version */
 #undef HAVE_SPEEX_VERSION
@@ -1181,6 +1187,9 @@
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
 
 /* Define like PROTOTYPES; this can be used by system headers. */
 #undef __PROTOTYPES

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/res_odbc.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/res_odbc.h?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/res_odbc.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/res_odbc.h Tue May  6 18:12:54 2008
@@ -96,7 +96,7 @@
 
 /*! \brief Checks if the database natively supports backslash as an escape character.
  * \param obj The ODBC object
- * \return Returns 1 if an ESCAPE clause is needed to support '\', 0 otherwise
+ * \return Returns 1 if backslash is a native escape character, 0 if an ESCAPE clause is needed to support '\'
  */
 int ast_odbc_backslash_is_escape(struct odbc_obj *obj);
 

Modified: team/seanbright/resolve-shadow-warnings/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/asterisk.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/asterisk.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/asterisk.c Tue May  6 18:12:54 2008
@@ -1420,6 +1420,12 @@
 static const char *fix_header(char *outbuf, int maxout, const char *s, char *cmp)
 {
 	const char *c;
+
+	/* Check for verboser preamble */
+	if (*s == 127) {
+		s++;
+	}
+
 	if (!strncmp(s, cmp, strlen(cmp))) {
 		c = s + strlen(cmp);
 		term_color(outbuf, cmp, COLOR_GRAY, 0, maxout);
@@ -1928,6 +1934,7 @@
 
 			buf[res] = '\0';
 
+			/* Write over the CLI prompt */
 			if (!ast_opt_exec && !lastpos)
 				write(STDOUT_FILENO, "\r", 1);
 			write(STDOUT_FILENO, buf, res);
@@ -2425,13 +2432,38 @@
 		ast_el_read_history(filename);
 
 	if (ast_opt_exec && data) {  /* hack to print output then exit if asterisk -rx is used */
-		char tempchar;
 		struct pollfd fds;
 		fds.fd = ast_consock;
 		fds.events = POLLIN;
 		fds.revents = 0;
-		while (poll(&fds, 1, 100) > 0)
-			ast_el_read_char(el, &tempchar);
+		while (poll(&fds, 1, 500) > 0) {
+			char buffer[512] = "", *curline = buffer, *nextline;
+			int not_written = 1;
+
+			if (read(ast_consock, buffer, sizeof(buffer) - 1) < 0) {
+				break;
+			}
+
+			do {
+				if ((nextline = strchr(curline, '\n'))) {
+					nextline++;
+				} else {
+					nextline = strchr(curline, '\0');
+				}
+
+				/* Skip verbose lines */
+				if (*curline != 127) {
+					not_written = 0;
+					write(STDOUT_FILENO, curline, nextline - curline);
+				}
+				curline = nextline;
+			} while (!ast_strlen_zero(curline));
+
+			/* No non-verbose output in 500ms */
+			if (not_written) {
+				break;
+			}
+		}
 		return;
 	}
 	for (;;) {

Modified: team/seanbright/resolve-shadow-warnings/main/config.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/config.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/config.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/config.c Tue May  6 18:12:54 2008
@@ -1056,9 +1056,10 @@
 				/* #exec </path/to/executable>
 				   We create a tmp file, then we #include it, then we delete it. */
 				if (!do_include) {
+					struct timeval when = ast_tvnow();
 					if (!ast_test_flag(&flags, CONFIG_FLAG_NOCACHE))
 						config_cache_attribute(configfile, ATTRIBUTE_EXEC, NULL, who_asked);
-					snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d.%ld", (int)time(NULL), (long)pthread_self());
+					snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d%d.%ld", (int) when.tv_sec, (int) when.tv_usec, (long)pthread_self());
 					snprintf(cmd, sizeof(cmd), "%s > %s 2>&1", cur, exec_file);
 					ast_safe_system(cmd);
 					cur = exec_file;

Modified: team/seanbright/resolve-shadow-warnings/main/event.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/event.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/event.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/event.c Tue May  6 18:12:54 2008
@@ -34,9 +34,9 @@
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 #include "asterisk/unaligned.h"
-
-/* Only use one thread for now to ensure ordered delivery */
-#define NUM_EVENT_THREADS 1
+#include "asterisk/taskprocessor.h"
+
+struct ast_taskprocessor *event_dispatcher;
 
 /*!
  * \brief An event information element
@@ -82,15 +82,6 @@
 	uint16_t event_len;
 	const struct ast_event *event;
 	struct ast_event_ie *ie;
-};
-
-/*! \brief data shared between event dispatching threads */
-static struct {
-	ast_cond_t cond;
-	ast_mutex_t lock;
-	AST_LIST_HEAD_NOLOCK(, ast_event_ref) event_q;
-} event_thread = {
-	.lock = AST_MUTEX_INIT_VALUE,
 };
 
 struct ast_event_ie_val {
@@ -717,6 +708,50 @@
 	return (ast_event_queue(event) || res) ? -1 : 0;
 }
 
+static int handle_event(void *data)
+{
+	struct ast_event_ref *event_ref = data;
+	struct ast_event_sub *sub;
+	uint16_t host_event_type;
+
+	host_event_type = ntohs(event_ref->event->type);
+
+	/* Subscribers to this specific event first */
+	AST_RWDLLIST_RDLOCK(&ast_event_subs[host_event_type]);
+	AST_RWDLLIST_TRAVERSE(&ast_event_subs[host_event_type], sub, entry) {
+		struct ast_event_ie_val *ie_val;
+		AST_LIST_TRAVERSE(&sub->ie_vals, ie_val, entry) {
+			if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_EXISTS &&
+				ast_event_get_ie_raw(event_ref->event, ie_val->ie_type)) {
+				continue;
+			} else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_UINT &&
+				ast_event_get_ie_uint(event_ref->event, ie_val->ie_type) 
+				== ie_val->payload.uint) {
+				continue;
+			} else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR &&
+				!strcmp(ast_event_get_ie_str(event_ref->event, ie_val->ie_type),
+					ie_val->payload.str)) {
+				continue;
+			}
+			break;
+		}
+		if (ie_val)
+			continue;
+		sub->cb(event_ref->event, sub->userdata);
+	}
+	AST_RWDLLIST_UNLOCK(&ast_event_subs[host_event_type]);
+
+	/* Now to subscribers to all event types */
+	AST_RWDLLIST_RDLOCK(&ast_event_subs[AST_EVENT_ALL]);
+	AST_RWDLLIST_TRAVERSE(&ast_event_subs[AST_EVENT_ALL], sub, entry)
+		sub->cb(event_ref->event, sub->userdata);
+	AST_RWDLLIST_UNLOCK(&ast_event_subs[AST_EVENT_ALL]);
+
+	ast_event_ref_destroy(event_ref);
+
+	return 0;
+}
+
 int ast_event_queue(struct ast_event *event)
 {
 	struct ast_event_ref *event_ref;
@@ -743,63 +778,7 @@
 
 	event_ref->event = event;
 
-	ast_mutex_lock(&event_thread.lock);
-	AST_LIST_INSERT_TAIL(&event_thread.event_q, event_ref, entry);
-	ast_cond_signal(&event_thread.cond);
-	ast_mutex_unlock(&event_thread.lock);
-
-	return 0;
-}
-
-static void *ast_event_dispatcher(void *unused)
-{
-	for (;;) {
-		struct ast_event_ref *event_ref;
-		struct ast_event_sub *sub;
-		uint16_t host_event_type;
-
-		ast_mutex_lock(&event_thread.lock);
-		while (!(event_ref = AST_LIST_REMOVE_HEAD(&event_thread.event_q, entry)))
-			ast_cond_wait(&event_thread.cond, &event_thread.lock);
-		ast_mutex_unlock(&event_thread.lock);
-
-		host_event_type = ntohs(event_ref->event->type);
-
-		/* Subscribers to this specific event first */
-		AST_RWDLLIST_RDLOCK(&ast_event_subs[host_event_type]);
-		AST_RWDLLIST_TRAVERSE(&ast_event_subs[host_event_type], sub, entry) {
-			struct ast_event_ie_val *ie_val;
-			AST_LIST_TRAVERSE(&sub->ie_vals, ie_val, entry) {
-				if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_EXISTS &&
-					ast_event_get_ie_raw(event_ref->event, ie_val->ie_type)) {
-					continue;
-				} else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_UINT &&
-					ast_event_get_ie_uint(event_ref->event, ie_val->ie_type) 
-					== ie_val->payload.uint) {
-					continue;
-				} else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR &&
-					!strcmp(ast_event_get_ie_str(event_ref->event, ie_val->ie_type),
-						ie_val->payload.str)) {
-					continue;
-				}
-				break;
-			}
-			if (ie_val)
-				continue;
-			sub->cb(event_ref->event, sub->userdata);
-		}
-		AST_RWDLLIST_UNLOCK(&ast_event_subs[host_event_type]);
-
-		/* Now to subscribers to all event types */
-		AST_RWDLLIST_RDLOCK(&ast_event_subs[AST_EVENT_ALL]);
-		AST_RWDLLIST_TRAVERSE(&ast_event_subs[AST_EVENT_ALL], sub, entry)
-			sub->cb(event_ref->event, sub->userdata);
-		AST_RWDLLIST_UNLOCK(&ast_event_subs[AST_EVENT_ALL]);
-
-		ast_event_ref_destroy(event_ref);
-	}
-
-	return NULL;
+	return ast_taskprocessor_push(event_dispatcher, handle_event, event_ref);
 }
 
 void ast_event_init(void)
@@ -812,10 +791,5 @@
 	for (i = 0; i < AST_EVENT_TOTAL; i++)
 		AST_RWLIST_HEAD_INIT(&ast_event_cache[i]);
 
-	ast_cond_init(&event_thread.cond, NULL);
-
-	for (i = 0; i < NUM_EVENT_THREADS; i++) {
-		pthread_t dont_care;
-		ast_pthread_create_background(&dont_care, NULL, ast_event_dispatcher, NULL);
-	}
-}
+	event_dispatcher = ast_taskprocessor_get("core_event_dispatcher", 0);
+}

Modified: team/seanbright/resolve-shadow-warnings/main/logger.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/logger.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/logger.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/logger.c Tue May  6 18:12:54 2008
@@ -1176,8 +1176,12 @@
 		ast_localtime(&now, &tm, NULL);
 		ast_strftime(date, sizeof(date), dateformat, &tm);
 		datefmt = alloca(strlen(date) + 3 + strlen(fmt) + 1);
-		sprintf(datefmt, "[%s] %s", date, fmt);
+		sprintf(datefmt, "%c[%s] %s", 127, date, fmt);
 		fmt = datefmt;
+	} else {
+		char *tmp = alloca(strlen(fmt) + 2);
+		sprintf(tmp, "%c%s", 127, fmt);
+		fmt = tmp;
 	}
 
 	/* Build string */
@@ -1194,7 +1198,7 @@
 
 	strcpy(logmsg->str, buf->str);
 
-	ast_log(LOG_VERBOSE, "%s", logmsg->str);
+	ast_log(LOG_VERBOSE, "%s", logmsg->str + 1);
 
 	/* Set type */
 	logmsg->type = LOGMSG_VERBOSE;

Modified: team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c Tue May  6 18:12:54 2008
@@ -256,7 +256,7 @@
 	} else if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
 		/* Get a random file and ensure we can open it */
 		for (tries = 0; tries < 20; tries++) {
-			state->pos = rand() % state->class->total_files;
+			state->pos = ast_random() % state->class->total_files;
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
 				break;
 		}

Modified: team/seanbright/resolve-shadow-warnings/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_odbc.c?view=diff&rev=115504&r1=115503&r2=115504
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_odbc.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_odbc.c Tue May  6 18:12:54 2008
@@ -47,6 +47,7 @@
 #include "asterisk/lock.h"
 #include "asterisk/res_odbc.h"
 #include "asterisk/time.h"
+#include "asterisk/astobj2.h"
 
 struct odbc_class
 {
@@ -55,23 +56,52 @@
 	char dsn[80];
 	char *username;
 	char *password;
-	char sanitysql[256];
+	char *sanitysql;
 	SQLHENV env;
-	unsigned int haspool:1;         /* Boolean - TDS databases need this */
-	unsigned int limit:10;          /* Gives a limit of 1023 maximum */
-	unsigned int count:10;          /* Running count of pooled connections */
-	unsigned int delme:1;			/* Purge the class */
-	unsigned int backslash_is_escape:1;	/* On this database, the backslash is a native escape sequence */
-	unsigned int idlecheck;			/* Recheck the connection if it is idle for this long */
-	AST_LIST_HEAD(, odbc_obj) odbc_obj;
+	unsigned int haspool:1;              /* Boolean - TDS databases need this */
+	unsigned int limit:10;               /* Gives a limit of 1023 maximum */
+	unsigned int count:10;               /* Running count of pooled connections */
+	unsigned int delme:1;                /* Purge the class */
+	unsigned int backslash_is_escape:1;  /* On this database, the backslash is a native escape sequence */
+	unsigned int idlecheck;              /* Recheck the connection if it is idle for this long */
+	struct ao2_container *obj_container;
 };
 
-AST_LIST_HEAD_STATIC(odbc_list, odbc_class);
+struct ao2_container *class_container;
 
 static odbc_status odbc_obj_connect(struct odbc_obj *obj);
 static odbc_status odbc_obj_disconnect(struct odbc_obj *obj);
 static int odbc_register_class(struct odbc_class *class, int connect);
 
+static void odbc_class_destructor(void *data)
+{
+	struct odbc_class *class = data;
+	/* Due to refcounts, we can safely assume that any objects with a reference
+	 * to us will prevent our destruction, so we don't need to worry about them.
+	 */
+	if (class->username)
+		ast_free(class->username);
+	if (class->password)
+		ast_free(class->password);
+	if (class->sanitysql)
+		ast_free(class->sanitysql);
+	ao2_ref(class->obj_container, -1);
+	SQLFreeHandle(SQL_HANDLE_ENV, class->env);
+}
+
+static int null_hash_fn(const void *obj, const int flags)
+{
+	return 0;
+}
+
+static void odbc_obj_destructor(void *data)
+{
+	struct odbc_obj *obj = data;
+	odbc_obj_disconnect(obj);
+	ast_mutex_destroy(&obj->lock);
+	ao2_ref(obj->parent, -1);
+	ast_free(obj);
+}
 
 SQLHSTMT ast_odbc_direct_execute(struct odbc_obj *obj, SQLHSTMT (*exec_cb)(struct odbc_obj *obj, void *data), void *data)
 {
@@ -167,22 +197,6 @@
 				}
 			}
 		}
-#if 0
-		/* This is a really bad method of trying to correct a dead connection.  It
-		 * only ever really worked with MySQL.  It will not work with any other
-		 * database, since most databases prepare their statements on the server,
-		 * and if you disconnect, you invalidate the statement handle.  Hence, if
-		 * you disconnect, you're going to fail anyway, whether you try to execute
-		 * a second time or not.
-		 */
-		ast_log(LOG_WARNING, "SQL Execute error %d! Attempting a reconnect...\n", res);
-		ast_mutex_lock(&obj->lock);
-		obj->up = 0;
-		ast_mutex_unlock(&obj->lock);
-		odbc_obj_disconnect(obj);
-		odbc_obj_connect(obj);
-		res = SQLExecute(stmt);
-#endif
 	} else
 		obj->last_used = ast_tvnow();
 	
@@ -296,32 +310,23 @@
 			}
 
 			if (enabled && !ast_strlen_zero(dsn)) {
-				new = ast_calloc(1, sizeof(*new));
+				new = ao2_alloc(sizeof(*new), odbc_class_destructor);
 
 				if (!new) {
 					res = -1;
 					break;
 				}
 
-				if (cat)
-					ast_copy_string(new->name, cat, sizeof(new->name));
-				if (dsn)
-					ast_copy_string(new->dsn, dsn, sizeof(new->dsn));
-				if (username)
-					new->username = ast_strdup(username);
-				if (password)
-					new->password = ast_strdup(password);
-				if (sanitysql)
-					ast_copy_string(new->sanitysql, sanitysql, sizeof(new->sanitysql));
-
 				SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &new->env);
 				res = SQLSetEnvAttr(new->env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
 
 				if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 					ast_log(LOG_WARNING, "res_odbc: Error SetEnv\n");
-					SQLFreeHandle(SQL_HANDLE_ENV, new->env);
+					ao2_ref(new, -1);
 					return res;
 				}
+

[... 471 lines stripped ...]



More information about the svn-commits mailing list