[asterisk-commits] rmudgett: branch group/issue8824 r168635 - in /team/group/issue8824: ./ apps/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 14 21:23:18 CST 2009


Author: rmudgett
Date: Wed Jan 14 21:23:18 2009
New Revision: 168635

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168635
Log:
Resolved conflicts in channels/chan_misdn.c

Merged revisions 168479,168481,168485,168497,168508,168517,168522-168523,168526,168539,168547,168562,168575,168578-168579,168585,168588,168591,168594,168599,168601,168604,168609-168610,168613,168615,168619,168623 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r168479 | oej | 2009-01-12 08:35:09 -0600 (Mon, 12 Jan 2009) | 2 lines
  
  Don't include swap.h unless we have swapctl
................
  r168481 | russell | 2009-01-12 08:57:49 -0600 (Mon, 12 Jan 2009) | 10 lines
  
  Merged revisions 168480 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r168480 | russell | 2009-01-12 08:57:27 -0600 (Mon, 12 Jan 2009) | 2 lines
  
  s/ringdance/ringcadence/ for Bulgaria
  
  ........
................
  r168485 | mmichelson | 2009-01-12 09:00:00 -0600 (Mon, 12 Jan 2009) | 13 lines
  
  Merged revisions 168482 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r168482 | mmichelson | 2009-01-12 08:58:25 -0600 (Mon, 12 Jan 2009) | 5 lines
  
  I am reverting the fix made in revision 168128 (and its upward merges)
  after being contacted by Olle Johansson and being shown how this fix is
  incorrect. Thanks to Olle for clearing this up for me.
  
  
  ........
................
  r168497 | oej | 2009-01-12 10:31:27 -0600 (Mon, 12 Jan 2009) | 2 lines
  
  Better to use the proper app name
................
  r168508 | jpeeler | 2009-01-12 14:53:04 -0600 (Mon, 12 Jan 2009) | 15 lines
  
  Merged revisions 168507 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168507 | jpeeler | 2009-01-12 14:26:22 -0600 (Mon, 12 Jan 2009) | 9 lines
    
    (closes issue #12269)
    Reported by: IgorG
    Tested by: denisgalvao
    
    This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.
    
    Review: http://reviewboard.digium.com/r/35/
  ........
................
  r168517 | jpeeler | 2009-01-12 15:51:46 -0600 (Mon, 12 Jan 2009) | 12 lines
  
  Merged revisions 168516 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168516 | jpeeler | 2009-01-12 15:42:34 -0600 (Mon, 12 Jan 2009) | 5 lines
    
    (closes issue #13881)
    Reported by: hoowa
    
    Update the app CDR field for AGI commands that are not executing an application via "exec".
  ........
................
  r168522 | tilghman | 2009-01-12 17:06:12 -0600 (Mon, 12 Jan 2009) | 3 lines
  
  Some platforms (notably, the BSDs) have a more efficient implementation called
  closefrom(3).
................
  r168523 | mmichelson | 2009-01-12 17:12:30 -0600 (Mon, 12 Jan 2009) | 11 lines
  
  bump the verbosity of a message in srv.c up by one. It used to be
  at this level prior to a large patch merge which converted ast_verbose
  calls to ast_verb
  
  (closes issue #14221)
  Reported by: jcovert
  Patches:
        srv.c.patch uploaded by jcovert (license 551)
................
  r168526 | tilghman | 2009-01-12 17:45:51 -0600 (Mon, 12 Jan 2009) | 12 lines
  
  Merged revisions 167095 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r167095 | tilghman | 2008-12-31 18:01:22 -0600 (Wed, 31 Dec 2008) | 5 lines
    
    Repeat attempts to write when we receive -EAGAIN from the driver, as detailed
    in the ALSA sample code (see http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a32)
    Reported by: Jerry Geis (via the -users list)
    Fixed by: me (license 14)
  ........
................
  r168539 | dhubbard | 2009-01-13 10:02:13 -0600 (Tue, 13 Jan 2009) | 1 line
  
  correct a CLI description
................
  r168547 | tilghman | 2009-01-13 11:51:12 -0600 (Tue, 13 Jan 2009) | 13 lines
  
  Merged revisions 168546 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines
    
    If either conditional is NULL, don't try copying it.
    (closes issue #14226)
     Reported by: caspy
     Patches: 
           20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)
  ........
................
  r168562 | russell | 2009-01-13 13:22:13 -0600 (Tue, 13 Jan 2009) | 10 lines
  
  Merged revisions 168561 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines
  
  Revert unnecessary indications API change from rev 122314
  
  ........
................
  r168575 | mmichelson | 2009-01-13 15:18:13 -0600 (Tue, 13 Jan 2009) | 13 lines
  
  Allow specifying a port number in the user portion of a register => line in sip.conf
  
  With this commit, a register => line in sip.conf may contain a port number in the
  "user" section of the line. Please see CHANGES and sip.conf.sample for more
  details regarding this.
  
  (closes issue #14198)
  Reported by: Nick_Lewis
  Patches:
        chan_sip.c-domainport2.patch uploaded by Nick (license 657)
  Tested by: Nick_Lewis
................
  r168578 | twilson | 2009-01-13 16:22:34 -0600 (Tue, 13 Jan 2009) | 14 lines
  
  Merged revisions 168551 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168551 | twilson | 2009-01-13 12:34:14 -0600 (Tue, 13 Jan 2009) | 7 lines
    
    Don't pass a value with a side effect to a macro
    
    (closes issue #14176)
    Reported by: paraeco
    Patches: 
          chan_sip.c.diff uploaded by paraeco (license 658)
  ........
................
  r168579 | mmichelson | 2009-01-13 16:30:59 -0600 (Tue, 13 Jan 2009) | 13 lines
  
  Clarify a message that app_queue prints and change to a debug-level message
  
  The "No one is answering..." verbose message contained 3 numbers that were not
  explained in any way to whoever was viewing the message. It is more helpful now
  since the message explains what the numbers mean. Also, the message has been
  downgraded to "DEBUG" level.
  
  (closes issue #14172)
  Reported by: caio1982
  Patches:
        queue_answering_debug.diff uploaded by caio1982 (license 22)
................
  r168585 | twilson | 2009-01-13 17:00:27 -0600 (Tue, 13 Jan 2009) | 8 lines
  
  Add option to hide console connect messages
  
  (closes issue #14222)
  Reported by: jamesgolovich
  Patches: 
        asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
  Tested by: otherwiseguy
................
  r168588 | twilson | 2009-01-13 17:05:43 -0600 (Tue, 13 Jan 2009) | 5 lines
  
  Fully overwrite a same-named file when uploading
  
  (closes issue #14190)
  Reported by: timking
................
  r168591 | tilghman | 2009-01-13 17:57:46 -0600 (Tue, 13 Jan 2009) | 6 lines
  
  Janitor patch for chan_misdn (make channel variable access safe)
  (closes issue #12887)
   Reported by: pputman
   Patches: 
         chan_misdn_threadsafe.patch uploaded by pputman (license 81)
................
  r168594 | twilson | 2009-01-13 20:00:40 -0600 (Tue, 13 Jan 2009) | 27 lines
  
  Merged revisions 168593 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168593 | twilson | 2009-01-13 19:27:18 -0600 (Tue, 13 Jan 2009) | 20 lines
    
    Don't overflow when paging more than 128 extensions
    
    The number of available slots for calls in app_page was hardcoded to 128.
    Proper bounds checking was not in place to enforce this limit, so if more than
    128 extensions were passed to the Page() app, Asterisk would crash.  This patch
    instead dynamically allocates memory for the ast_dial structures and removes
    the (non-functional) arbitrary limit.
    
    This issue would have special importance to anyone who is dynamically creating
    the argument passed to the Page application and allowing more than 128
    extensions to be added by an outside user via some external interface.
    
    The patch posted by a_villacis was slightly modified for some coding guidelines
    and other cleanups.  Thanks, a_villacis!
    (closes issue #14217)
    Reported by: a_villacis
    Patches: 
          20080912-asterisk-app_page-fix-buffer-overflow.patch uploaded by a (license 660)
    Tested by: otherwiseguy
  ........
................
  r168599 | mmichelson | 2009-01-14 10:20:37 -0600 (Wed, 14 Jan 2009) | 15 lines
  
  Blocked revisions 168598 via svnmerge
  
  ........
  r168598 | mmichelson | 2009-01-14 10:19:26 -0600 (Wed, 14 Jan 2009) | 8 lines
  
  Fix a logic error I found while searching through chan_agent.c
  
  I found that the allow_multiple_logins function would never return
  0 due to an incorrect comparison being used when traversing the
  list of agents. While I was modifying this function, I also did
  a little bit of coding guidelines cleanup, too.
  
  
  ........
................
  r168601 | tilghman | 2009-01-14 12:27:57 -0600 (Wed, 14 Jan 2009) | 2 lines
  
  Mostly spacing changes; no functionality change at all.
................
  r168604 | tilghman | 2009-01-14 13:11:14 -0600 (Wed, 14 Jan 2009) | 14 lines
  
  Merged revisions 168603 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168603 | tilghman | 2009-01-14 13:02:55 -0600 (Wed, 14 Jan 2009) | 7 lines
    
    Don't read into a buffer without first checking if a value is beyond the end.
    (closes issue #13600)
     Reported by: atis
     Patches: 
           20090106__bug13600.diff.txt uploaded by Corydon76 (license 14)
     Tested by: atis
  ........
................
  r168609 | mvanbaak | 2009-01-14 13:36:57 -0600 (Wed, 14 Jan 2009) | 13 lines
  
  Fix compilation on FreeBSD and OSX
  
  This started as work to fix the 'core show sysinfo'
  CLI command but while working on it oej
  pointed out that read_credentials did not compile neither.
  So while being there, fix that as well.
  
  Thanks for all the testing oej!
  
  (closes issue #14129)
  Reported by: ys
  Tested by: oej, mvanbaak
................
  r168610 | mmichelson | 2009-01-14 14:13:48 -0600 (Wed, 14 Jan 2009) | 9 lines
  
  Restore the "sip show users" and "sip show user" CLI commands
  
  (closes issue #14180)
  Reported by: amorsen
  Patches:
        sip_show_users_161v3.diff uploaded by putnopvut (license 60)
  Tested by: blitzrage, amorsen
................
  r168613 | murf | 2009-01-14 14:51:26 -0600 (Wed, 14 Jan 2009) | 9 lines
  
  Merged revisions 168608 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168608 | murf | 2009-01-14 12:34:35 -0700 (Wed, 14 Jan 2009) | 1 line
    
    app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.
  ........
................
  r168615 | seanbright | 2009-01-14 14:58:26 -0600 (Wed, 14 Jan 2009) | 16 lines
  
  Merged revisions 168614 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168614 | seanbright | 2009-01-14 15:52:00 -0500 (Wed, 14 Jan 2009) | 9 lines
    
    Update autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
    be sure to run dahdi_test in 1.6.x and trunk instead of zttest.
    
    (closes issue #14132)
    Reported by: dsedivec
    Patches:
          asterisk-1.4-autosupport.patch uploaded by dsedivec (license 638)
          asterisk-trunk-autosupport.patch uploaded by dsedivec (license 638)
  ........
................
  r168619 | dbailey | 2009-01-14 15:19:45 -0600 (Wed, 14 Jan 2009) | 8 lines
  
  This fixes a problem where MWI FSK spills were being injected onto off hook fxs lines.
  (closes issue #14143)
  Reported by: alecdavis
  Patches:
        chan_dahdi-14143.patch.txt uploaded by dbailey (license )
  Tested by: alecdavis
................
  r168623 | rmudgett | 2009-01-14 15:51:06 -0600 (Wed, 14 Jan 2009) | 11 lines
  
  Merged revisions 168622 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r168622 | rmudgett | 2009-01-14 15:48:22 -0600 (Wed, 14 Jan 2009) | 4 lines
    
    *  Fixed create_process() allocation of process ID values.
    The allocated process IDs could overflow their respective
    NT and TE fields.  Affects outgoing calls.
  ........
................

Modified:
    team/group/issue8824/   (props changed)
    team/group/issue8824/CHANGES
    team/group/issue8824/Makefile
    team/group/issue8824/apps/app_disa.c
    team/group/issue8824/apps/app_minivm.c
    team/group/issue8824/apps/app_page.c
    team/group/issue8824/apps/app_queue.c
    team/group/issue8824/apps/app_read.c
    team/group/issue8824/apps/app_readexten.c
    team/group/issue8824/channels/chan_agent.c
    team/group/issue8824/channels/chan_alsa.c
    team/group/issue8824/channels/chan_dahdi.c
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/chan_sip.c
    team/group/issue8824/channels/chan_skinny.c
    team/group/issue8824/channels/chan_unistim.c
    team/group/issue8824/channels/misdn/isdn_lib.c
    team/group/issue8824/configs/indications.conf.sample
    team/group/issue8824/configs/sip.conf.sample
    team/group/issue8824/configure
    team/group/issue8824/configure.ac
    team/group/issue8824/contrib/scripts/autosupport
    team/group/issue8824/funcs/func_channel.c
    team/group/issue8824/funcs/func_logic.c
    team/group/issue8824/include/asterisk/autoconfig.h.in
    team/group/issue8824/include/asterisk/channel.h
    team/group/issue8824/include/asterisk/indications.h
    team/group/issue8824/include/asterisk/options.h
    team/group/issue8824/main/app.c
    team/group/issue8824/main/asterisk.c
    team/group/issue8824/main/channel.c
    team/group/issue8824/main/indications.c
    team/group/issue8824/main/pbx.c
    team/group/issue8824/main/srv.c
    team/group/issue8824/main/taskprocessor.c
    team/group/issue8824/main/udptl.c
    team/group/issue8824/res/res_agi.c
    team/group/issue8824/res/res_http_post.c
    team/group/issue8824/res/res_indications.c
    team/group/issue8824/res/snmp/agent.c

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jan 14 21:23:18 2009
@@ -1,1 +1,1 @@
-/trunk:1-168343
+/trunk:1-168625

Modified: team/group/issue8824/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/CHANGES?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/CHANGES (original)
+++ team/group/issue8824/CHANGES Wed Jan 14 21:23:18 2009
@@ -85,6 +85,9 @@
    option is required to interoperate with devices that have non-standard SDP
    session version implementations (observed with Microsoft OCS).  This option
    is diabled by default.
+ * The parsing of register => lines in sip.conf has been modified to allow a port
+   to be present in the "user" portion. Please see the sip.conf.sample file for more
+   information
 
 Skinny Changes
 --------------

Modified: team/group/issue8824/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/Makefile?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/Makefile (original)
+++ team/group/issue8824/Makefile Wed Jan 14 21:23:18 2009
@@ -726,6 +726,7 @@
 		echo ";rungroup = asterisk ; The group to run as" ; \
 		echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
 		echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
+		echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
 		echo "" ; \
 		echo "; Changing the following lines may compromise your security." ; \
 		echo ";[files]" ; \

Modified: team/group/issue8824/apps/app_disa.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_disa.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_disa.c (original)
+++ team/group/issue8824/apps/app_disa.c Wed Jan 14 21:23:18 2009
@@ -124,7 +124,7 @@
 
 static void play_dialtone(struct ast_channel *chan, char *mailbox)
 {
-	const struct ind_tone_zone_sound *ts = NULL;
+	const struct tone_zone_sound *ts = NULL;
 	if(ast_app_has_voicemail(mailbox, NULL))
 		ts = ast_get_indication_tone(chan->zone, "dialrecall");
 	else

Modified: team/group/issue8824/apps/app_minivm.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_minivm.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_minivm.c (original)
+++ team/group/issue8824/apps/app_minivm.c Wed Jan 14 21:23:18 2009
@@ -2261,7 +2261,7 @@
 	if(!(vmu = find_account(domain, username, TRUE))) {
 		/* We could not find user, let's exit */
 		ast_log(LOG_WARNING, "Could not allocate temporary memory for '%s@%s'\n", username, domain);
-		pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "FAILED");
+		pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "FAILED");
 		return -1;
 	}
 
@@ -2292,7 +2292,7 @@
 	if(ast_test_flag(vmu, MVM_ALLOCED))
 		free_user(vmu);
 
-	pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "SUCCESS");
+	pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "SUCCESS");
 
 	/* Ok, we're ready to rock and roll. Return to dialplan */
 	return 0;

Modified: team/group/issue8824/apps/app_page.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_page.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_page.c (original)
+++ team/group/issue8824/apps/app_page.c Wed Jan 14 21:23:18 2009
@@ -117,7 +117,6 @@
 	AST_APP_OPTION('i', PAGE_IGNORE_FORWARDS),
 });
 
-#define MAX_DIALS 128
 
 static int page_exec(struct ast_channel *chan, void *data)
 {
@@ -127,7 +126,8 @@
 	unsigned int confid = ast_random();
 	struct ast_app *app;
 	int res = 0, pos = 0, i = 0;
-	struct ast_dial *dials[MAX_DIALS];
+	struct ast_dial **dial_list;
+	unsigned int num_dials;
 	int timeout = 0;
 	char *parse;
 
@@ -166,6 +166,18 @@
 
 	snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
 		(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
+
+	/* Count number of extensions in list by number of ampersands + 1 */
+	num_dials = 1;
+	tmp = args.devices;
+	while (*tmp && *tmp++ == '&') {
+		num_dials++;
+	}
+
+	if (!(dial_list = ast_calloc(num_dials, sizeof(void *)))) {
+		ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(void *) * num_dials));
+		return -1;
+	}
 
 	/* Go through parsing/calling each device */
 	while ((tech = strsep(&args.devices, "&"))) {
@@ -222,7 +234,7 @@
 		ast_dial_run(dial, chan, 1);
 
 		/* Put in our dialing array */
-		dials[pos++] = dial;
+		dial_list[pos++] = dial;
 	}
 
 	if (!ast_test_flag(&flags, PAGE_QUIET)) {
@@ -239,7 +251,7 @@
 
 	/* Go through each dial attempt cancelling, joining, and destroying */
 	for (i = 0; i < pos; i++) {
-		struct ast_dial *dial = dials[i];
+		struct ast_dial *dial = dial_list[i];
 
 		/* We have to wait for the async thread to exit as it's possible Meetme won't throw them out immediately */
 		ast_dial_join(dial);

Modified: team/group/issue8824/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_queue.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_queue.c (original)
+++ team/group/issue8824/apps/app_queue.c Wed Jan 14 21:23:18 2009
@@ -2782,7 +2782,7 @@
 			if (numlines == (numbusies + numnochan)) {
 				ast_debug(1, "Everyone is busy at this time\n");
 			} else {
-				ast_log(LOG_NOTICE, "No one is answering queue '%s' (%d/%d/%d)\n", queue, numlines, numbusies, numnochan);
+				ast_debug(3, "No one is answering queue '%s' (%d numlines / %d busies / %d failed channels)\n", queue, numlines, numbusies, numnochan);
 			}
 			*to = 0;
 			return NULL;

Modified: team/group/issue8824/apps/app_read.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_read.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_read.c (original)
+++ team/group/issue8824/apps/app_read.c Wed Jan 14 21:23:18 2009
@@ -132,7 +132,7 @@
 	int tries = 1, to = 0, x = 0;
 	double tosec;
 	char *argcopy = NULL;
-	struct ind_tone_zone_sound *ts = NULL;
+	struct tone_zone_sound *ts = NULL;
 	struct ast_flags flags = {0};
 	const char *status = "ERROR";
 

Modified: team/group/issue8824/apps/app_readexten.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_readexten.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/apps/app_readexten.c (original)
+++ team/group/issue8824/apps/app_readexten.c Wed Jan 14 21:23:18 2009
@@ -132,7 +132,7 @@
 	int maxdigits = sizeof(exten) - 1;
 	int timeout = 0, digit_timeout = 0, x = 0;
 	char *argcopy = NULL, *status = "";
-	struct ind_tone_zone_sound *ts = NULL;
+	struct tone_zone_sound *ts = NULL;
 	struct ast_flags flags = {0};
 
 	 AST_DECLARE_APP_ARGS(arglist,

Modified: team/group/issue8824/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_agent.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/channels/chan_agent.c (original)
+++ team/group/issue8824/channels/chan_agent.c Wed Jan 14 21:23:18 2009
@@ -256,7 +256,8 @@
 	char name[AST_MAX_AGENT];
 	int inherited_devicestate;     /*!< Does the underlying channel have a devicestate to pass? */
 	ast_mutex_t app_lock;          /**< Synchronization between owning applications */
-	volatile pthread_t owning_app; /**< Owning application thread id */
+	int app_lock_flag;
+	ast_cond_t app_complete_cond;
 	volatile int app_sleep_cond;   /**< Sleep condition for the login app */
 	struct ast_channel *owner;     /**< Agent */
 	char loginchan[80];            /**< channel they logged in from */
@@ -451,7 +452,8 @@
 		ast_copy_string(p->agent, agt, sizeof(p->agent));
 		ast_mutex_init(&p->lock);
 		ast_mutex_init(&p->app_lock);
-		p->owning_app = (pthread_t) -1;
+		ast_cond_init(&p->app_complete_cond, NULL);
+		p->app_lock_flag = 0;
 		p->app_sleep_cond = 1;
 		p->group = group;
 		p->pending = pending;
@@ -509,12 +511,14 @@
 	chan->tech_pvt = NULL;
 	p->app_sleep_cond = 1;
 	/* Release ownership of the agent to other threads (presumably running the login app). */
-	ast_mutex_unlock(&p->app_lock);
+	p->app_lock_flag = 0;
+	ast_cond_signal(&p->app_complete_cond);
 	if (chan)
 		ast_channel_free(chan);
 	if (p->dead) {
 		ast_mutex_destroy(&p->lock);
 		ast_mutex_destroy(&p->app_lock);
+		ast_cond_destroy(&p->app_complete_cond);
 		ast_free(p);
         }
 	return 0;
@@ -1000,6 +1004,7 @@
 	} else if (p->dead) {
 		ast_mutex_destroy(&p->lock);
 		ast_mutex_destroy(&p->app_lock);
+		ast_cond_destroy(&p->app_complete_cond);
 		ast_free(p);
 	} else {
 		if (p->chan) {
@@ -1010,8 +1015,10 @@
 			ast_mutex_unlock(&p->lock);
 		}
 		/* Release ownership of the agent to other threads (presumably running the login app). */
-		if (ast_strlen_zero(p->loginchan))
-			ast_mutex_unlock(&p->app_lock);
+		if (ast_strlen_zero(p->loginchan)) {
+			p->app_lock_flag = 0;
+			ast_cond_signal(&p->app_complete_cond);
+		}
 	}
 	return 0;
 }
@@ -1098,6 +1105,7 @@
 static struct ast_channel *agent_new(struct agent_pvt *p, int state)
 {
 	struct ast_channel *tmp;
+	int alreadylocked;
 #if 0
 	if (!p->chan) {
 		ast_log(LOG_WARNING, "No channel? :(\n");
@@ -1143,11 +1151,15 @@
 	 * implemented in the kernel for this.
 	 */
 	p->app_sleep_cond = 0;
-	if(ast_strlen_zero(p->loginchan) && ast_mutex_trylock(&p->app_lock)) {
+
+	alreadylocked = p->app_lock_flag;
+	p->app_lock_flag = 1;
+
+	if(ast_strlen_zero(p->loginchan) && alreadylocked) {
 		if (p->chan) {
 			ast_queue_frame(p->chan, &ast_null_frame);
 			ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
-			ast_mutex_lock(&p->app_lock);
+			p->app_lock_flag = 1;
 			ast_mutex_lock(&p->lock);
 		} else {
 			ast_log(LOG_WARNING, "Agent disconnected while we were connecting the call\n");
@@ -1156,7 +1168,8 @@
 			p->app_sleep_cond = 1;
 			ast_channel_free( tmp );
 			ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
-			ast_mutex_unlock(&p->app_lock);
+			p->app_lock_flag = 0;
+			ast_cond_signal(&p->app_complete_cond);
 			return NULL;
 		}
 	} else if (!ast_strlen_zero(p->loginchan)) {
@@ -1174,14 +1187,6 @@
 	} 
 	if (p->chan)
 		ast_indicate(p->chan, AST_CONTROL_UNHOLD);
-	p->owning_app = pthread_self();
-	/* After the above step, there should not be any blockers. */
-	if (p->chan) {
-		if (ast_test_flag(p->chan, AST_FLAG_BLOCKING)) {
-			ast_log( LOG_ERROR, "A blocker exists after agent channel ownership acquired\n" );
-			ast_assert(ast_test_flag(p->chan, AST_FLAG_BLOCKING) == 0);
-		}
-	}
 	return tmp;
 }
 
@@ -1346,6 +1351,7 @@
 				if (!p->chan) {
 					ast_mutex_destroy(&p->lock);
 					ast_mutex_destroy(&p->app_lock);
+					ast_cond_destroy(&p->app_complete_cond);
 					ast_free(p);
 				} else {
 					/* Cause them to hang up */
@@ -2232,15 +2238,17 @@
 							ast_mutex_unlock(&p->lock);
 							AST_LIST_UNLOCK(&agents);
 							/*	Synchronize channel ownership between call to agent and itself. */
-							ast_mutex_lock( &p->app_lock );
+							ast_mutex_lock(&p->app_lock);
+							if (p->app_lock_flag == 1) {
+								ast_cond_wait(&p->app_complete_cond, &p->app_lock);
+							}
+							ast_mutex_unlock(&p->app_lock);
 							ast_mutex_lock(&p->lock);
-							p->owning_app = pthread_self();
 							ast_mutex_unlock(&p->lock);
 							if (p->ackcall > 1) 
 								res = agent_ack_sleep(p);
 							else
 								res = ast_safe_sleep_conditional( chan, 1000, agent_cont_sleep, p );
-							ast_mutex_unlock( &p->app_lock );
 							if ((p->ackcall > 1)  && (res == 1)) {
 								AST_LIST_LOCK(&agents);
 								ast_mutex_lock(&p->lock);
@@ -2275,6 +2283,7 @@
 						if (p->dead && !p->owner) {
 							ast_mutex_destroy(&p->lock);
 							ast_mutex_destroy(&p->app_lock);
+							ast_cond_destroy(&p->app_complete_cond);
 							ast_free(p);
 						}
 					}

Modified: team/group/issue8824/channels/chan_alsa.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_alsa.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/channels/chan_alsa.c (original)
+++ team/group/issue8824/channels/chan_alsa.c Wed Jan 14 21:23:18 2009
@@ -381,13 +381,17 @@
 		state = snd_pcm_state(alsa.ocard);
 		if (state == SND_PCM_STATE_XRUN)
 			snd_pcm_prepare(alsa.ocard);
-		res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+		while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+			usleep(1);
+		}
 		if (res == -EPIPE) {
 #if DEBUG
 			ast_debug(1, "XRUN write\n");
 #endif
 			snd_pcm_prepare(alsa.ocard);
-			res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+			while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+				usleep(1);
+			}
 			if (res != len / 2) {
 				ast_log(LOG_ERROR, "Write error: %s\n", snd_strerror(res));
 				res = -1;

Modified: team/group/issue8824/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_dahdi.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/channels/chan_dahdi.c (original)
+++ team/group/issue8824/channels/chan_dahdi.c Wed Jan 14 21:23:18 2009
@@ -728,6 +728,7 @@
 	struct ast_event_sub *mwi_event_sub;
 	char dialdest[256];
 	int onhooktime;
+	int fxsoffhookstate;
 	int msgstate;
 	int distinctivering;				/*!< Which distinctivering to use */
 	int cidrings;					/*!< Which ring to deliver CID on */
@@ -3433,6 +3434,7 @@
 					tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
 				else
 					tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
+				p->fxsoffhookstate = par.rxisoffhook;
 			}
 			break;
 		case SIG_FXSGS:
@@ -4648,6 +4650,7 @@
 			case SIG_FXOGS:
 			case SIG_FXOKS:
 				p->onhooktime = time(NULL);
+				p->fxsoffhookstate = 0;
 				p->msgstate = -1;
 				/* Check for some special conditions regarding call waiting */
 				if (idx == SUB_REAL) {
@@ -4799,6 +4802,7 @@
 			case SIG_FXOLS:
 			case SIG_FXOGS:
 			case SIG_FXOKS:
+				p->fxsoffhookstate = 1;
 				switch (ast->_state) {
 				case AST_STATE_RINGING:
 					dahdi_enable_ec(p);
@@ -7887,6 +7891,7 @@
 		case SIG_FXOGS:
 		case SIG_FXOKS:
 			res = dahdi_set_hook(i->subs[SUB_REAL].dfd, DAHDI_OFFHOOK);
+			i->fxsoffhookstate = 1;
 			if (res && (errno == EBUSY))
 				break;
 			if (i->cidspill) {
@@ -8040,6 +8045,9 @@
 			res = tone_zone_play_tone(i->subs[SUB_REAL].dfd, -1);
 			return -1;
 		}
+		if (i->sig == SIG_FXOLS || i->sig == SIG_FXOGS || i->sig == SIG_FXOKS) {
+			i->fxsoffhookstate = 0;
+		}
 		break;
 	case DAHDI_EVENT_POLARITY:
 		switch (i->sig) {
@@ -8182,7 +8190,10 @@
 				if (!found && ((i == last) || ((i == iflist) && !last))) {
 					last = i;
 					if (last) {
-						if (!last->mwisendactive &&	 last->sig & __DAHDI_SIG_FXO) {
+						/* Only allow MWI to be initiated on a quiescent fxs port */
+						if (!last->mwisendactive &&	last->sig & __DAHDI_SIG_FXO &&
+								!last->fxsoffhookstate && !last->owner &&
+								!ast_strlen_zero(last->mailbox) && (thispass - last->onhooktime > 3)) {
 							res = has_voicemail(last);
 							if (last->msgstate != res) {
 								/* Set driver resources for signalling VMWI */
@@ -8948,6 +8959,14 @@
 				AST_EVENT_IE_END);
 		}
 		tmp->msgstate = -1;
+		if ((chan_sig == SIG_FXOKS) || (chan_sig == SIG_FXOLS) || (chan_sig == SIG_FXOGS)) {
+			memset(&p, 0, sizeof(p));
+			res = ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &p);
+			if (!res) {
+				tmp->fxsoffhookstate = p.rxisoffhook;
+			}
+		}
+		tmp->onhooktime = time(NULL);
 		tmp->group = conf->chan.group;
 		tmp->callgroup = conf->chan.callgroup;
 		tmp->pickupgroup= conf->chan.pickupgroup;
@@ -8958,7 +8977,6 @@
 		tmp->rxgain = conf->chan.rxgain;
 		tmp->txgain = conf->chan.txgain;
 		tmp->tonezone = conf->chan.tonezone;
-		tmp->onhooktime = time(NULL);
 		if (tmp->subs[SUB_REAL].dfd > -1) {
 			set_actual_gain(tmp->subs[SUB_REAL].dfd, 0, tmp->rxgain, tmp->txgain, tmp->law);
 			if (tmp->dsp)

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=168635&r1=168634&r2=168635
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Wed Jan 14 21:23:18 2009
@@ -115,27 +115,27 @@
 ast_mutex_t release_lock;
 
 enum misdn_chan_state {
-	MISDN_NOTHING=0,	/*!< at beginning */
-	MISDN_WAITING4DIGS, /*!< when waiting for infos */
-	MISDN_EXTCANTMATCH, /*!< when asterisk couldn't match our ext */
-	MISDN_INCOMING_SETUP, /*!< for incoming setups */
-	MISDN_DIALING, /*!< when pbx_start */
-	MISDN_PROGRESS, /*!< we got a progress */
-	MISDN_PROCEEDING, /*!< we got a progress */
-	MISDN_CALLING, /*!< when misdn_call is called */
+	MISDN_NOTHING = 0,         /*!< at beginning */
+	MISDN_WAITING4DIGS,        /*!< when waiting for info */
+	MISDN_EXTCANTMATCH,        /*!< when asterisk couldn't match our ext */
+	MISDN_INCOMING_SETUP,      /*!< for incoming setup */
+	MISDN_DIALING,             /*!< when pbx_start */
+	MISDN_PROGRESS,            /*!< we have progress */
+	MISDN_PROCEEDING,          /*!< we have progress */
+	MISDN_CALLING,             /*!< when misdn_call is called */
 	MISDN_CALLING_ACKNOWLEDGE, /*!< when we get SETUP_ACK */
-	MISDN_ALERTING, /*!< when Alerting */
-	MISDN_BUSY, /*!< when BUSY */
-	MISDN_CONNECTED, /*!< when connected */
-	MISDN_PRECONNECTED, /*!< when connected */
-	MISDN_DISCONNECTED, /*!< when connected */
-	MISDN_RELEASED, /*!< when connected */
-	MISDN_BRIDGED, /*!< when bridged */
-	MISDN_CLEANING, /*!< when hangup from * but we were connected before */
-	MISDN_HUNGUP_FROM_MISDN, /*!< when DISCONNECT/RELEASE/REL_COMP came from misdn */
-	MISDN_HUNGUP_FROM_AST, /*!< when DISCONNECT/RELEASE/REL_COMP came out of misdn_hangup */
-	MISDN_HOLDED, /*!< if this chan is holded */
-	MISDN_HOLD_DISCONNECT, /*!< if this chan is holded */
+	MISDN_ALERTING,            /*!< when Alerting */
+	MISDN_BUSY,                /*!< when BUSY */
+	MISDN_CONNECTED,           /*!< when connected */
+	MISDN_PRECONNECTED,        /*!< when connected */
+	MISDN_DISCONNECTED,        /*!< when connected */
+	MISDN_RELEASED,            /*!< when connected */
+	MISDN_BRIDGED,             /*!< when bridged */
+	MISDN_CLEANING,            /*!< when hangup from * but we were connected before */
+	MISDN_HUNGUP_FROM_MISDN,   /*!< when DISCONNECT/RELEASE/REL_COMP came from misdn */
+	MISDN_HUNGUP_FROM_AST,     /*!< when DISCONNECT/RELEASE/REL_COMP came out of misdn_hangup */
+	MISDN_HOLDED,              /*!< when on hold */
+	MISDN_HOLD_DISCONNECT,     /*!< when on hold */
 };
 
 #define ORG_AST 1
@@ -196,7 +196,7 @@
 	 */
 	int noautorespond_on_setup;
 	
-	int norxtone;	/* Boolean assigned values but the value is not used. */
+	int norxtone;	/*!< Boolean assigned values but the value is not used. */
 
 	/*!
 	 * \brief TRUE if we are not to generate tones (Playtones)
@@ -341,8 +341,6 @@
 	 */
 	char mohinterpret[MAX_MUSICCLASS];
 
-	//int zero_read_cnt;	/* Not used */
-
 	/*!
 	 * \brief Number of outgoing audio frames dropped since last debug gripe message.
 	 */
@@ -377,7 +375,7 @@
 	 * \brief Tone zone sound used for dialtone generation.
 	 * \note Used as a boolean.  Non-NULL to prod generation if enabled. 
 	 */
-	const struct ind_tone_zone_sound *ts;
+	const struct tone_zone_sound *ts;
 	
 	/*!
 	 * \brief Enables overlap dialing for the set amount of seconds.  (0 = Disabled)
@@ -399,20 +397,20 @@
 	 * \brief Overlap timer start time.  Timer restarted for every digit received.
 	 */
 	struct timeval overlap_tv;
-  
-	//struct chan_list *peer;	/* Not used */
 
 	/*!
 	 * \brief Next channel call record in the list.
 	 */
 	struct chan_list *next;
-	//struct chan_list *prev;		/* Not used */
-	//struct chan_list *first;	/* Not used */
 };
+
+
+int MAXTICS = 8;
 
 
 void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch);
 void import_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch);
+static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame *frame);
 
 struct robin_list {
 	char *group;
@@ -424,12 +422,7 @@
 static struct robin_list *robin = NULL;
 
 
-
-static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame *frame);
-
-
-
-static inline void free_robin_list_r (struct robin_list *r)
+static inline void free_robin_list_r(struct robin_list *r)
 {
 	if (r) {
 		if (r->next)
@@ -440,22 +433,23 @@
 	}
 }
 
-static void free_robin_list ( void )
+static void free_robin_list(void)
 {
 	free_robin_list_r(robin);
 	robin = NULL;
 }
 
-static struct robin_list* get_robin_position (char *group) 
+static struct robin_list* get_robin_position(char *group) 
 {
 	struct robin_list *new;
 	struct robin_list *iter = robin;
 	for (; iter; iter = iter->next) {
-		if (!strcasecmp(iter->group, group))
+		if (!strcasecmp(iter->group, group)) {
 			return iter;
+		}
 	}
 	new = ast_calloc(1, sizeof(*new));
-	new->group = strndup(group, strlen(group));
+	new->group = strdup(group);
 	new->channel = 1;
 	if (robin) {
 		new->next = robin;
@@ -490,7 +484,7 @@
 
 static const char misdn_type[] = "mISDN";
 
-static int tracing = 0 ;
+static int tracing = 0;
 
 /*! \brief Only alaw and mulaw is allowed for now */
 static int prefformat =  AST_FORMAT_ALAW ; /*  AST_FORMAT_SLINEAR ;  AST_FORMAT_ULAW | */
@@ -501,7 +495,6 @@
 
 static int *misdn_in_calls;
 static int *misdn_out_calls;
-
 
 struct chan_list dummy_cl;
 
@@ -521,8 +514,6 @@
 static struct chan_list *find_chan_by_bc(struct chan_list *list, struct misdn_bchannel *bc);
 static struct chan_list *find_chan_by_pid(struct chan_list *list, int pid);
 
-
-
 static int dialtone_indicate(struct chan_list *cl);
 static int hanguptone_indicate(struct chan_list *cl);
 static int stop_indicate(struct chan_list *cl);
@@ -537,9 +528,7 @@
 
 int chan_misdn_jb_empty(struct misdn_bchannel *bc, char *buf, int len);
 
-
 void debug_numtype(int port, int numtype, char *type);
-
 
 int add_out_calls(int port);
 int add_in_calls(int port);
@@ -559,8 +548,10 @@
 {
 	struct chan_list *tmp;
   
-	for (tmp=cl_te; tmp; tmp = tmp->next) {
-		if ( tmp->ast == ast ) return tmp;
+	for (tmp = cl_te; tmp; tmp = tmp->next) {
+		if (tmp->ast == ast) {
+			return tmp;
+		}
 	}
   
 	return NULL;
@@ -570,8 +561,10 @@
 {
 	struct chan_list *tmp;
   
-	for (tmp=cl_te; tmp; tmp = tmp->next) {
-		if ( tmp->ast  && strcmp(tmp->ast->name,name) == 0) return tmp;
+	for (tmp = cl_te; tmp; tmp = tmp->next) {
+		if (tmp->ast && strcmp(tmp->ast->name, name) == 0) {
+			return tmp;
+		}
 	}
   
 	return NULL;
@@ -1164,14 +1157,14 @@
 
 
 struct allowed_bearers {
-	char *name;			/*!< Bearer capability name string used in /etc/misdn.conf allowed_bearers */
-	char *display;		/*!< Bearer capability displayable name */
-	int cap;			/*!< SETUP message bearer capability field code value */
-	int deprecated;		/*!< TRUE if this entry is deprecated. (Misspelled or bad name to use) */
+	char *name;         /*!< Bearer capability name string used in /etc/misdn.conf allowed_bearers */
+	char *display;      /*!< Bearer capability displayable name */
+	int cap;            /*!< SETUP message bearer capability field code value */
+	int deprecated;     /*!< TRUE if this entry is deprecated. (Misspelled or bad name to use) */
 };
 
 /* *INDENT-OFF* */
-static const struct allowed_bearers allowed_bearers_array[]= {
+static const struct allowed_bearers allowed_bearers_array[] = {
 	/* Name,                      Displayable Name       Bearer Capability,                    Deprecated */
 	{ "speech",                  "Speech",               INFO_CAPABILITY_SPEECH,               0 },
 	{ "3_1khz",                  "3.1KHz Audio",         INFO_CAPABILITY_AUDIO_3_1K,           0 },
@@ -1201,56 +1194,57 @@
 	switch (fac->Function) {
 #ifdef HAVE_MISDN_FAC_RESULT
 	case Fac_RESULT:
-		chan_misdn_log(0, bc->port," --> Received RESULT Operation\n");
+		chan_misdn_log(0, bc->port, " --> Received RESULT Operation\n");
 		break;
 #endif
 #ifdef HAVE_MISDN_FAC_ERROR
 	case Fac_ERROR:

[... 4440 lines stripped ...]



More information about the asterisk-commits mailing list