[asterisk-commits] murf: branch murf/bug8189 r47988 - in /team/murf/bug8189: ./ apps/ channels/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Nov 24 08:40:06 MST 2006


Author: murf
Date: Fri Nov 24 09:40:05 2006
New Revision: 47988

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47988
Log:
Merged revisions 47806,47813-47815,47817-47818,47821-47822,47824,47827,47829,47834-47836,47844,47846-47847,47851,47853-47854,47857,47861,47866,47880-47881,47893,47898,47912,47923,47933-47935,47945,47957,47960,47986 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r47806 | qwell | 2006-11-17 13:46:36 -0700 (Fri, 17 Nov 2006) | 4 lines

Add ability to add custom queue log via manager interface.

Issue 7806, patch by alexrch, with slight modifications by me.

................
r47813 | rizzo | 2006-11-17 14:50:55 -0700 (Fri, 17 Nov 2006) | 9 lines

describe a bit the patterns that you can have in the commands,
and add support for wildcard (spelled as '%').

On passing fix a bug in the expansion code which was hidden and
appeared when implementing the wildcard
The fix is just the line 'src != argindex', in case someone wants
to test this on 1.4 - but i would just keep this in trunk.


................
r47814 | qwell | 2006-11-17 14:51:42 -0700 (Fri, 17 Nov 2006) | 6 lines

Add ability to notify an external application/script that the voicemail password was,
while also still changing the password "internally".

Issue 7371, initial patch by pdunkel, with rewrite/config comments by me.
Additional modifications (yay bitmask) by pdunkel.

................
r47815 | rizzo | 2006-11-17 15:02:15 -0700 (Fri, 17 Nov 2006) | 3 lines

standardize "module show [like]"


................
r47817 | rizzo | 2006-11-17 15:53:57 -0700 (Fri, 17 Nov 2006) | 5 lines

convert "help" to new style,
fix completion of arguments past the first one
that i broke earlier today.


................
r47818 | rizzo | 2006-11-17 15:56:58 -0700 (Fri, 17 Nov 2006) | 3 lines

remove a debugging message


................
r47821 | murf | 2006-11-17 16:18:51 -0700 (Fri, 17 Nov 2006) | 1 line

This update fulfils the request of bug 7109, which claimed the language arg to ast_stream_and_wait() was redundant. Almost all calls just used chan->language, and seeing how chan is the first argument, this certainly seems redundant. A change of language could just as easily be done by simply changing the channel language before calling.
................
r47822 | rizzo | 2006-11-18 01:19:41 -0700 (Sat, 18 Nov 2006) | 15 lines

prevent the sound thread from consuming all the available CPU
doing busy-wait on the output audio device.
As it is set now, it tries to push a frame every 10ms,
which is still too frequent but avoids deep restructuring
of the code (which i should do, though).

Note, this is only for ring tones, regular audio coming
from the network is still delivered as soon as it is
available.

Eventually this could well end up in the 1.4 branch, but
since i am probably the only user of chan_oss there isn't
much urgency to do that.


................
r47824 | rizzo | 2006-11-18 11:03:42 -0700 (Sat, 18 Nov 2006) | 14 lines

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

........
r47823 | rizzo | 2006-11-18 18:59:35 +0100 (Sat, 18 Nov 2006) | 5 lines

fix bug 7450 - Parsing fails if From header contains angle brackets 
(the bug was only in a corner case where the < was right after the
opening quote, and the fix is trivial).


........


................
r47827 | rizzo | 2006-11-18 13:08:17 -0700 (Sat, 18 Nov 2006) | 11 lines

Move this macro from cli.c to cli.h so apps can use it
without duplicating the macro or the code:

/*!
 * In many cases we need to print singular or plural
 * words depending on a count. This macro helps us e.g.
 *     printf("we have %d object%s", n, ESS(n));
 */
#define ESS(x) ((x) == 1 ? "" : "s")


................
r47829 | rizzo | 2006-11-18 13:17:06 -0700 (Sat, 18 Nov 2006) | 5 lines

ESS-ification.

no need to bring this in 1.4, it is just code cleanup


................
r47834 | rizzo | 2006-11-18 15:14:20 -0700 (Sat, 18 Nov 2006) | 5 lines

comments-only change:
document a bit more when manager events are delivered
to the clients.


................
r47835 | murf | 2006-11-18 21:12:39 -0700 (Sat, 18 Nov 2006) | 1 line

Added a few words of explanation about macros
................
r47836 | murf | 2006-11-18 21:22:33 -0700 (Sat, 18 Nov 2006) | 1 line

Added a few words to explain the change to AEL concerning Gosub()
................
r47844 | oej | 2006-11-20 04:36:45 -0700 (Mon, 20 Nov 2006) | 2 lines

Properly reset schedule items (rizzo)

................
r47846 | oej | 2006-11-20 04:46:45 -0700 (Mon, 20 Nov 2006) | 2 lines

Update docs for videosupport

................
r47847 | murf | 2006-11-20 07:08:04 -0700 (Mon, 20 Nov 2006) | 1 line

Erased the svnmerge-integrated prop from trunk. Please, in your svnmerge-ings, don't let these props leak into the trunk or branches.
................
r47851 | file | 2006-11-20 08:55:58 -0700 (Mon, 20 Nov 2006) | 10 lines

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

........
r47850 | file | 2006-11-20 10:51:37 -0500 (Mon, 20 Nov 2006) | 2 lines

Use a separate variable in the channel structure to store the context that the channel was dialed from. (issue #8382 reported by jiddings)

........

................
r47853 | file | 2006-11-20 09:04:14 -0700 (Mon, 20 Nov 2006) | 10 lines

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

........
r47852 | file | 2006-11-20 10:58:50 -0500 (Mon, 20 Nov 2006) | 2 lines

Only remove/destroy the RTCP I/O item if it exists.

........

................
r47854 | file | 2006-11-20 09:06:10 -0700 (Mon, 20 Nov 2006) | 2 lines

Use RTP/RTCP fds on the RTP structure, don't bother storing them.

................
r47857 | file | 2006-11-20 09:19:13 -0700 (Mon, 20 Nov 2006) | 16 lines

Blocked revisions 47856 via svnmerge

................
r47856 | file | 2006-11-20 11:17:47 -0500 (Mon, 20 Nov 2006) | 9 lines

Blocked revisions 47855 via svnmerge

........
r47855 | file | 2006-11-20 11:16:22 -0500 (Mon, 20 Nov 2006) | 2 lines

Free history items at the end of use of the temporary SIP pvt structure. (issue #8383 reported by benh)

........

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

................
r47861 | file | 2006-11-20 12:52:38 -0700 (Mon, 20 Nov 2006) | 18 lines

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

................
r47860 | file | 2006-11-20 14:51:36 -0500 (Mon, 20 Nov 2006) | 10 lines

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

........
r47859 | file | 2006-11-20 14:50:21 -0500 (Mon, 20 Nov 2006) | 2 lines

Don't forget to byte swap if we are exiting the smoother feed early. (issue #8287 reported by arturs)

........

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

................
r47866 | tilghman | 2006-11-20 13:04:11 -0700 (Mon, 20 Nov 2006) | 11 lines

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

........
r47864 | tilghman | 2006-11-20 14:01:58 -0600 (Mon, 20 Nov 2006) | 2 lines

Oops, merge missed release of odbc object

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

................
r47880 | rizzo | 2006-11-21 04:07:30 -0700 (Tue, 21 Nov 2006) | 8 lines

do not ast_hangup() on a NULL channel.
In the original code this would happen in the case of
	o->forwards >=  AST_MAX_FORWARDS

Likely an 1.2/1.4 isse as well - please someone have a look,
while I am hunting a few more similar panics now.


................
r47881 | rizzo | 2006-11-21 04:53:06 -0700 (Tue, 21 Nov 2006) | 10 lines

better fix for the previous bug.

In general this code needs a deep revision, because the body of
do_forward() deletes/overwrites the output channel without freeing
the resouce in some cases, and without notifying the caller.

Also, on FreeBSD with MALLOC_OPTIONS set i am seeing various panics
(duplicate freee etc.)


................
r47893 | oej | 2006-11-21 08:25:38 -0700 (Tue, 21 Nov 2006) | 2 lines

Treat 101 as 100, not 183 session progress

................
r47898 | file | 2006-11-21 10:34:22 -0700 (Tue, 21 Nov 2006) | 10 lines

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

........
r47897 | file | 2006-11-21 12:32:27 -0500 (Tue, 21 Nov 2006) | 2 lines

If we have the non standard G726-32 setting turned on we want to return G726-32 to the SDP, not our AAL2 string. (issue #8330 reported by voipgate)

........

................
r47912 | markster | 2006-11-21 22:49:06 -0700 (Tue, 21 Nov 2006) | 2 lines

Restore some sense of security to manager

................
r47923 | oej | 2006-11-22 04:28:12 -0700 (Wed, 22 Nov 2006) | 2 lines

Don't over-deprecate... :-)

................
r47933 | file | 2006-11-22 10:41:07 -0700 (Wed, 22 Nov 2006) | 2 lines

Add support to set the maximum number of files open when Asterisk loads using the 'maxfiles' configuration option. (issue #7499 reported by rkarlsba)

................
r47934 | file | 2006-11-22 10:43:36 -0700 (Wed, 22 Nov 2006) | 2 lines

Need to update the CHANGES file as well for the maxfiles option.

................
r47935 | file | 2006-11-22 10:47:14 -0700 (Wed, 22 Nov 2006) | 2 lines

Clarify a bit more.

................
r47945 | file | 2006-11-22 14:49:11 -0700 (Wed, 22 Nov 2006) | 10 lines

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

........
r47944 | file | 2006-11-22 16:47:43 -0500 (Wed, 22 Nov 2006) | 2 lines

Video will never reach Packet2Packet bridging and can do more harm then good.

........

................
r47957 | oej | 2006-11-23 03:46:09 -0700 (Thu, 23 Nov 2006) | 2 lines

Document new configuration option.

................
r47960 | oej | 2006-11-23 04:04:25 -0700 (Thu, 23 Nov 2006) | 2 lines

Remove unused memory allocation

................
r47986 | oej | 2006-11-24 07:00:19 -0700 (Fri, 24 Nov 2006) | 6 lines

Doxygen update
- Document cause codes
- Document a bit more on channel variables - global, predefined and local
- Fix some doxygen in channel.h. Adding one comment for two definitions does not
  work. They won't be copied to each.

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

Modified:
    team/murf/bug8189/   (props changed)
    team/murf/bug8189/.cleancount
    team/murf/bug8189/CHANGES
    team/murf/bug8189/UPGRADE.txt
    team/murf/bug8189/apps/app_dial.c
    team/murf/bug8189/apps/app_directed_pickup.c
    team/murf/bug8189/apps/app_directory.c
    team/murf/bug8189/apps/app_followme.c
    team/murf/bug8189/apps/app_queue.c
    team/murf/bug8189/apps/app_voicemail.c
    team/murf/bug8189/channels/chan_h323.c
    team/murf/bug8189/channels/chan_oss.c
    team/murf/bug8189/channels/chan_sip.c
    team/murf/bug8189/configs/sip.conf.sample
    team/murf/bug8189/configs/voicemail.conf.sample
    team/murf/bug8189/doc/ael.txt
    team/murf/bug8189/doc/asterisk-conf.txt
    team/murf/bug8189/include/asterisk/causes.h
    team/murf/bug8189/include/asterisk/channel.h
    team/murf/bug8189/include/asterisk/cli.h
    team/murf/bug8189/include/asterisk/doxyref.h
    team/murf/bug8189/include/asterisk/file.h
    team/murf/bug8189/main/app.c
    team/murf/bug8189/main/asterisk.c
    team/murf/bug8189/main/cdr.c
    team/murf/bug8189/main/channel.c
    team/murf/bug8189/main/cli.c
    team/murf/bug8189/main/file.c
    team/murf/bug8189/main/frame.c
    team/murf/bug8189/main/manager.c
    team/murf/bug8189/main/pbx.c
    team/murf/bug8189/main/rtp.c
    team/murf/bug8189/res/res_features.c
    team/murf/bug8189/res/res_realtime.c

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

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

Propchange: team/murf/bug8189/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Nov 24 09:40:05 2006
@@ -1,1 +1,1 @@
-/trunk:1-47803
+/trunk:1-47987

Modified: team/murf/bug8189/.cleancount
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/.cleancount?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/.cleancount (original)
+++ team/murf/bug8189/.cleancount Fri Nov 24 09:40:05 2006
@@ -1,1 +1,1 @@
-25
+26

Modified: team/murf/bug8189/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/CHANGES?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/CHANGES (original)
+++ team/murf/bug8189/CHANGES Fri Nov 24 09:40:05 2006
@@ -61,3 +61,5 @@
   * CID matching information is now shown when doing 'dialplan show'.
   * app_queue now has a 'loose' option which is almost exactly like 'strict' except it
      does not count paused queue members as unavailable.
+  * Added maxfiles option to options section of asterisk.conf which allows you to specify
+     what Asterisk should set as the maximum number of open files when it loads.

Modified: team/murf/bug8189/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/UPGRADE.txt?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/UPGRADE.txt (original)
+++ team/murf/bug8189/UPGRADE.txt Fri Nov 24 09:40:05 2006
@@ -6,3 +6,14 @@
 * The CallerID fields across Manager events have now been made more
   consistent. CallerID Number will be sent as CallerIDNum and CallerID
   Name will be sent as CallerIDName wherever used.
+
+AEL:
+
+* Macros are now implemented underneath with the Gosub() application.
+  Heaven Help You if you wrote code depending on any aspect of this!
+  Previous to 1.6, macros were implemented with the Macro() app, which
+  provided a nice feature of auto-returning. The compiler will do its
+  best to insert a Return() app call at the end of your macro if you did
+  not include it, but really, you should make sure that all execution
+  paths within your macros end in "return;".
+

Modified: team/murf/bug8189/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_dial.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_dial.c (original)
+++ team/murf/bug8189/apps/app_dial.c Fri Nov 24 09:40:05 2006
@@ -419,7 +419,12 @@
 					src->name, dialstatus);
 }	
 
-/* helper function for wait_for_answer() */
+/*!
+ * helper function for wait_for_answer()
+ *
+ * XXX this code is highly suspicious, as it essentially overwrites
+ * the outgoing channel without properly deleting it.
+ */
 static void do_forward(struct dial_localuser *o,
 	struct cause_args *num, struct ast_flags *peerflags, int single)
 {
@@ -504,10 +509,10 @@
 				char cidname[AST_MAX_EXTENSION];
 				ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
 			}
-		}
-	}
-	/* Hangup the original channel now, in case we needed it */
-	ast_hangup(c);
+			/* Hangup the original channel now, in case we needed it */
+			ast_hangup(c);
+		}
+	}
 }
 
 /* argument used for some functions. */
@@ -590,7 +595,7 @@
 						       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
 						       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 						       DIAL_NOFORWARDHTML);
-					ast_copy_string(c->context, "", sizeof(c->context));
+					ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 					ast_copy_string(c->exten, "", sizeof(c->exten));
 				}
 				continue;
@@ -625,7 +630,7 @@
 							       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
 							       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 							       DIAL_NOFORWARDHTML);
-						ast_copy_string(c->context, "", sizeof(c->context));
+						ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 						ast_copy_string(c->exten, "", sizeof(c->exten));
 						/* Setup early bridge if appropriate */
 						ast_channel_early_bridge(in, peer);
@@ -1369,7 +1374,7 @@
 			ast_app_group_set_channel(tmp->chan, outbound_group);
 
 		/* Inherit context and extension */
-		ast_copy_string(tmp->chan->context, chan->context, sizeof(tmp->chan->context));
+		ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext));
 		ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
 
 		/* Place the call, but don't wait on the answer */

Modified: team/murf/bug8189/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_directed_pickup.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_directed_pickup.c (original)
+++ team/murf/bug8189/apps/app_directed_pickup.c Fri Nov 24 09:40:05 2006
@@ -97,7 +97,7 @@
 
 	while ((target = ast_channel_walk_locked(target))) {
 		if (!strcasecmp(target->exten, exten) &&
-		    !strcasecmp(target->context, context) &&
+		    !strcasecmp(target->dialcontext, context) &&
 		    can_pickup(target)) {
 			res = pickup_do(chan, target);
 			ast_channel_unlock(target);

Modified: team/murf/bug8189/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_directory.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_directory.c (original)
+++ team/murf/bug8189/apps/app_directory.c Fri Nov 24 09:40:05 2006
@@ -282,17 +282,17 @@
 #endif
 
 	if (ast_fileexists(fn, NULL, chan->language) > 0) {
-		res = ast_stream_and_wait(chan, fn, chan->language, AST_DIGIT_ANY);
+		res = ast_stream_and_wait(chan, fn, AST_DIGIT_ANY);
 		ast_stopstream(chan);
 		/* If Option 'e' was specified, also read the extension number with the name */
 		if (readext) {
-			ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
+			ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
 			res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
 		}
 	} else {
 		res = ast_say_character_str(chan, S_OR(name, ext), AST_DIGIT_ANY, chan->language);
 		if (!ast_strlen_zero(name) && readext) {
-			ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
+			ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
 			res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
 		}
 	}
@@ -303,7 +303,7 @@
 
 	for (loop = 3 ; loop > 0; loop--) {
 		if (!res)
-			res = ast_stream_and_wait(chan, "dir-instr", chan->language, AST_DIGIT_ANY);
+			res = ast_stream_and_wait(chan, "dir-instr", AST_DIGIT_ANY);
 		if (!res)
 			res = ast_waitfordigit(chan, 3000);
 		ast_stopstream(chan);
@@ -622,7 +622,7 @@
 
 	for (;;) {
 		if (!res)
-			res = ast_stream_and_wait(chan, dirintro, chan->language, AST_DIGIT_ANY);
+			res = ast_stream_and_wait(chan, dirintro, AST_DIGIT_ANY);
 		ast_stopstream(chan);
 		if (!res)
 			res = ast_waitfordigit(chan, 5000);

Modified: team/murf/bug8189/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_followme.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_followme.c (original)
+++ team/murf/bug8189/apps/app_followme.c Fri Nov 24 09:40:05 2006
@@ -982,7 +982,7 @@
 		ast_mutex_unlock(&f->lock);
 
 		if (targs.followmeflags.flags & FOLLOWMEFLAG_STATUSMSG) 
-			ast_stream_and_wait(chan, targs.statusprompt, chan->language, "");
+			ast_stream_and_wait(chan, targs.statusprompt, "");
 
 		snprintf(namerecloc,sizeof(namerecloc),"%s/followme.%s",ast_config_AST_SPOOL_DIR,chan->uniqueid);
 		duration = 5;
@@ -1022,7 +1022,7 @@
 		if (targs.status != 100) {
 			ast_moh_stop(chan);
 			if (targs.followmeflags.flags & FOLLOWMEFLAG_UNREACHABLEMSG) 
-				ast_stream_and_wait(chan, targs.sorryprompt, chan->language, "");
+				ast_stream_and_wait(chan, targs.sorryprompt, "");
 			res = 0;
 		} else {
 			caller = chan;

Modified: team/murf/bug8189/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_queue.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_queue.c (original)
+++ team/murf/bug8189/apps/app_queue.c Fri Nov 24 09:40:05 2006
@@ -4461,6 +4461,27 @@
 	return 0;
 }
 
+static int manager_queue_log_custom(struct mansession *s, struct message *m)
+{
+	char *queuename, *event, *message, *interface, *uniqueid;
+
+	queuename = astman_get_header(m, "Queue");
+	uniqueid = astman_get_header(m, "UniqueId");
+	interface = astman_get_header(m, "Interface");
+	event = astman_get_header(m, "Event");
+	message = astman_get_header(m, "Message");
+
+	if (ast_strlen_zero(queuename) || ast_strlen_zero(event)) {
+		astman_send_error(s, m, "Need 'Queue' and 'Event' parameters.");
+		return 0;
+	}
+
+	ast_queue_log(queuename, S_OR(uniqueid, "NONE"), interface, event, "%s", message);
+	astman_send_ack(s, m, "Event added successfully");
+
+	return 0;
+}
+
 static int handle_queue_add_member(int fd, int argc, char *argv[])
 {
 	char *queuename, *interface, *membername;
@@ -4648,6 +4669,7 @@
 	res |= ast_manager_unregister("QueueAdd");
 	res |= ast_manager_unregister("QueueRemove");
 	res |= ast_manager_unregister("QueuePause");
+	res |= ast_manager_unregister("QueueLog");
 	res |= ast_unregister_application(app_aqm);
 	res |= ast_unregister_application(app_rqm);
 	res |= ast_unregister_application(app_pqm);
@@ -4686,6 +4708,7 @@
 	res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
 	res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
 	res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
+	res |= ast_manager_register("QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom, "Adds custom entry in queue_log");
 	res |= ast_custom_function_register(&queuevar_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuememberlist_function);

Modified: team/murf/bug8189/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/apps/app_voicemail.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/apps/app_voicemail.c (original)
+++ team/murf/bug8189/apps/app_voicemail.c Fri Nov 24 09:40:05 2006
@@ -401,6 +401,10 @@
 static char VM_SPOOL_DIR[PATH_MAX];
 
 static char ext_pass_cmd[128];
+
+#define PWDCHANGE_INTERNAL (1 << 1)
+#define PWDCHANGE_EXTERNAL (1 << 2)
+static int pwdchange = PWDCHANGE_INTERNAL;
 
 #if ODBC_STORAGE
 #define tdesc "Comedian Mail (Voicemail System) with ODBC Storage"
@@ -1105,8 +1109,14 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1)
-						fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+					if (fd > -1) {
+						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
+							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+							ast_odbc_release_obj(obj);
+							goto yuck;
+						}
+					}
 				}
 				if (fdm) {
 					memset(fdm, 0, fdlen);
@@ -2143,7 +2153,7 @@
 	snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
 	RETRIEVE(fn, -1);
 	if (ast_fileexists(fn, NULL, NULL) > 0) {
-		res = ast_stream_and_wait(chan, fn, chan->language, ecodes);
+		res = ast_stream_and_wait(chan, fn, ecodes);
 		if (res) {
 			DISPOSE(fn, -1);
 			return res;
@@ -2151,14 +2161,14 @@
 	} else {
 		/* Dispose just in case */
 		DISPOSE(fn, -1);
-		res = ast_stream_and_wait(chan, "vm-theperson", chan->language, ecodes);
+		res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
 		if (res)
 			return res;
 		res = ast_say_digit_str(chan, ext, ecodes, chan->language);
 		if (res)
 			return res;
 	}
-	res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", chan->language, ecodes);
+	res = ast_stream_and_wait(chan, busy ? "vm-isonphone" : "vm-isunavail", ecodes);
 	return res;
 }
 
@@ -2925,7 +2935,7 @@
 		res = 0;
 	}
 	if (!res && !ast_test_flag(options, OPT_SILENT)) {
-		res = ast_stream_and_wait(chan, INTRO, chan->language, ecodes);
+		res = ast_stream_and_wait(chan, INTRO, ecodes);
 		if (res == '#') {
 			ast_set_flag(options, OPT_SILENT);
 			res = 0;
@@ -3039,7 +3049,7 @@
 		/* Now play the beep once we have the message number for our next message. */
 		if (res >= 0) {
 			/* Unless we're *really* silent, try to send the beep */
-			res = ast_stream_and_wait(chan, "beep", chan->language, "");
+			res = ast_stream_and_wait(chan, "beep", "");
 		}
 				
 		/* Store information */
@@ -4152,7 +4162,7 @@
 static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
 {
 	int res;
-	if ((res = ast_stream_and_wait(chan, file, chan->language, AST_DIGIT_ANY)) < 0) 
+	if ((res = ast_stream_and_wait(chan, file, AST_DIGIT_ANY)) < 0) 
 		ast_log(LOG_WARNING, "Unable to play message %s\n", file); 
 	return res;
 }
@@ -4283,7 +4293,7 @@
 							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from");
-						res = ast_stream_and_wait(chan, prefile, chan->language, "");
+						res = ast_stream_and_wait(chan, prefile, "");
 					} else {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
@@ -5741,10 +5751,11 @@
 		if (++tries == 3)
 			return -1;
 	}
-	if (ast_strlen_zero(ext_pass_cmd)) 
-		vm_change_password(vmu,newpassword);
-	else 
-		vm_change_password_shell(vmu,newpassword);
+	if (pwdchange & PWDCHANGE_INTERNAL)
+		vm_change_password(vmu, newpassword);
+	if ((pwdchange & PWDCHANGE_EXTERNAL) && !ast_strlen_zero(ext_pass_cmd))
+		vm_change_password_shell(vmu, newpassword);
+
 	if (option_debug)
 		ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
 	cmd = ast_play_and_wait(chan, vm_passchanged);
@@ -5844,10 +5855,11 @@
 				cmd = ast_play_and_wait(chan, vm_mismatch);
 				break;
 			}
-			if (ast_strlen_zero(ext_pass_cmd)) 
-				vm_change_password(vmu,newpassword);
-			else 
-				vm_change_password_shell(vmu,newpassword);
+			if (pwdchange & PWDCHANGE_INTERNAL)
+				vm_change_password(vmu, newpassword);
+			if ((pwdchange & PWDCHANGE_EXTERNAL) && !ast_strlen_zero(ext_pass_cmd))
+				vm_change_password_shell(vmu, newpassword);
+
 			if (option_debug)
 				ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
 			cmd = ast_play_and_wait(chan, vm_passchanged);
@@ -7176,7 +7188,12 @@
 		/* External password changing command */
 		if ((extpc = ast_variable_retrieve(cfg, "general", "externpass"))) {
 			ast_copy_string(ext_pass_cmd,extpc,sizeof(ext_pass_cmd));
-		}
+			pwdchange = PWDCHANGE_EXTERNAL;
+		} else if ((extpc = ast_variable_retrieve(cfg, "general", "externpassnotify"))) {
+			ast_copy_string(ext_pass_cmd,extpc,sizeof(ext_pass_cmd));
+			pwdchange = PWDCHANGE_EXTERNAL | PWDCHANGE_INTERNAL;
+		}
+
 #ifdef IMAP_STORAGE
 		/* IMAP server address */
 		if ((imap_server = ast_variable_retrieve(cfg, "general", "imapserver"))) {
@@ -7994,7 +8011,7 @@
 				/* Otherwise 1 is to save the existing message */
 				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
-				ast_stream_and_wait(chan, "vm-msgsaved", chan->language, "");
+				ast_stream_and_wait(chan, "vm-msgsaved", "");
 				cmd = 't';
 				return res;
 			}
@@ -8002,7 +8019,7 @@
 			/* Review */
 			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
-			cmd = ast_stream_and_wait(chan, recordfile, chan->language, AST_DIGIT_ANY);
+			cmd = ast_stream_and_wait(chan, recordfile, AST_DIGIT_ANY);
 			break;
 		case '3':
 			message_exists = 0;

Modified: team/murf/bug8189/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/channels/chan_h323.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/channels/chan_h323.c (original)
+++ team/murf/bug8189/channels/chan_h323.c Fri Nov 24 09:40:05 2006
@@ -2754,21 +2754,6 @@
 	h323_tokens_show, "Show all active call tokens",
 	show_tokens_usage };
 
-static struct ast_cli_entry cli_h323_debug_deprecated = {
-	{ "h.323", "debug", NULL },
-	h323_do_debug, "Enable H.323 debug",
-	debug_usage };
-
-static struct ast_cli_entry cli_h323_trace_deprecated = {
-	{ "h.323", "trace", NULL },
-	h323_do_trace, "Enable H.323 Stack Tracing",
-	trace_usage };
-
-static struct ast_cli_entry cli_h323_gk_cycle_deprecated = {
-	{ "h323", "cycle", "gk", NULL },
-	h323_gk_cycle, "Manually re-register with the Gatekeper",
-	show_cycle_usage };
-
 static struct ast_cli_entry cli_h323[] = {
 	{ { "h323", "set", "trace", NULL },
 	h323_do_trace, "Enable H.323 Stack Tracing",

Modified: team/murf/bug8189/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/channels/chan_oss.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/channels/chan_oss.c (original)
+++ team/murf/bug8189/channels/chan_oss.c Fri Nov 24 09:40:05 2006
@@ -530,7 +530,7 @@
 		return 0;
 	}
 	o->w_errors = 0;
-	return write(o->sounddev, ((void *) data), FRAME_SIZE * 2);
+	return write(o->sounddev, (void *)data, FRAME_SIZE * 2);
 }
 
 /*
@@ -559,10 +559,8 @@
 		l = s->samplen - l_sampsent;	/* # of available samples */
 		if (l > 0) {
 			start = l_sampsent % s->datalen;	/* source offset */
-			if (l > FRAME_SIZE - ofs)	/* don't overflow the frame */
-				l = FRAME_SIZE - ofs;
-			if (l > s->datalen - start)	/* don't overflow the source */
-				l = s->datalen - start;
+			l = MIN(l, FRAME_SIZE - ofs);	/* don't overflow the frame */
+			l = MIN(l, s->datalen - start);	/* don't overflow the source */
 			bcopy(s->data + start, myframe + ofs, l * 2);
 			if (0)
 				ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n", l_sampsent, l, s->samplen, ofs);
@@ -572,8 +570,7 @@
 
 			l += s->silencelen;
 			if (l > 0) {
-				if (l > FRAME_SIZE - ofs)
-					l = FRAME_SIZE - ofs;
+				l = MIN(l, FRAME_SIZE - ofs);
 				bcopy(silence, myframe + ofs, l * 2);
 				l_sampsent += l;
 			} else {			/* silence is over, restart sound if loop */
@@ -605,6 +602,7 @@
 	for (;;) {
 		fd_set rfds, wfds;
 		int maxfd, res;
+		struct timeval *to = NULL, t;
 
 		FD_ZERO(&rfds);
 		FD_ZERO(&wfds);
@@ -620,13 +618,19 @@
 				maxfd = MAX(o->sounddev, maxfd);
 			}
 			if (o->cursound > -1) {
-				FD_SET(o->sounddev, &wfds);
-				maxfd = MAX(o->sounddev, maxfd);
+				/*
+				 * We would like to use select here, but the device
+				 * is always writable, so this would become busy wait.
+				 * So we rather set a timeout to 1/2 of the frame size.
+				 */
+				t.tv_sec = 0;
+				t.tv_usec = (1000000 * FRAME_SIZE) / (5 * DEFAULT_SAMPLE_RATE);
+				to = &t;
 			}
 		}
 		/* ast_select emulates linux behaviour in terms of timeout handling */
-		res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
-		if (res < 1) {
+		res = ast_select(maxfd + 1, &rfds, &wfds, NULL, to);
+		if (res < 0) {
 			ast_log(LOG_WARNING, "select failed: %s\n", strerror(errno));
 			sleep(1);
 			continue;
@@ -650,7 +654,7 @@
 		if (o->sounddev > -1) {
 			if (FD_ISSET(o->sounddev, &rfds))	/* read and ignore errors */
 				read(o->sounddev, ign, sizeof(ign));
-			if (FD_ISSET(o->sounddev, &wfds))
+			if (to != NULL)			/* maybe it is possible to write */
 				send_sound(o);
 		}
 	}

Modified: team/murf/bug8189/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/channels/chan_sip.c?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/channels/chan_sip.c (original)
+++ team/murf/bug8189/channels/chan_sip.c Fri Nov 24 09:40:05 2006
@@ -558,7 +558,7 @@
 static int allow_external_domains;	/*!< Accept calls to external SIP domains? */
 static int global_callevents;		/*!< Whether we send manager events or not */
 static int global_t1min;		/*!< T1 roundtrip time minimum */
-static int global_autoframing;          /*!< ?????????? */
+static int global_autoframing;          /*!< Turn autoframing on or off. */
 static enum transfermodes global_allowtransfer;	/*!< SIP Refer restriction scheme */
 
 /*! \brief Codecs that we support by default: */
@@ -2095,6 +2095,7 @@
 				if (sipdebug && option_debug > 3)
 					ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
 				ast_sched_del(sched, cur->retransid);
+				cur->retransid = -1;
 			}
 			UNLINK(cur, p->packets, prev);
 			free(cur);
@@ -2139,8 +2140,8 @@
 				if (option_debug > 3 && sipdebug)
 					ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, sip_methods[sipmethod].text);
 				ast_sched_del(sched, cur->retransid);
+				cur->retransid = -1;
 			}
-			cur->retransid = -1;
 			res = 0;
 			break;
 		}
@@ -2458,6 +2459,7 @@
 	}
 	if (peer->expire > -1)
 		ast_sched_del(sched, peer->expire);
+
 	if (peer->pokeexpire > -1)
 		ast_sched_del(sched, peer->pokeexpire);
 	register_peer_exten(peer, FALSE);
@@ -7818,8 +7820,10 @@
 	else
 		peer->username[0] = '\0';
 
-	if (peer->expire > -1)
+	if (peer->expire > -1) {
 		ast_sched_del(sched, peer->expire);
+		peer->expire = -1;
+	}
 	if (expiry > max_expiry)
 		expiry = max_expiry;
 	if (expiry < min_expiry)
@@ -8925,11 +8929,12 @@
 	if (!end || end == input)	/* we require a part in brackets */
 		return NULL;
 
-	/* move away from "<" */
-	end--;
-
-	/* we found "name" */
-	if (tmp && tmp < end) {
+	end--; /* move just before "<" */
+
+	if (tmp && tmp <= end) {
+		/* The quote (tmp) precedes the bracket (end+1).
+		 * Find the matching quote and return the content.
+		 */
 		end = strchr(tmp+1, '"');
 		if (!end)
 			return NULL;
@@ -8939,7 +8944,7 @@
 			bytes = maxbytes;
 		ast_copy_string(output, tmp + 1, bytes);
 	} else {
-		/* we didn't find "name" */
+		/* No quoted string, or it is inside brackets. */
 		/* clear the empty characters in the begining*/
 		input = ast_skip_blanks(input);
 		/* clear the empty characters in the end */
@@ -11719,7 +11724,7 @@
 	/* RFC3261 says we must treat every 1xx response (but not 100)
 	   that we don't recognize as if it was 183.
 	*/
-	if (resp > 100 && resp < 200 && resp != 180 && resp != 183)
+	if (resp > 100 && resp < 200 && resp!=101 && resp != 180 && resp != 183)
 		resp = 183;
 
  	/* Any response between 100 and 199 is PROCEEDING */
@@ -11733,6 +11738,7 @@
 
 	switch (resp) {
 	case 100:	/* Trying */
+	case 101:	/* Dialog establishment */
 		if (!ast_test_flag(req, SIP_PKT_IGNORE))
 			sip_cancel_destroy(p);
 		check_pendings(p);
@@ -12002,6 +12008,7 @@
 		if (global_regattempts_max)
 			p->registry->regattempts = global_regattempts_max+1;
 		ast_sched_del(sched, r->timeout);
+		r->timeout = -1;
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		break;
 	case 404:	/* Not found */
@@ -12011,6 +12018,7 @@
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		r->call = NULL;
 		ast_sched_del(sched, r->timeout);
+		r->timeout = -1;
 		break;
 	case 407:	/* Proxy auth */
 		if (p->authtries == MAX_AUTHTRIES || do_register_auth(p, req, resp)) {
@@ -12044,6 +12052,7 @@
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		r->call = NULL;
 		ast_sched_del(sched, r->timeout);
+		r->timeout = -1;
 		break;
 	case 200:	/* 200 OK */
 		if (!r) {
@@ -12224,6 +12233,7 @@
 	} else if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 		switch(resp) {
 		case 100:	/* 100 Trying */
+		case 101:	/* 101 Dialog establishment */
 			if (sipmethod == SIP_INVITE) 
 				handle_response_invite(p, resp, rest, req, seqno);
 			break;
@@ -12932,6 +12942,7 @@
 		respcode = atoi(code);
 		switch (respcode) {
 		case 100:	/* Trying: */
+		case 101:	/* dialog establishment */
 			/* Don't do anything yet */
 			break;
 		case 183:	/* Ringing: */
@@ -14538,7 +14549,6 @@
 {
 	/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
 	   relatively static */
-	struct sip_request resp;
 	const char *cmd;
 	const char *cseq;
 	const char *useragent;
@@ -14549,9 +14559,6 @@
 	int debug = sip_debug_test_pvt(p);
 	char *e;
 	int error = 0;
-
-	/* Clear out potential response */
-	memset(&resp, 0, sizeof(resp));
 
 	/* Get Method and Cseq */
 	cseq = get_header(req, "Cseq");
@@ -17108,6 +17115,7 @@
 			sip_destroy(iterator->call);
 		}
 		ASTOBJ_UNLOCK(iterator);
+	
 	} while(0));
 
 	/* Then, actually destroy users and registry */

Modified: team/murf/bug8189/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/configs/sip.conf.sample?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/configs/sip.conf.sample (original)
+++ team/murf/bug8189/configs/sip.conf.sample Fri Nov 24 09:40:05 2006
@@ -119,7 +119,11 @@
 
 ;compactheaders = yes		; send compact sip headers.
 ;
-;videosupport=yes		; Turn on support for SIP video
+;videosupport=yes		; Turn on support for SIP video. You need to turn this on
+				; in the this section to get any video support at all.
+				; You can turn it off on a per peer basis if the general
+				; video support is enabled, but you can't enable it for
+				; one peer only without enabling in the general section.
 ;maxcallbitrate=384		; Maximum bitrate for video calls (default 384 kb/s)
 				; Videosupport and maxcallbitrate is settable
 				; for peers and users as well

Modified: team/murf/bug8189/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/configs/voicemail.conf.sample?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/configs/voicemail.conf.sample (original)
+++ team/murf/bug8189/configs/voicemail.conf.sample Fri Nov 24 09:40:05 2006
@@ -66,7 +66,11 @@
 
 ; If you need to have an external program, i.e. /usr/bin/myapp
 ; called when a voicemail password is changed, uncomment this:
+; Note: If this is set, the password will NOT be changed in voicemail.conf
+; If you would like to also change the password in voicemail.conf, use
+; the externpassnotify option below instead.
 ;externpass=/usr/bin/myapp
+;externpassnotify=/usr/bin/myapp
 ; For the directory, you can override the intro file if you want
 ;directoryintro=dir-intro
 ; The character set for voicemail messages can be specified here

Modified: team/murf/bug8189/doc/ael.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug8189/doc/ael.txt?view=diff&rev=47988&r1=47987&r2=47988
==============================================================================
--- team/murf/bug8189/doc/ael.txt (original)
+++ team/murf/bug8189/doc/ael.txt Fri Nov 24 09:40:05 2006
@@ -102,7 +102,9 @@
 might. A macro call can be made within an extension, and the
 individual statements there are executed until it ends. At this point,
 execution returns to the next statement after the macro call. Macros
-can call other macros. And they work just like function calls.
+can call other macros. And they work just like function calls. In 1.2,
+and 1.4, they are implemented underneath with the Macro() application.

[... 1161 lines stripped ...]


More information about the asterisk-commits mailing list