[asterisk-commits] murf: branch murf/bug11210 r114177 - in /team/murf/bug11210: ./ apps/ cdr/ ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 16 14:04:14 CDT 2008


Author: murf
Date: Wed Apr 16 14:04:14 2008
New Revision: 114177

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114177
Log:
Merged revisions 114073,114077,114080,114084-114085,114088,114090,114092-114093,114096,114098,114101,114104,114107,114109,114113,114115,114118,114121,114124,114127,114131,114134,114139,114141,114143,114146,114149-114152,114165,114168,114172,114174-114175 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r114073 | qwell | 2008-04-11 15:39:44 -0600 (Fri, 11 Apr 2008) | 13 lines

Blocked revisions 114072 via svnmerge

Already fixed here.

........
r114072 | qwell | 2008-04-11 16:35:16 -0500 (Fri, 11 Apr 2008) | 4 lines

It's possible that a channel can have an async goto on the successful execution of an application as well.

Closes issue #12172.

........

................
r114077 | dbailey | 2008-04-11 16:09:04 -0600 (Fri, 11 Apr 2008) | 2 lines

Change the number of line keys per registration from 2 to 1 

................
r114080 | twilson | 2008-04-11 16:23:34 -0600 (Fri, 11 Apr 2008) | 2 lines

Make sure that ${LINE} is set even if linenumber is not set in users.conf

................
r114084 | twilson | 2008-04-11 16:48:52 -0600 (Fri, 11 Apr 2008) | 15 lines

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

........
r114083 | twilson | 2008-04-11 17:32:51 -0500 (Fri, 11 Apr 2008) | 7 lines

Several places in the code called find_callno() (which releases the lock on the pvt structure) and then immediately locked the call and did things with it. Unfortunately, the call can disappear between the find_callno and the lock, causing Bad Stuff(tm) to happen.

Added find_callno_locked() function to return the callno withtout unlocking for instances that it is needed.

(issue #12400)
Reported by: ztel

........

................
r114085 | tilghman | 2008-04-11 17:12:16 -0600 (Fri, 11 Apr 2008) | 7 lines

Use the correct function for free'ing objects, and maybe we won't crash.
(closes issue #12163)
 Reported by: gservat
 Patches: 
       20080411__bug12163.diff.txt uploaded by Corydon76 (license 14)
 Tested by: gservat

................
r114088 | tilghman | 2008-04-11 17:21:54 -0600 (Fri, 11 Apr 2008) | 3 lines

Make the sample config match the contributed LDAP schema
(Closes issue #12421)

................
r114090 | tilghman | 2008-04-11 17:26:56 -0600 (Fri, 11 Apr 2008) | 3 lines

If any field is not null, but has no default, then it must be set or the insert will fail.
(Closes issue #12285)

................
r114092 | mattf | 2008-04-12 10:13:25 -0600 (Sat, 12 Apr 2008) | 1 line

Make sure we start incoming calls on SS7 with echo cancellation enabled.  Also make sure when completing a COT we call ss7_start_call with the proper locks held.  Lastly, make sure if we fail to get a channel from zt_new that we don't assume it's there.
................
r114093 | mattf | 2008-04-12 10:21:29 -0600 (Sat, 12 Apr 2008) | 1 line

Make sure linkset is locked exiting ss7_start_call
................
r114096 | tilghman | 2008-04-13 08:35:43 -0600 (Sun, 13 Apr 2008) | 3 lines

Use ast_mkdir instead of mkdir
(Closes issue #12430)

................
r114098 | tilghman | 2008-04-13 20:55:41 -0600 (Sun, 13 Apr 2008) | 3 lines

Add tab command-line completion
(Closes issue #12428)

................
r114101 | file | 2008-04-14 07:53:33 -0600 (Mon, 14 Apr 2008) | 12 lines

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

........
r114100 | file | 2008-04-14 10:52:49 -0300 (Mon, 14 Apr 2008) | 4 lines

Don't change the SSRC when a new source comes into play, this might happen quite often and depending on the remote side... they might not like this.
(closes issue #12353)
Reported by: dimas

........

................
r114104 | file | 2008-04-14 08:53:33 -0600 (Mon, 14 Apr 2008) | 12 lines

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

........
r114103 | file | 2008-04-14 11:52:46 -0300 (Mon, 14 Apr 2008) | 4 lines

It is possible for the remote side to say they want T38 but not give any capabilities.
(closes issue #12414)
Reported by: MVF

........

................
r114107 | mmichelson | 2008-04-14 09:01:36 -0600 (Mon, 14 Apr 2008) | 13 lines

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

........
r114106 | mmichelson | 2008-04-14 09:58:02 -0500 (Mon, 14 Apr 2008) | 5 lines

Save a local copy of the generate callback prior to unlocking the channel in
case the generate callback goes NULL on us after the channel is unlocked. Thanks
to Russell for pointing this need out to me.


........

................
r114109 | file | 2008-04-14 09:36:02 -0600 (Mon, 14 Apr 2008) | 2 lines

During hangup it is possible for p->chan or p->owner to be NULL, so just return what the channel is bridged to instead of what they are *really* bridged to. Thanks Matt Nicholson!

................
r114113 | mmichelson | 2008-04-14 10:25:09 -0600 (Mon, 14 Apr 2008) | 17 lines

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

........
r114112 | mmichelson | 2008-04-14 11:24:22 -0500 (Mon, 14 Apr 2008) | 9 lines

If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).

(closes issue #12359)
Reported by: pguido


........

................
r114115 | tilghman | 2008-04-14 10:32:59 -0600 (Mon, 14 Apr 2008) | 2 lines

Make tab-completion work for all cases

................
r114118 | mmichelson | 2008-04-14 11:42:20 -0600 (Mon, 14 Apr 2008) | 19 lines

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

........
r114117 | mmichelson | 2008-04-14 12:41:03 -0500 (Mon, 14 Apr 2008) | 11 lines

Increase the retry count when attempting to show channels. This apparently
cleared an issue someone was seeing when attempting to show channels when
the load was high.

(closes issue #11667)
Reported by: falves11
Patches:
      11677.txt uploaded by russell (license 2)
Tested by: falves11


........

................
r114121 | qwell | 2008-04-14 12:34:17 -0600 (Mon, 14 Apr 2008) | 15 lines

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

........
r114120 | qwell | 2008-04-14 13:31:57 -0500 (Mon, 14 Apr 2008) | 7 lines

The call_token on the pvt can occasionally be NULL, causing a crash.

If it is NULL, we can skip this channel, since it can't the one we're looking for.

(closes issue #9299)
Reported by: vazir

........

................
r114124 | twilson | 2008-04-14 13:12:27 -0600 (Mon, 14 Apr 2008) | 2 lines

Don't unref user twice on failure.  Also, when adding sorted list of users, it is best to check the entry already in the list for a "next" entry instead of the newly created entry...

................
r114127 | twilson | 2008-04-14 13:58:52 -0600 (Mon, 14 Apr 2008) | 2 lines

Need a new buffer for each loop

................
r114131 | qwell | 2008-04-15 09:20:47 -0600 (Tue, 15 Apr 2008) | 7 lines

Convert several DEBUG logs into ast_debug.

(closes issue #12444)
Reported by: IgorG
Patches:
      channel_c_debug.diff uploaded by IgorG (license 20)

................
r114134 | qwell | 2008-04-15 10:18:38 -0600 (Tue, 15 Apr 2008) | 16 lines

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

........
r114133 | qwell | 2008-04-15 11:18:08 -0500 (Tue, 15 Apr 2008) | 8 lines

Allow autofill to work in the general section of queues.conf.
Additionally, don't try to (re)set options when they have empty values in realtime (all unset columns would have an empty value).

(closes issue #12445)
Reported by: atis
Patches:
      12445-autofill.diff uploaded by qwell (license 4)

........

................
r114139 | qwell | 2008-04-15 11:17:37 -0600 (Tue, 15 Apr 2008) | 15 lines

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

........
r114138 | qwell | 2008-04-15 12:17:18 -0500 (Tue, 15 Apr 2008) | 7 lines

Update Digium autosupport script, for more useful information.

(closes issue #12452)
Reported by: angler
Patches:
      autosupport.diff uploaded by angler (license 106)

........

................
r114141 | qwell | 2008-04-15 11:21:58 -0600 (Tue, 15 Apr 2008) | 8 lines

Shorten the mac address pattern, since some phones use different identifiers (such as the i2050 softphone).

(closes issue #12398)
Reported by: c_hans
Patches:
      chan_unistim_svn.diff uploaded by c (license 460)
Tested by: c_hans

................
r114143 | seanbright | 2008-04-15 11:54:38 -0600 (Tue, 15 Apr 2008) | 2 lines

I'm not sure why, but "this" bothers me.  Ba dum dum.

................
r114146 | murf | 2008-04-15 13:59:50 -0600 (Tue, 15 Apr 2008) | 8 lines

These changes: 

   a. fix a self-found problem with SPAWN-ing an extension,
      where matches were not being found
   b. correct some wording in a comment
   c. Add some debug for future debugging.


................
r114149 | qwell | 2008-04-15 14:27:04 -0600 (Tue, 15 Apr 2008) | 2 lines

If somebody enters a digit during ast_stream_and_wait, the return value is the digit, which we need to use later.

................
r114150 | oej | 2008-04-15 14:31:08 -0600 (Tue, 15 Apr 2008) | 2 lines

Adding chanvar to SIPPEER from 1.4 branch

................
r114151 | oej | 2008-04-15 14:39:29 -0600 (Tue, 15 Apr 2008) | 10 lines

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

........
r114148 | oej | 2008-04-15 22:26:05 +0200 (Tis, 15 Apr 2008) | 2 lines

Handle subscribe queues in all situations... Thanks to festr_ on irc for telling me about this bug.

........

................
r114152 | tilghman | 2008-04-15 14:51:08 -0600 (Tue, 15 Apr 2008) | 2 lines

Oops, buffer wasn't long enough for query

................
r114165 | seanbright | 2008-04-16 06:23:13 -0600 (Wed, 16 Apr 2008) | 1 line

Add the ability to disable channel technology name playback when speaking the current channel name
................
r114168 | file | 2008-04-16 08:11:18 -0600 (Wed, 16 Apr 2008) | 13 lines

Blocked revisions 114167 via svnmerge

........
r114167 | file | 2008-04-16 11:10:46 -0300 (Wed, 16 Apr 2008) | 6 lines

Include the proper headers for using mkdir on FreeBSD.
(closes issue #12430)
Reported by: ys
Patches:
      app_meetme.c.diff uploaded by ys (license 281)

........

................
r114172 | murf | 2008-04-16 11:14:18 -0600 (Wed, 16 Apr 2008) | 1 line

Introducing doubly linked lists to trunk from branch team/murf/bug11210.
................
r114174 | qwell | 2008-04-16 11:31:02 -0600 (Wed, 16 Apr 2008) | 14 lines

Blocked revisions 114173 via svnmerge

........
r114173 | qwell | 2008-04-16 12:30:09 -0500 (Wed, 16 Apr 2008) | 7 lines

Fix "fallthrough" behavior here, so config options in a previously configured user don't override settings in general.

(closes issue #12458)
Reported by: tzafrir
Patches:
      chanzap_users_sections.diff uploaded by tzafrir (license 46)

........

................
r114175 | murf | 2008-04-16 11:45:28 -0600 (Wed, 16 Apr 2008) | 1 line

Introducing various astobj2 enhancements, chief being a refcount tracing feature, and various documentation updates in astobj2.h, and the addition of standalone utility, refcounter, that will filter the trace output for unbalanced, unfreed objects. This comes from the team/murf/bug11210 branch.
................

Modified:
    team/murf/bug11210/   (props changed)
    team/murf/bug11210/CHANGES
    team/murf/bug11210/apps/app_chanspy.c
    team/murf/bug11210/apps/app_dial.c
    team/murf/bug11210/apps/app_directory.c
    team/murf/bug11210/apps/app_meetme.c
    team/murf/bug11210/apps/app_queue.c
    team/murf/bug11210/cdr/cdr_pgsql.c
    team/murf/bug11210/channels/chan_h323.c
    team/murf/bug11210/channels/chan_iax2.c
    team/murf/bug11210/channels/chan_local.c
    team/murf/bug11210/channels/chan_sip.c
    team/murf/bug11210/channels/chan_unistim.c
    team/murf/bug11210/channels/chan_zap.c
    team/murf/bug11210/configs/res_ldap.conf.sample
    team/murf/bug11210/contrib/scripts/astcli
    team/murf/bug11210/contrib/scripts/autosupport
    team/murf/bug11210/main/channel.c
    team/murf/bug11210/main/pbx.c
    team/murf/bug11210/main/rtp.c
    team/murf/bug11210/phoneprov/polycom_line.xml
    team/murf/bug11210/res/res_config_ldap.c
    team/murf/bug11210/res/res_phoneprov.c

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

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

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr 16 14:04:14 2008
@@ -1,1 +1,1 @@
-/trunk:1-114069
+/trunk:1-114175

Modified: team/murf/bug11210/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/CHANGES?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/CHANGES (original)
+++ team/murf/bug11210/CHANGES Wed Apr 16 14:04:14 2008
@@ -618,15 +618,18 @@
   * A new option when starting a remote asterisk (rasterisk, asterisk -r) for
      specifying which socket to use to connect to the running Asterisk daemon
      (-s)
-  * Added Doubly-linked lists after the fashion of linkedlists.h. They are in
-    dlinkedlists.h. Doubly-linked lists feature fast deletion times.
-    Added regression tests to the tests/ dir, also.
   * Performance enhancements to the sched facility, which is used in
     the channel drivers, etc. Added hashtabs and doubly-linked lists
     to speed up deletion; start at the beginning or end of list to 
     speed up insertion.
+  * Added Doubly-linked lists after the fashion of linkedlists.h. They are in
+    dlinkedlists.h. Doubly-linked lists feature fast deletion times.
+    Added regression tests to the tests/ dir, also.
   * Added a refcount trace feature to astobj2 for those trying to balance
-    object creation, deletion, work, play, space and time.
+    object creation, deletion; work, play; space and time. See the
+    notes in astobj2.h. Also, see utils/refcounter as well, as a
+    quick way to find unbalanced refcounts in what could be a sea
+    of objects that were balanced.
   * Added logging to 'make update' command.  See update.log
   * Added strictrtp option to rtp.conf. If enabled this will drop RTP packets that
      do not come from the remote party.

Modified: team/murf/bug11210/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_chanspy.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/apps/app_chanspy.c (original)
+++ team/murf/bug11210/apps/app_chanspy.c Wed Apr 16 14:04:14 2008
@@ -77,6 +77,8 @@
 "    r[(basename)] - Record the session to the monitor spool directory. An\n"
 "                    optional base for the filename may be specified. The\n"
 "                    default is 'chanspy'.\n"
+"    s             - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n"
+"                    speaking the selected channel name.\n"
 "    v([value])    - Adjust the initial volume in the range from -4 to 4. A\n"
 "                    negative value refers to a quieter setting.\n"
 "    w             - Enable 'whisper' mode, so the spying channel can talk to\n"
@@ -117,6 +119,8 @@
 "    r[(basename)] - Record the session to the monitor spool directory. An\n"
 "                    optional base for the filename may be specified. The\n"
 "                    default is 'chanspy'.\n"
+"    s             - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n"
+"                    speaking the selected channel name.\n"
 "    v([value])    - Adjust the initial volume in the range from -4 to 4. A\n"
 "                    negative value refers to a quieter setting.\n"
 "    w             - Enable 'whisper' mode, so the spying channel can talk to\n"
@@ -143,6 +147,7 @@
 	OPTION_READONLY  = (1 << 7),    /* Don't mix the two channels */
 	OPTION_EXIT      = (1 << 8),    /* Exit to a valid single digit extension */
 	OPTION_ENFORCED  = (1 << 9),    /* Enforced mode */
+	OPTION_NOTECH    = (1 << 10),   /* Skip technology name playback */
 } chanspy_opt_flags;
 
 enum {
@@ -164,6 +169,7 @@
 	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
 	AST_APP_OPTION('o', OPTION_READONLY),
 	AST_APP_OPTION('X', OPTION_EXIT),
+	AST_APP_OPTION('s', OPTION_NOTECH),
 });
 
 
@@ -496,30 +502,29 @@
 	const struct ast_channel *last, const char *spec,
 	const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
 {
-	struct ast_channel *this;
+	struct ast_channel *next;
 
 redo:
 	if (!ast_strlen_zero(spec))
-		this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
-
+		next = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
 	else if (!ast_strlen_zero(exten))
-		this = ast_walk_channel_by_exten_locked(last, exten, context);
+		next = ast_walk_channel_by_exten_locked(last, exten, context);
 	else
-		this = ast_channel_walk_locked(last);
-
-	if (!this)
+		next = ast_channel_walk_locked(last);
+
+	if (!next)
 		return NULL;
 
-	if (!strncmp(this->name, "Zap/pseudo", 10)) {
-		ast_channel_unlock(this);
+	if (!strncmp(next->name, "Zap/pseudo", 10)) {
+		ast_channel_unlock(next);
 		goto redo;
-	} else if (this == chan) {
-		last = this;
-		ast_channel_unlock(this);
+	} else if (next == chan) {
+		last = next;
+		ast_channel_unlock(next);
 		goto redo;
 	}
 
-	return setup_chanspy_ds(this, chanspy_ds);
+	return setup_chanspy_ds(next, chanspy_ds);
 }
 
 static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
@@ -709,16 +714,20 @@
 			peer = NULL;
 
 			if (!ast_test_flag(flags, OPTION_QUIET)) {
-				if (ast_fileexists(peer_name, NULL, NULL) != -1) {
-					res = ast_streamfile(chan, peer_name, chan->language);
-					if (!res)
-						res = ast_waitstream(chan, "");
-					if (res) {
-						chanspy_ds_free(peer_chanspy_ds);
-						break;
+				if (!ast_test_flag(flags, OPTION_NOTECH)) {
+					if (ast_fileexists(peer_name, NULL, NULL) != -1) {
+						res = ast_streamfile(chan, peer_name, chan->language);
+						if (!res) {
+							res = ast_waitstream(chan, "");
+						}
+						if (res) {
+							chanspy_ds_free(peer_chanspy_ds);
+							break;
+						}
+					} else {
+						res = ast_say_character_str(chan, peer_name, "", chan->language);
 					}
-				} else
-					res = ast_say_character_str(chan, peer_name, "", chan->language);
+				}
 				if ((num = atoi(ptr)))
 					ast_say_digits(chan, atoi(ptr), "", chan->language);
 			}

Modified: team/murf/bug11210/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_dial.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/apps/app_dial.c (original)
+++ team/murf/bug11210/apps/app_dial.c Wed Apr 16 14:04:14 2008
@@ -1600,8 +1600,14 @@
 	time(&start_time);
 	peer = wait_for_answer(chan, outgoing, &to, peerflags, &pa, &num, &result);
 
-	ast_channel_datastore_remove(chan, datastore);
-	ast_channel_datastore_free(datastore);
+	/* The ast_channel_datastore_remove() function could fail here if the
+	 * datastore was moved to another channel during a masquerade. If this is
+	 * the case, don't free the datastore here because later, when the channel
+	 * to which the datastore was moved hangs up, it will attempt to free this
+	 * datastore again, causing a crash
+	 */
+	if (!ast_channel_datastore_remove(chan, datastore))
+		ast_channel_datastore_free(datastore);
 	if (!peer) {
 		if (result) {
 			res = result;

Modified: team/murf/bug11210/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_directory.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/apps/app_directory.c (original)
+++ team/murf/bug11210/apps/app_directory.c Wed Apr 16 14:04:14 2008
@@ -858,14 +858,23 @@
 		if (!ast_strlen_zero(dirintro) && !res) {
 			res = ast_stream_and_wait(chan, dirintro, AST_DIGIT_ANY);
 		} else if (!res) {
-			res = ast_stream_and_wait(chan, "dir-welcome", AST_DIGIT_ANY) ||
-				ast_stream_and_wait(chan, "dir-pls-enter", AST_DIGIT_ANY) ||
-				ast_stream_and_wait(chan, digits, AST_DIGIT_ANY) ||
-				ast_stream_and_wait(chan, 
+			/* Stop playing sounds as soon as we have a digit. */
+			res = ast_stream_and_wait(chan, "dir-welcome", AST_DIGIT_ANY);
+			if (!res) {
+				res = ast_stream_and_wait(chan, "dir-pls-enter", AST_DIGIT_ANY);
+			}
+			if (!res) {
+				res = ast_stream_and_wait(chan, digits, AST_DIGIT_ANY);
+			}
+			if (!res) {
+				res = ast_stream_and_wait(chan, 
 					which == FIRST ? "dir-first" :
 					which == LAST ? "dir-last" :
-					"dir-firstlast", AST_DIGIT_ANY) ||
+					"dir-firstlast", AST_DIGIT_ANY);
+			}
+			if (!res) {
 				ast_stream_and_wait(chan, "dir-usingkeypad", AST_DIGIT_ANY);
+			}
 		}
 		ast_stopstream(chan);
 		if (!res)

Modified: team/murf/bug11210/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_meetme.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/apps/app_meetme.c (original)
+++ team/murf/bug11210/apps/app_meetme.c Wed Apr 16 14:04:14 2008
@@ -1698,7 +1698,7 @@
 
 		snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR);
 
-		if (mkdir(destdir, 0777) && errno != EEXIST) {
+		if (ast_mkdir(destdir, 0777) != 0) {
 			ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", destdir, strerror(errno));
 			goto outrun;
 		}

Modified: team/murf/bug11210/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_queue.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/apps/app_queue.c (original)
+++ team/murf/bug11210/apps/app_queue.c Wed Apr 16 14:04:14 2008
@@ -939,7 +939,6 @@
 	q->monfmt[0] = '\0';
 	q->reportholdtime = 0;
 	q->wrapuptime = 0;
-	q->autofill = 0;
 	q->joinempty = 0;
 	q->leavewhenempty = 0;
 	q->memberdelay = 0;
@@ -1532,7 +1531,11 @@
 				*tmp++ = '-';
 		} else
 			tmp_name = v->name;
-		queue_set_param(q, tmp_name, v->value, -1, 0);
+
+		if (!ast_strlen_zero(v->value)) {
+			/* Don't want to try to set the option if the value is empty */
+			queue_set_param(q, tmp_name, v->value, -1, 0);
+		}
 	}
 
 	/* Temporarily set realtime members dead so we can detect deleted ones. 
@@ -3252,8 +3255,13 @@
 	if (use_weight)
 		ao2_unlock(queues);
 	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
-	if (datastore) {
-		ast_channel_datastore_remove(qe->chan, datastore);
+	/* The ast_channel_datastore_remove() function could fail here if the
+	 * datastore was moved to another channel during a masquerade. If this is
+	 * the case, don't free the datastore here because later, when the channel
+	 * to which the datastore was moved hangs up, it will attempt to free this
+	 * datastore again, causing a crash
+	 */
+	if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
 		ast_channel_datastore_free(datastore);
 	}
 	ao2_lock(qe->parent);

Modified: team/murf/bug11210/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/cdr/cdr_pgsql.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/cdr/cdr_pgsql.c (original)
+++ team/murf/bug11210/cdr/cdr_pgsql.c Wed Apr 16 14:04:14 2008
@@ -66,6 +66,8 @@
 	char *name;
 	char *type;
 	int len;
+	unsigned int notnull:1;
+	unsigned int hasdefault:1;
 	AST_RWLIST_ENTRY(columns) list;
 };
 
@@ -138,8 +140,17 @@
 		AST_RWLIST_TRAVERSE(&psql_columns, cur, list) {
 			/* For fields not set, simply skip them */
 			ast_cdr_getvar(cdr, cur->name, &value, buf, sizeof(buf), 0, 0);
-			if (!value)
+			if (!value) {
+				if (cur->notnull && !cur->hasdefault) {
+					/* Field is NOT NULL (but no default), must include it anyway */
+					LENGTHEN_BUF1(strlen(cur->name));
+					lensql += snprintf(sql + lensql, sizesql - lensql, "%s,", cur->name);
+					LENGTHEN_BUF2(3);
+					strcat(sql2, "'',");
+					lensql2 += 3;
+				}
 				continue;
+			}
 			
 			LENGTHEN_BUF1(strlen(cur->name));
 			lensql += snprintf(sql + lensql, sizesql - lensql, "%s,", cur->name);
@@ -444,14 +455,14 @@
 
 	conn = PQsetdbLogin(pghostname, pgdbport, NULL, NULL, pgdbname, pgdbuser, pgpassword);
 	if (PQstatus(conn) != CONNECTION_BAD) {
-		char sqlcmd[256];
-		char *fname, *ftype, *flen;
+		char sqlcmd[512];
+		char *fname, *ftype, *flen, *fnotnull, *fdef;
 		int i, rows;
 		ast_debug(1, "Successfully connected to PostgreSQL database.\n");
 		connected = 1;
 
 		/* Query the columns */
-		snprintf(sqlcmd, sizeof(sqlcmd), "select a.attname, t.typname, a.attlen from pg_class c, pg_attribute a, pg_type t where c.oid = a.attrelid and a.atttypid = t.oid and (a.attnum > 0) and c.relname = '%s' order by c.relname, attnum", table);
+		snprintf(sqlcmd, sizeof(sqlcmd), "select a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc from pg_class c, pg_type t, pg_attribute a left outer join pg_attrdef d on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum where c.oid = a.attrelid and a.atttypid = t.oid and (a.attnum > 0) and c.relname = '%s' order by c.relname, attnum", table);
 		result = PQexec(conn, sqlcmd);
 		if (PQresultStatus(result) != PGRES_TUPLES_OK) {
 			pgerror = PQresultErrorMessage(result);
@@ -466,6 +477,8 @@
 			fname = PQgetvalue(result, i, 0);
 			ftype = PQgetvalue(result, i, 1);
 			flen = PQgetvalue(result, i, 2);
+			fnotnull = PQgetvalue(result, i, 3);
+			fdef = PQgetvalue(result, i, 4);
 			ast_verb(4, "Found column '%s' of type '%s'\n", fname, ftype);
 			cur = ast_calloc(1, sizeof(*cur) + strlen(fname) + strlen(ftype) + 2);
 			if (cur) {
@@ -474,6 +487,16 @@
 				cur->type = (char *)cur + sizeof(*cur) + strlen(fname) + 1;
 				strcpy(cur->name, fname);
 				strcpy(cur->type, ftype);
+				if (*fnotnull == 't') {
+					cur->notnull = 1;
+				} else {
+					cur->notnull = 0;
+				}
+				if (!ast_strlen_zero(fdef)) {
+					cur->hasdefault = 1;
+				} else {
+					cur->hasdefault = 0;
+				}
 				AST_RWLIST_INSERT_TAIL(&psql_columns, cur, list);
 			}
 		}

Modified: team/murf/bug11210/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_h323.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_h323.c (original)
+++ team/murf/bug11210/channels/chan_h323.c Wed Apr 16 14:04:14 2008
@@ -1148,7 +1148,7 @@
 	while(pvt) {
 		if (!pvt->needdestroy && ((signed int)pvt->cd.call_reference == call_reference)) {
 			/* Found the call */
-			if ((token != NULL) && (!strcmp(pvt->cd.call_token, token))) {
+			if ((token != NULL) && (pvt->cd.call_token != NULL) && (!strcmp(pvt->cd.call_token, token))) {
 				ast_mutex_lock(&pvt->lock);
 				ast_mutex_unlock(&iflock);
 				return pvt;

Modified: team/murf/bug11210/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_iax2.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_iax2.c (original)
+++ team/murf/bug11210/channels/chan_iax2.c Wed Apr 16 14:04:14 2008
@@ -1817,7 +1817,7 @@
 
 static struct chan_iax2_pvt *tmp_pvt_ptr = NULL;
 
-static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd)
+static int __find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd, int return_locked)
 {
 	int res = 0;
 	int x;
@@ -1955,11 +1955,21 @@
 			ast_mutex_unlock(&iaxsl[x]);
 			return 0;
 		}
-		
-		ast_mutex_unlock(&iaxsl[x]);
+		if (!return_locked)
+			ast_mutex_unlock(&iaxsl[x]);
 		res = x;
 	}
 	return res;
+}
+
+static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd) {
+
+	return __find_callno(callno, dcallno, sin, new, sockfd, 0);
+}
+
+static int find_callno_locked(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int sockfd) {
+
+	return __find_callno(callno, dcallno, sin, new, sockfd, 1);
 }
 
 static void iax2_frame_free(struct iax_frame *fr)
@@ -4421,6 +4431,13 @@
 	ast_mutex_unlock(&iaxsl[callno]);
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "IAX2/%s-%d", i->host, i->callno);
 	ast_mutex_lock(&iaxsl[callno]);
+	if (!iaxs[callno]) {
+		if (tmp) {
+			ast_channel_free(tmp);
+		}
+		ast_mutex_unlock(&iaxsl[callno]);
+		return NULL;
+	}
 	iax2_ami_channelupdate(i);
 	if (!tmp)
 		return NULL;
@@ -8147,11 +8164,9 @@
 		if (len > packet_len)
 			break;
 		ast_log(LOG_NOTICE,"Calling find_callno\n");
-		fr->callno = find_callno(callno & ~IAX_FLAG_FULL, 0, sin, NEW_PREVENT, sockfd);
+		fr->callno = find_callno_locked(callno & ~IAX_FLAG_FULL, 0, sin, NEW_PREVENT, sockfd);
 		if (!fr->callno)
 			continue;
-
-		ast_mutex_lock(&iaxsl[fr->callno]);
 
 		/* If it's a valid call, deliver the contents.  If not, we
 		   drop it, since we don't have a scallno to use for an INVAL */
@@ -8539,7 +8554,9 @@
 					if (call_to_destroy) {
 						if (iaxdebug)
 							ast_debug(1, "Really destroying %d, having been acked on final message\n", call_to_destroy);
+						ast_mutex_lock(&iaxsl[call_to_destroy]);
 						iax2_unlink(call_to_destroy);
+						ast_mutex_unlock(&iaxsl[call_to_destroy]);
 					}
 				}
 				/* Note how much we've received acknowledgement for */
@@ -10003,13 +10020,14 @@
 	if (!reg->callno) {
 		ast_debug(1, "Allocate call number\n");
 		ast_log(LOG_NOTICE,"Calling find_callno\n");
-		reg->callno = find_callno(0, 0, &reg->addr, NEW_FORCE, defaultsockfd);
+		reg->callno = find_callno_locked(0, 0, &reg->addr, NEW_FORCE, defaultsockfd);
 		if (reg->callno < 1) {
 			ast_log(LOG_WARNING, "Unable to create call for registration\n");
 			return -1;
 		} else
 			ast_debug(1, "Registration created on call %d\n", reg->callno);
 		iaxs[reg->callno]->reg = reg;
+		ast_mutex_unlock(&iaxsl[reg->callno]);
 	}
 	/* Setup the next registration a little early */
 	reg->expire = iax2_sched_replace(reg->expire, sched, 
@@ -10054,11 +10072,10 @@
 	iax_ie_append_raw(&ied, IAX_IE_PROVISIONING, provdata.buf, provdata.pos);
 
 	ast_log(LOG_NOTICE,"Calling find_callno\n");
-	callno = find_callno(0, 0, &sin, NEW_FORCE, cai.sockfd);
+	callno = find_callno_locked(0, 0, &sin, NEW_FORCE, cai.sockfd);
 	if (!callno)
 		return -1;
 
-	ast_mutex_lock(&iaxsl[callno]);
 	if (iaxs[callno]) {
 		/* Schedule autodestruct in case they don't ever give us anything back */
 		iaxs[callno]->autoid = iax2_sched_replace(iaxs[callno]->autoid, 
@@ -10294,14 +10311,12 @@
 		sin.sin_port = htons(atoi(pds.port));
 
 	ast_log(LOG_NOTICE,"Calling find_callno\n");
-	callno = find_callno(0, 0, &sin, NEW_FORCE, cai.sockfd);
+	callno = find_callno_locked(0, 0, &sin, NEW_FORCE, cai.sockfd);
 	if (callno < 1) {
 		ast_log(LOG_WARNING, "Unable to create call\n");
 		*cause = AST_CAUSE_CONGESTION;
 		return NULL;
 	}
-
-	ast_mutex_lock(&iaxsl[callno]);
 
 	/* If this is a trunk, update it now */
 	ast_copy_flags(iaxs[callno], &cai, IAX_TRUNK | IAX_SENDANI | IAX_NOTRANSFER | IAX_TRANSFERMEDIA | IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);	
@@ -11701,13 +11716,12 @@
 		pds.peer, pds.username, pds.password, pds.context);
 
 	ast_log(LOG_NOTICE,"Calling find_callno\n");
-	callno = find_callno(0, 0, &sin, NEW_FORCE, cai.sockfd);
+	callno = find_callno_locked(0, 0, &sin, NEW_FORCE, cai.sockfd);
 	if (callno < 1) {
 		ast_log(LOG_WARNING, "Unable to create call\n");
 		return -1;
 	}
 
-	ast_mutex_lock(&iaxsl[callno]);
 	ast_string_field_set(iaxs[callno], dproot, data);
 	iaxs[callno]->capability = IAX_CAPABILITY_FULLBANDWIDTH;
 

Modified: team/murf/bug11210/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_local.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_local.c (original)
+++ team/murf/bug11210/channels/chan_local.c Wed Apr 16 14:04:14 2008
@@ -183,8 +183,11 @@
 		bridged = (bridge == p->owner ? p->chan : p->owner);
 		
 		/* Now see if the opposite channel is bridged to anything */
-		if (bridged->_bridge)
+		if (!bridged) {
+			bridged = bridge;
+		} else if (bridged->_bridge) {
 			bridged = bridged->_bridge;
+		}
 	}
 
 	ast_mutex_unlock(&p->lock);

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Wed Apr 16 14:04:14 2008
@@ -7151,7 +7151,7 @@
 	}
 	if (!newjointcapability) {
 		/* If T.38 was not negotiated either, totally bail out... */
-		if (!p->t38.jointcapability || !p->t38.peercapability) {
+		if (!p->t38.jointcapability || !udptlportno) {
 			ast_log(LOG_NOTICE, "No compatible codecs, not accepting this offer!\n");
 			/* Do NOT Change current setting */
 			return -1;
@@ -15150,6 +15150,14 @@
 		ast_copy_string(buf, peer->cid_num, len);
 	} else  if (!strcasecmp(colname, "codecs")) {
 		ast_getformatname_multiple(buf, len -1, peer->capability);
+	} else  if (!strncasecmp(colname, "chanvar[", 8)) {
+		char *chanvar=colname + 8;
+		struct ast_variable *v;
+	
+		chanvar = strsep(&chanvar, "]");
+		for (v = peer->chanvars ; v ; v = v->next)
+			if (strcasecmp(v->name, chanvar) == 0)
+				ast_copy_string(buf, v->value, sizeof(buf));
 	} else  if (!strncasecmp(colname, "codec[", 6)) {
 		char *codecnum;
 		int index = 0, codec = 0;
@@ -15194,6 +15202,7 @@
 	"- language              Default language for peer\n"
 	"- accountcode           Account code for this peer\n"
 	"- useragent             Current user agent id for peer\n"
+	"- chanvar[name]         A channel variable configured with setvar for this peer.\n"
 	"- codec[x]              Preferred codec index number 'x' (beginning with zero).\n"
 	"\n"
 };
@@ -16306,6 +16315,11 @@
 				} else {
 					if (!p->subscribed && !p->refer)
 						p->needdestroy = 1;
+					if (ast_test_flag(&p->flags[1], SIP_PAGE2_STATECHANGEQUEUE)) {
+						/* Ready to send the next state we have on queue */
+						ast_clear_flag(&p->flags[1], SIP_PAGE2_STATECHANGEQUEUE);
+						cb_extensionstate((char *)p->context, (char *)p->exten, p->laststate, (void *) p);
+					}
 				}
 			} else if (sipmethod == SIP_BYE)
 				p->needdestroy = 1;

Modified: team/murf/bug11210/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_unistim.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_unistim.c (original)
+++ team/murf/bug11210/channels/chan_unistim.c Wed Apr 16 14:04:14 2008
@@ -513,7 +513,7 @@
 const static unsigned char packet_recv_resume_connection_with_server[] =
 	{ 0xff, 0xff, 0xff, 0xff, 0x9e, 0x03, 0x08 };
 const static unsigned char packet_recv_mac_addr[] =
-	{ 0xff, 0xff, 0xff, 0xff, 0x9a, 0x0d, 0x07, 0x31, 0x38 /*MacAddr */  };
+	{ 0xff, 0xff, 0xff, 0xff, 0x9a, 0x0d, 0x07 /*MacAddr */  };
 
 const static unsigned char packet_send_date_time3[] =
 	{ 0x11, 0x09, 0x02, 0x02, /*Month */ 0x05, /*Day */ 0x06, /*Hour */ 0x07,

Modified: team/murf/bug11210/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_zap.c?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/channels/chan_zap.c (original)
+++ team/murf/bug11210/channels/chan_zap.c Wed Apr 16 14:04:14 2008
@@ -9114,6 +9114,7 @@
 	}
 }
 
+/* XXX: This function is assumed to be called with the private channel lock and linkset lock held */
 static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
 {
 	struct ss7 *ss7 = linkset->ss7;
@@ -9140,10 +9141,14 @@
 	ast_mutex_unlock(&linkset->lock);
 	c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
 	ast_mutex_lock(&linkset->lock);
-	if (c)
+
+	if (!c) {
+		ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
+		return;
+	} else
 		ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
-	else
-		ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
+
+	zt_enable_ec(p);
 
 	if (!ast_strlen_zero(p->charge_number)) {
 		pbx_builtin_setvar_helper(c, "SS7_CHARGE_NUMBER", p->charge_number);
@@ -9506,10 +9511,14 @@
 				}
 				p = linkset->pvts[chanpos];
 
+				ast_mutex_lock(&p->lock);
+
 				if (p->loopedback) {
 					zt_loopback(p, 0);
 					ss7_start_call(p, linkset);
 				}
+
+				ast_mutex_unlock(&p->lock);
 
 				break;
 			case ISUP_EVENT_CCR:

Modified: team/murf/bug11210/configs/res_ldap.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/configs/res_ldap.conf.sample?view=diff&rev=114177&r1=114176&r2=114177
==============================================================================
--- team/murf/bug11210/configs/res_ldap.conf.sample (original)
+++ team/murf/bug11210/configs/res_ldap.conf.sample Wed Apr 16 14:04:14 2008
@@ -28,92 +28,92 @@
 ; additionalFilter - This specifies an additional set of criteria to be used
 ; when querying the LDAP server.
 ;
-additionalFilter=(objectClass=PBXConfig)
+additionalFilter=(objectClass=AstConfig)
 ;
 ; Attributes mapping (asterisk variable name = ldap attribute name)
 ; When Asterisk requests the variable by the name of the value on the left,
 ; this module will look up the attribute listed on the right.
 ;
-filename = PBXConfigFilename
-category = PBXConfigCategory
-variable_name = PBXConfigVariableName
-variable_value = PBXConfigVariableValue
-cat_metric = PBXConfigCategoryMetric
-commented = PBXConfigCommented
+filename = AstConfigFilename
+category = AstConfigCategory
+variable_name = AstConfigVariableName
+variable_value = AstConfigVariableValue
+cat_metric = AstConfigCategoryMetric
+commented = AstConfigCommented
 
 ;
 ; Extensions Table
 ;
 [extensions]
-context  =  PBXExtensionContext
-exten  =  PBXExtensionExten
-priority = PBXExtensionPriority
-app = PBXExtensionApplication
-appdata = PBXExtensionApplicationData
-additionalFilter=(objectClass=PBXExtension)
+context  =  AstExtensionContext
+exten  =  AstExtensionExten
+priority = AstExtensionPriority
+app = AstExtensionApplication
+appdata = AstExtensionApplicationData
+additionalFilter=(objectClass=AstExtension)
 
 ;
 ; Sip Users Table
 ;
 [sip]
 name = uid
-amaflags = PBXAccountAMAFlags
-callgroup = PBXAccountCallGroup
-callerid = PBXAccountCallerID
-canreinvite = PBXAccountCanReinvite
-context = PBXAccountContext
-dtmfmode = PBXAccountDTMFMode
-fromuser = PBXAccountFromUser

[... 630 lines stripped ...]



More information about the asterisk-commits mailing list