[svn-commits] seanbright: branch seanbright/resolve-shadow-warnings r115845 - in /team/sean...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue May 13 09:49:21 CDT 2008
Author: seanbright
Date: Tue May 13 09:49:20 2008
New Revision: 115845
URL: http://svn.digium.com/view/asterisk?view=rev&rev=115845
Log:
Merged revisions 115507,115509,115513,115515,115518-115519,115521,115523,115525,115535,115537,115546,115548,115552,115555,115558,115562,115566,115569,115580,115582,115584,115586,115588,115591,115593-115596,115598,115600,115669,115705,115737,115784,115813 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r115507 | file | 2008-05-07 09:41:25 -0400 (Wed, 07 May 2008) | 4 lines
Remove redundant header getting.
(closes issue #12597)
Reported by: hooi
................
r115509 | tilghman | 2008-05-07 09:49:15 -0400 (Wed, 07 May 2008) | 6 lines
Update typos in description fields
(closes issue #12598)
Reported by: suretec
Patches:
asterisk_schema_changes.patch uploaded by suretec (license 70)
................
r115513 | russell | 2008-05-07 13:28:19 -0400 (Wed, 07 May 2008) | 19 lines
Merged revisions 115512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r115512 | russell | 2008-05-07 11:24:09 -0500 (Wed, 07 May 2008) | 11 lines
Merged revisions 115511 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r115511 | russell | 2008-05-07 11:22:49 -0500 (Wed, 07 May 2008) | 3 lines
Remove remnants of dlinkedlists. I didn't actually use them in the final version
of my IAX2 improvements.
........
................
................
r115515 | russell | 2008-05-07 13:38:36 -0400 (Wed, 07 May 2008) | 2 lines
re-add dlinkedlists.h to trunk, oops!
................
r115518 | russell | 2008-05-07 14:17:43 -0400 (Wed, 07 May 2008) | 12 lines
Blocked revisions 115517 via svnmerge
........
r115517 | russell | 2008-05-07 13:17:19 -0500 (Wed, 07 May 2008) | 5 lines
Track peer references when stored in the sip_pvt struct as the peer related to
a qualify ping or a subscription. This fixes some realtime related crashes.
(closes issue #12588)
(closes issue #12555)
........
................
r115519 | russell | 2008-05-07 14:24:51 -0400 (Wed, 07 May 2008) | 2 lines
Let chan_h323 build in dev mode
................
r115521 | russell | 2008-05-07 14:30:12 -0400 (Wed, 07 May 2008) | 7 lines
Use the default that the log output claims will be used for the basedn
(closes issue #12599)
Reported by: suretec
Patches:
12599.patch uploaded by juggie (license 24)
................
r115523 | russell | 2008-05-07 14:33:50 -0400 (Wed, 07 May 2008) | 6 lines
Only save a password if a username exists.
(closes issue #12600)
Reported By: suretec
Patch by me
................
r115525 | tilghman | 2008-05-07 14:40:21 -0400 (Wed, 07 May 2008) | 2 lines
Don't free the object on destroy, as astobj2 takes care of that for you
................
r115535 | tilghman | 2008-05-07 16:22:09 -0400 (Wed, 07 May 2008) | 2 lines
Advance to next sounds release
................
r115537 | russell | 2008-05-07 17:11:33 -0400 (Wed, 07 May 2008) | 10 lines
Fix up a problem that was introduced into the scheduler when it was converted
to use doubly linked lists. The schedule() function had an optimization that
had it try to guess which direction would be better for the traversal to insert
the task into the scheduler queue. However, if the code chose the path where
it traversed the queue in reverse, and the result was that the task should be
at the head of the queue, then the code would actually put it at the tail,
instead.
(Problem found by bbryant, debugged and fixed by bbryant and me)
................
r115546 | russell | 2008-05-08 10:41:12 -0400 (Thu, 08 May 2008) | 12 lines
Merged revisions 115545 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115545 | russell | 2008-05-08 09:40:53 -0500 (Thu, 08 May 2008) | 4 lines
Use the same method for executing Asterisk as the rest of the script.
(closes issue #12611)
Reported by: b_plessis
........
................
r115548 | mattf | 2008-05-08 11:04:45 -0400 (Thu, 08 May 2008) | 1 line
Remove unused code as well as demote an error message to a debug message
................
r115552 | russell | 2008-05-08 11:26:49 -0400 (Thu, 08 May 2008) | 12 lines
Merged revisions 115551 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115551 | russell | 2008-05-08 10:24:54 -0500 (Thu, 08 May 2008) | 4 lines
Don't use a channel before checking for channel allocation failure.
(closes issue #12609)
Reported by: edantie
........
................
r115555 | russell | 2008-05-08 11:32:48 -0400 (Thu, 08 May 2008) | 11 lines
Merged revisions 115554 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115554 | russell | 2008-05-08 10:32:08 -0500 (Thu, 08 May 2008) | 3 lines
Don't exit the script if Asterisk is not running.
(closes issue #12611)
........
................
r115558 | russell | 2008-05-08 11:38:27 -0400 (Thu, 08 May 2008) | 11 lines
Merged revisions 115557 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115557 | russell | 2008-05-08 10:37:49 -0500 (Thu, 08 May 2008) | 3 lines
remove postgres_cdr.sql, as the CDR schema is in realtime_pgsql.sql, as well
(closes issue #9676)
........
................
r115562 | russell | 2008-05-08 12:14:08 -0400 (Thu, 08 May 2008) | 11 lines
Merged revisions 115561 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115561 | russell | 2008-05-08 11:11:33 -0500 (Thu, 08 May 2008) | 3 lines
Don't give up on attempting an outbound registration if we receive a 408 Timeout.
(closes issue #12323)
........
................
r115566 | russell | 2008-05-08 15:17:04 -0400 (Thu, 08 May 2008) | 41 lines
Merged revisions 115565 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r115565 | russell | 2008-05-08 14:15:25 -0500 (Thu, 08 May 2008) | 33 lines
Merged revisions 115564 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r115564 | russell | 2008-05-08 14:14:04 -0500 (Thu, 08 May 2008) | 25 lines
Fix a race condition that bbryant just found while doing some IAX2 testing.
He was running Asterisk trunk running IAX2 calls through a few Asterisk boxes,
however, the audio was extremely choppy. We looked at a packet trace and saw
a storm of INVAL and VNAK frames being sent from one box to another.
It turned out that what had happened was that one box tried to send a CONTROL
frame before the 3 way handshake had completed. So, that frame did not include
the destination call number, because it didn't have it yet. Part of our recent
work for security issues included an additional check to ensure that frames that
are supposed to include the destination call number have the correct one. This
caused the frame to be rejected with an INVAL. The frame would get retransmitted
for forever, rejected every time ...
This race condition exists in all versions that got the security changes,
in theory. However, it is really only likely that this would cause a problem in
Asterisk trunk. There was a control frame being sent (SRCUPDATE) at the _very_
beginning of the call, which does not exist in 1.2 or 1.4. However, I am fixing
all versions that could potentially be affected by the introduced race condition.
These changes are what bbryant and I came up with to fix the issue. Instead of
simply dropping control frames that get sent before the handshake is complete,
the code attempts to wait a little while, since in most cases, the handshake
will complete very quickly. If it doesn't complete after yielding for a little
while, then the frame gets dropped.
........
................
................
r115569 | russell | 2008-05-08 15:20:35 -0400 (Thu, 08 May 2008) | 10 lines
Merged revisions 115568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115568 | russell | 2008-05-08 14:19:50 -0500 (Thu, 08 May 2008) | 2 lines
Remove debug output.
........
................
r115580 | file | 2008-05-09 12:36:58 -0400 (Fri, 09 May 2008) | 10 lines
Merged revisions 115579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115579 | file | 2008-05-09 13:34:08 -0300 (Fri, 09 May 2008) | 2 lines
Improve res_ninit and res_ndestroy autoconf logic on the Darwin platform.
........
................
r115582 | tilghman | 2008-05-09 13:28:06 -0400 (Fri, 09 May 2008) | 7 lines
Allow a password change to be validated by an external script.
(closes issue #12090)
Reported by: jaroth
Patches:
vm-check-newpassword.diff.txt uploaded by mvanbaak (license 7)
20080509__bug12090.diff.txt uploaded by Corydon76 (license 14)
................
r115584 | bbryant | 2008-05-09 15:54:45 -0400 (Fri, 09 May 2008) | 15 lines
The following patch adds new options and alters the default behavior of the ENUM* functions. The TXCIDNAME lookup function has also gotten a
new paramater. The new options for ENUM* functions include 'u', 's', 'i', and 'd' which return the full uri, trigger isn specific rewriting, look
for branches into an infrastructure enum tree, or do a direct dns lookup of a number respectively. The new paramater for TXCIDNAME adds a
zone-suffix argument for looking up caller id's in DNS that aren't e164.arpa.
This patch is based on the original code from otmar, modified by snuffy, and tested by jtodd, me, and others.
(closes issue #8089)
Reported by: otmar
Patches:
20080508_bug8089-1.diff
- original code by otmar (license 480),
- revised by snuffy (license 35)
Tested by: oej, otmar, jtodd, Corydon76, snuffy, alexnikolov, bbryant
................
r115586 | bbryant | 2008-05-09 16:05:50 -0400 (Fri, 09 May 2008) | 2 lines
Update CHANGES file for previous commit of ENUM and TXCIDNAME changes.
................
r115588 | mmichelson | 2008-05-09 17:22:42 -0400 (Fri, 09 May 2008) | 19 lines
Adding support for "urgent" voicemail messages. Messages which are
marked "urgent" are considered to be higher priority than other messages
and so they will be played before any other messages in a user's mailbox.
There are two ways to leave an urgent message.
1. send the 'U' option to VoiceMail().
2. Set review=yes in voicemail.conf. This will give instructions for
a caller to mark a message as urgent after the message has been recorded.
I have tested that this works correctly with file and ODBC storage, and James
Rothenberger (who wrote initial support for this feature) has tested its use
with IMAP storage.
(closes issue #11817)
Reported by: jaroth
Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent
Tested by: putnopvut, jaroth
................
r115591 | mmichelson | 2008-05-09 18:36:50 -0400 (Fri, 09 May 2008) | 3 lines
Remove a debug line
................
r115593 | junky | 2008-05-09 23:04:25 -0400 (Fri, 09 May 2008) | 2 lines
since we unregister, that has not been properly registered, i standardized this.
................
r115594 | junky | 2008-05-09 23:28:50 -0400 (Fri, 09 May 2008) | 3 lines
ameliorate load and unload to dont use DECLINED or FAILED, when theres no .conf involved.
................
r115595 | junky | 2008-05-09 23:30:59 -0400 (Fri, 09 May 2008) | 3 lines
fix a sample since we now required , and not | for the arguments separator
................
r115596 | tilghman | 2008-05-10 10:19:41 -0400 (Sat, 10 May 2008) | 2 lines
Ensure that "calldate" is acceptable for a column name.
................
r115598 | mattf | 2008-05-10 22:19:21 -0400 (Sat, 10 May 2008) | 1 line
Open up audio channel when we get ACM on SS7 event
................
r115600 | mattf | 2008-05-10 23:23:05 -0400 (Sat, 10 May 2008) | 1 line
Add Zap MTP2 support to chan_zap
................
r115669 | bbryant | 2008-05-12 11:17:32 -0400 (Mon, 12 May 2008) | 3 lines
A small change to fix iax2 native bridging.
................
r115705 | qwell | 2008-05-12 12:35:50 -0400 (Mon, 12 May 2008) | 1 line
Correctly document state interface for AddQueueMember. Discovered while looking at issue #12626.
................
r115737 | mmichelson | 2008-05-12 13:55:08 -0400 (Mon, 12 May 2008) | 15 lines
Merged revisions 115735 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115735 | mmichelson | 2008-05-12 12:51:14 -0500 (Mon, 12 May 2008) | 7 lines
If a thread holds no locks, do not print any information on the thread when issuing
a core show locks command. This will help to de-clutter output somewhat.
Russell said it would be fine to place this improvement in the 1.4 branch, so that's
why it's going here too.
........
................
r115784 | oej | 2008-05-12 14:39:09 -0400 (Mon, 12 May 2008) | 4 lines
Add support for playing an audio file for caller and callee at start and stop of monitoring (one-touch monitor).
Keep messages short, since the other party is waiting while one party hear the message...
................
r115813 | tilghman | 2008-05-12 16:34:38 -0400 (Mon, 12 May 2008) | 8 lines
Add a script which installs every package needed for a Debian install of
Asterisk, and includes possible support (to be contributed) for various other
distributions.
(closes issue #10523)
Reported by: tzafrir
Patches:
install_prereq_2 uploaded by tzafrir (license 46)
................
Added:
team/seanbright/resolve-shadow-warnings/contrib/scripts/install_prereq
- copied unchanged from r115813, trunk/contrib/scripts/install_prereq
Removed:
team/seanbright/resolve-shadow-warnings/contrib/scripts/postgres_cdr.sql
Modified:
team/seanbright/resolve-shadow-warnings/ (props changed)
team/seanbright/resolve-shadow-warnings/CHANGES
team/seanbright/resolve-shadow-warnings/UPGRADE.txt
team/seanbright/resolve-shadow-warnings/apps/app_jack.c
team/seanbright/resolve-shadow-warnings/apps/app_queue.c
team/seanbright/resolve-shadow-warnings/apps/app_skel.c
team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c
team/seanbright/resolve-shadow-warnings/channels/chan_h323.c
team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
team/seanbright/resolve-shadow-warnings/channels/chan_skinny.c
team/seanbright/resolve-shadow-warnings/channels/chan_unistim.c
team/seanbright/resolve-shadow-warnings/channels/chan_zap.c
team/seanbright/resolve-shadow-warnings/configs/queues.conf.sample
team/seanbright/resolve-shadow-warnings/configs/voicemail.conf.sample
team/seanbright/resolve-shadow-warnings/configure
team/seanbright/resolve-shadow-warnings/configure.ac
team/seanbright/resolve-shadow-warnings/contrib/init.d/rc.debian.asterisk
team/seanbright/resolve-shadow-warnings/contrib/scripts/asterisk.ldap-schema
team/seanbright/resolve-shadow-warnings/contrib/scripts/asterisk.ldif
team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex
team/seanbright/resolve-shadow-warnings/funcs/func_enum.c
team/seanbright/resolve-shadow-warnings/funcs/func_speex.c
team/seanbright/resolve-shadow-warnings/include/asterisk/app.h
team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in
team/seanbright/resolve-shadow-warnings/include/asterisk/dlinkedlists.h (props changed)
team/seanbright/resolve-shadow-warnings/include/asterisk/enum.h
team/seanbright/resolve-shadow-warnings/main/app.c
team/seanbright/resolve-shadow-warnings/main/enum.c
team/seanbright/resolve-shadow-warnings/main/features.c
team/seanbright/resolve-shadow-warnings/main/manager.c
team/seanbright/resolve-shadow-warnings/main/pbx.c
team/seanbright/resolve-shadow-warnings/main/sched.c
team/seanbright/resolve-shadow-warnings/main/utils.c
team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c
team/seanbright/resolve-shadow-warnings/res/res_odbc.c
team/seanbright/resolve-shadow-warnings/sounds/Makefile
Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 13 09:49:20 2008
@@ -1,1 +1,1 @@
-/trunk:1-115503
+/trunk:1-115844
Modified: team/seanbright/resolve-shadow-warnings/CHANGES
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/CHANGES?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/CHANGES (original)
+++ team/seanbright/resolve-shadow-warnings/CHANGES Tue May 13 09:49:20 2008
@@ -42,6 +42,11 @@
quite helpful.
* Voicemail now permits a mailbox setting to wrap around from first to last
messages, if the "messagewrap" option is set to a true value.
+ * Voicemail now permits an external script to be run, for password validation.
+ The script should output "VALID" or "INVALID" on stdout, depending upon the
+ wish to validate or invalidate the password given. Arguments are:
+ "mailbox" "context" "oldpass" "newpass". See the sample voicemail.conf for
+ more details
* Dial has a new option: F(context^extension^pri), which permits a callee to
continue in the dialplan, at the specified label, if the caller hangs up.
* ChanSpy and ExtenSpy have a new option, 's' which suppresses speaking the
@@ -96,6 +101,12 @@
Dialplan function changes
-------------------------
* TIMEOUT() has been modified to be accurate down to the millisecond.
+ * ENUM*() functions now include the following new options:
+ - 'u' returns the full URI and does not strip off the URI-scheme.
+ - 's' triggers ISN specific rewriting
+ - 'i' looks for branches into an Infrastructure ENUM tree
+ - 'd' for a direct DNS lookup without any flipping of digits.
+ * TXCIDNAME() has a new zone-suffix parameter (which defaults to 'e164.arpa')
AMI - The manager (TCP/TLS/HTTP)
--------------------------------
@@ -406,6 +417,12 @@
voicemail boxes. The SMDI interface can also poll for MWI changes when some
outside entity is modifying the state of the mailbox (such as IMAP storage or
a web interface of some kind).
+ * Added the support for marking messages as "urgent." There are two methods to accomplish
+ this. One is to pass the 'U' option to VoiceMail(). Another way to mark a message as urgent
+ is to specify "review=yes" in voicemail.conf. Doing this will cause allow the user to mark
+ the message as urgent after he has recorded a voicemail by following the voice instructions.
+ When listening to voicemails using VoiceMailMain urgent messages will be presented before other
+ messages
Queue changes
-------------
Modified: team/seanbright/resolve-shadow-warnings/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/UPGRADE.txt?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/UPGRADE.txt (original)
+++ team/seanbright/resolve-shadow-warnings/UPGRADE.txt Tue May 13 09:49:20 2008
@@ -74,6 +74,8 @@
checking mailboxes for changes so that they can send MWI information to users.
Examples of situations that would require this option are web interfaces to
voicemail or an email client in the case of using IMAP storage.
+* The externnotify script should accept an additional (last) parameter
+ containing the string "URGENT" if there are new urgent messages in the INBOX.
Applications:
Modified: team/seanbright/resolve-shadow-warnings/apps/app_jack.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_jack.c?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_jack.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_jack.c Tue May 13 09:49:20 2008
@@ -977,15 +977,12 @@
static int load_module(void)
{
- if (ast_register_application(jack_app, jack_exec, jack_synopsis, jack_desc))
- return AST_MODULE_LOAD_DECLINE;
-
- if (ast_custom_function_register(&jack_hook_function)) {
- ast_unregister_application(jack_app);
- return AST_MODULE_LOAD_DECLINE;
- }
-
- return AST_MODULE_LOAD_SUCCESS;
+ int res = 0;
+
+ res |= ast_register_application(jack_app, jack_exec, jack_synopsis, jack_desc);
+ res |= ast_custom_function_register(&jack_hook_function);
+
+ return res;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "JACK Interface");
Modified: team/seanbright/resolve-shadow-warnings/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_queue.c?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_queue.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_queue.c Tue May 13 09:49:20 2008
@@ -199,7 +199,7 @@
static char *app_aqm = "AddQueueMember" ;
static char *app_aqm_synopsis = "Dynamically adds queue members" ;
static char *app_aqm_descrip =
-" AddQueueMember(queuename[,interface[,penalty[,options[,membername]]]]):\n"
+" AddQueueMember(queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]]):\n"
"Dynamically adds interface to an existing queue.\n"
"If the interface is already in the queue it will return an error.\n"
" This application sets the following channel variable upon completion:\n"
@@ -4239,7 +4239,7 @@
int penalty = 0;
if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[,[interface],[penalty][,options][,membername]])\n");
+ ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]])\n");
return -1;
}
Modified: team/seanbright/resolve-shadow-warnings/apps/app_skel.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_skel.c?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_skel.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_skel.c Tue May 13 09:49:20 2008
@@ -109,17 +109,12 @@
static int unload_module(void)
{
- int res;
- res = ast_unregister_application(app);
- return res;
+ return ast_unregister_application(app);
}
static int load_module(void)
{
- if (ast_register_application(app, app_exec, synopsis, descrip))
- return AST_MODULE_LOAD_DECLINE;
-
- return AST_MODULE_LOAD_SUCCESS;
+ return ast_register_application(app, app_exec, synopsis, descrip);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Application");
Modified: team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c?view=diff&rev=115845&r1=115844&r2=115845
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c Tue May 13 09:49:20 2008
@@ -155,11 +155,11 @@
static void get_mailbox_delimiter(MAILSTREAM *stream);
static void mm_parsequota (MAILSTREAM *stream, unsigned char *msg, QUOTALIST *pquota);
static void imap_mailbox_name(char *spec, size_t len, struct vm_state *vms, int box, int target);
-static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms, char *introfile);
+static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms, char *introfile, const char *flag);
static void update_messages_by_imapuser(const char *user, unsigned long number);
static int imap_remove_file (char *dir, int msgnum);
-static int imap_retrieve_file (char *dir, int msgnum, const char *mailbox, char *context);
+static int imap_retrieve_file (char *dir, int msgnum, const char *mailbox, const char *context);
static int imap_delete_old_greeting (char *dir, struct vm_state *vms);
static void check_quota(struct vm_state *vms, char *mailbox);
static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box);
@@ -201,6 +201,8 @@
#define MAXMSG 100
#define MAXMSGLIMIT 9999
+
+#define MINPASSWORD 0 /*!< Default minimum mailbox password length */
#define BASELINELEN 72
#define BASEMAXINLINE 256
@@ -228,7 +230,6 @@
#define VM_MOVEHEARD (1 << 16) /*!< Move a "heard" message to Old after listening to it */
#define VM_MESSAGEWRAP (1 << 17) /*!< Wrap around from the last message to the first, and vice-versa */
#define ERROR_LOCK_PATH -100
-#define ERROR_MAILBOX_FULL -200
enum {
@@ -248,6 +249,8 @@
OPT_PREPEND_MAILBOX = (1 << 4),
OPT_AUTOPLAY = (1 << 6),
OPT_DTMFEXIT = (1 << 7),
+ OPT_MESSAGE_Urgent = (1 << 8),
+ OPT_MESSAGE_PRIORITY = (1 << 9)
} vm_option_flags;
enum {
@@ -266,6 +269,8 @@
AST_APP_OPTION_ARG('d', OPT_DTMFEXIT, OPT_ARG_DTMFEXIT),
AST_APP_OPTION('p', OPT_PREPEND_MAILBOX),
AST_APP_OPTION_ARG('a', OPT_AUTOPLAY, OPT_ARG_PLAYFOLDER),
+ AST_APP_OPTION('U', OPT_MESSAGE_Urgent),
+ AST_APP_OPTION('P', OPT_MESSAGE_PRIORITY)
});
static int load_config(int reload);
@@ -422,6 +427,7 @@
int lastmsg;
int newmessages;
int oldmessages;
+ int urgentmessages;
int starting;
int repeats;
#ifdef IMAP_STORAGE
@@ -443,7 +449,7 @@
static char odbc_table[80];
#define RETRIEVE(a,b,c,d) retrieve_file(a,b)
#define DISPOSE(a,b) remove_file(a,b)
-#define STORE(a,b,c,d,e,f,g,h,i,j) store_file(a,b,c,d)
+#define STORE(a,b,c,d,e,f,g,h,i,j,k) store_file(a,b,c,d)
#define EXISTS(a,b,c,d) (message_exists(a,b))
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(a,b,c,d,e,f))
#define COPY(a,b,c,d,e,f,g,h) (copy_file(a,b,c,d,e,f))
@@ -452,8 +458,8 @@
#ifdef IMAP_STORAGE
#define RETRIEVE(a,b,c,d) (imap_retrieve_file(a,b,c,d ))
#define DISPOSE(a,b) (imap_remove_file(a,b))
-#define STORE(a,b,c,d,e,f,g,h,i,j) (imap_store_file(a,b,c,d,e,f,g,h,i,j))
-#define EXISTS(a,b,c,d) (ast_fileexists(c, NULL, d) > 0)
+#define STORE(a,b,c,d,e,f,g,h,i,j,k) (imap_store_file(a,b,c,d,e,f,g,h,i,j,k))
+#define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
#define COPY(a,b,c,d,e,f,g,h) (copy_file(g,h));
#define IMAP_DELETE(a,b,c,d) (vm_imap_delete(b,d))
@@ -461,10 +467,10 @@
#else
#define RETRIEVE(a,b,c,d)
#define DISPOSE(a,b)
-#define STORE(a,b,c,d,e,f,g,h,i,j)
-#define EXISTS(a,b,c,d) (ast_fileexists(c, NULL, d) > 0)
+#define STORE(a,b,c,d,e,f,g,h,i,j,k)
+#define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
-#define COPY(a,b,c,d,e,f,g,h) (copy_plain_file(g,h));
+#define COPY(a,b,c,d,e,f,g,h) (copy_plain_file(g,h));
#define DELETE(a,b,c) (vm_delete(c))
#endif
#endif
@@ -472,6 +478,7 @@
static char VM_SPOOL_DIR[PATH_MAX];
static char ext_pass_cmd[128];
+static char ext_pass_check_cmd[128];
int my_umask;
@@ -510,14 +517,16 @@
" application. The possible values are:\n"
" SUCCESS | USEREXIT | FAILED\n\n"
" Options:\n"
- " b - Play the 'busy' greeting to the calling party.\n"
+ " b - Play the 'busy' greeting to the calling party.\n"
" d([c]) - Accept digits for a new extension in context c, if played during\n"
" the greeting. Context defaults to the current context.\n"
- " g(#) - Use the specified amount of gain when recording the voicemail\n"
- " message. The units are whole-number decibels (dB).\n"
- " s - Skip the playback of instructions for leaving a message to the\n"
- " calling party.\n"
- " u - Play the 'unavailable' greeting.\n";
+ " g(#) - Use the specified amount of gain when recording the voicemail\n"
+ " message. The units are whole-number decibels (dB).\n"
+ " s - Skip the playback of instructions for leaving a message to the\n"
+ " calling party.\n"
+ " u - Play the 'unavailable' greeting.\n"
+ " U - Mark message as Urgent.\n"
+ " P - Mark message as PRIORITY.\n";
static char *synopsis_vmain = "Check Voicemail messages";
@@ -587,6 +596,7 @@
static int maxgreet;
static int skipms;
static int maxlogins;
+static int minpassword;
/*! Poll mailboxes for changes since there is something external to
* app_voicemail that may change them. */
@@ -616,6 +626,7 @@
*/
struct mwi_sub {
AST_RWLIST_ENTRY(mwi_sub) entry;
+ int old_urgent;
int old_new;
int old_old;
uint32_t uniqueid;
@@ -645,6 +656,7 @@
static char vm_passchanged[80] = "vm-passchanged";
static char vm_reenterpassword[80] = "vm-reenterpassword";
static char vm_mismatch[80] = "vm-mismatch";
+static char vm_invalid_password[80] = "vm-invalid-password";
static struct ast_flags globalflags = {0};
@@ -676,11 +688,11 @@
static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num, char *outgoing_context);
static int play_record_review(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime,
char *fmt, int outsidecaller, struct ast_vm_user *vmu, int *duration, const char *unlockdir,
- signed char record_gain, struct vm_state *vms);
+ signed char record_gain, struct vm_state *vms, char *flag);
static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain);
static int vm_play_folder_name(struct ast_channel *chan, char *mbox);
-static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname);
-static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap);
+static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname, const char *flag);
+static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag);
static void apply_options(struct ast_vm_user *vmu, const char *options);
static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format, char *attach, char *greeting_attachment, char *mailbox, char *bound, char *filename, int last, int msgnum);
static int is_valid_dtmf(const char *key);
@@ -748,33 +760,33 @@
#endif
} else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
ast_set2_flag(vmu, ast_true(value), VM_DELETE);
- } else if (!strcasecmp(var, "saycid")) {
+ } else if (!strcasecmp(var, "saycid")){
ast_set2_flag(vmu, ast_true(value), VM_SAYCID);
- } else if (!strcasecmp(var, "sendvoicemail")) {
+ } else if (!strcasecmp(var,"sendvoicemail")){
ast_set2_flag(vmu, ast_true(value), VM_SVMAIL);
- } else if (!strcasecmp(var, "review")) {
+ } else if (!strcasecmp(var, "review")){
ast_set2_flag(vmu, ast_true(value), VM_REVIEW);
- } else if (!strcasecmp(var, "tempgreetwarn")) {
+ } else if (!strcasecmp(var, "tempgreetwarn")){
ast_set2_flag(vmu, ast_true(value), VM_TEMPGREETWARN);
} else if (!strcasecmp(var, "messagewrap")){
ast_set2_flag(vmu, ast_true(value), VM_MESSAGEWRAP);
} else if (!strcasecmp(var, "operator")) {
ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);
- } else if (!strcasecmp(var, "envelope")) {
+ } else if (!strcasecmp(var, "envelope")){
ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);
- } else if (!strcasecmp(var, "moveheard")) {
+ } else if (!strcasecmp(var, "moveheard")){
ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
- } else if (!strcasecmp(var, "sayduration")) {
+ } else if (!strcasecmp(var, "sayduration")){
ast_set2_flag(vmu, ast_true(value), VM_SAYDURATION);
- } else if (!strcasecmp(var, "saydurationm")) {
+ } else if (!strcasecmp(var, "saydurationm")){
if (sscanf(value, "%d", &x) == 1) {
vmu->saydurationm = x;
} else {
ast_log(AST_LOG_WARNING, "Invalid min duration for say duration\n");
}
- } else if (!strcasecmp(var, "forcename")) {
+ } else if (!strcasecmp(var, "forcename")){
ast_set2_flag(vmu, ast_true(value), VM_FORCENAME);
- } else if (!strcasecmp(var, "forcegreetings")) {
+ } else if (!strcasecmp(var, "forcegreetings")){
ast_set2_flag(vmu, ast_true(value), VM_FORCEGREET);
} else if (!strcasecmp(var, "callback")) {
ast_copy_string(vmu->callback, value, sizeof(vmu->callback));
@@ -820,6 +832,85 @@
} else if (!strcasecmp(var, "options")) {
apply_options(vmu, value);
}
+}
+
+static char *vm_check_password_shell(char *command, char *buf, size_t len)
+{
+ int fds[2], pid = 0;
+
+ memset(buf, 0, len);
+
+ if (pipe(fds)) {
+ snprintf(buf, len, "FAILURE: Pipe failed: %s", strerror(errno));
+ } else {
+ /* good to go*/
+ pid = ast_safe_fork(0);
+
+ if (pid < 0) {
+ /* ok maybe not */
+ close(fds[0]);
+ close(fds[1]);
+ snprintf(buf, len, "FAILURE: Fork failed");
+ } else if (pid) {
+ /* parent */
+ close(fds[1]);
+ read(fds[0], buf, len);
+ close(fds[0]);
+ } else {
+ /* child */
+ AST_DECLARE_APP_ARGS(arg,
+ AST_APP_ARG(v)[20];
+ );
+ char *mycmd = ast_strdupa(command);
+
+ close(fds[0]);
+ dup2(fds[1], STDOUT_FILENO);
+ close(fds[1]);
+ ast_close_fds_above_n(STDOUT_FILENO);
+
+ AST_NONSTANDARD_APP_ARGS(arg, mycmd, ' ');
+
+ execv(arg.v[0], arg.v);
+ printf("FAILURE: %s", strerror(errno));
+ _exit(0);
+ }
+ }
+ return buf;
+}
+
+/*!
+ * \brief Check that password meets minimum required length
+ * \param vmu The voicemail user to change the password for.
+ * \param password The password string to check
+ *
+ * \return zero on ok, 1 on not ok.
+ */
+static int check_password(struct ast_vm_user *vmu, char *password)
+{
+ /* check minimum length */
+ if (strlen(password) < minpassword)
+ return 1;
+ if (!ast_strlen_zero(ext_pass_check_cmd)) {
+ char cmd[255], buf[255];
+
+ ast_log(LOG_DEBUG, "Verify password policies for %s\n", password);
+
+ snprintf(cmd, sizeof(cmd), "%s %s %s %s %s", ext_pass_check_cmd, vmu->mailbox, vmu->context, vmu->password, password);
+ if (vm_check_password_shell(cmd, buf, sizeof(buf))) {
+ ast_debug(5, "Result: %s\n", buf);
+ if (!strncasecmp(buf, "VALID", 5)) {
+ ast_debug(3, "Passed password check: '%s'\n", buf);
+ return 0;
+ } else if (!strncasecmp(buf, "FAILURE", 7)) {
+ ast_log(LOG_WARNING, "Unable to execute password validation script: '%s'.\n", buf);
+ return 0;
+ } else {
+ ast_log(LOG_NOTICE, "Password doesn't match policies for user %s %s\n", vmu->mailbox, password);
+ return 1;
+ }
+ }
+ }
+ return 0;
}
/*!
@@ -974,7 +1065,7 @@
static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *context, const char *mailbox)
{
/* This function could be made to generate one from a database, too */
- struct ast_vm_user *vmu = NULL, *cur;
+ struct ast_vm_user *vmu=NULL, *cur;
AST_LIST_LOCK(&users);
if (!context && !ast_test_flag((&globalflags), VM_SEARCH))
@@ -1037,11 +1128,11 @@
*/
static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
{
- struct ast_config *cfg = NULL;
- struct ast_variable *var = NULL;
- struct ast_category *cat = NULL;
- char *category = NULL, *value = NULL, *new = NULL;
- const char *tmp = NULL;
+ struct ast_config *cfg=NULL;
+ struct ast_variable *var=NULL;
+ struct ast_category *cat=NULL;
+ char *category=NULL, *value=NULL, *new=NULL;
+ const char *tmp=NULL;
struct ast_flags config_flags = { CONFIG_FLAG_WITHCOMMENTS };
if (!change_password_realtime(vmu, newpassword))
return;
@@ -1054,13 +1145,13 @@
ast_log(AST_LOG_WARNING, "We could not find the mailbox.\n");
break;
}
- value = strstr(tmp, ",");
+ value = strstr(tmp,",");
if (!value) {
ast_log(AST_LOG_WARNING, "variable has bad format.\n");
break;
}
- new = alloca(strlen(value) + strlen(newpassword) + 1);
- sprintf(new, "%s%s", newpassword, value);
+ new = alloca((strlen(value)+strlen(newpassword)+1));
+ sprintf(new,"%s%s", newpassword, value);
if (!(cat = ast_category_get(cfg, category))) {
ast_log(AST_LOG_WARNING, "Failed to get category structure.\n");
break;
@@ -1086,7 +1177,7 @@
ast_debug(3, "looks like we need to make vmsecret!\n");
var = ast_variable_new("vmsecret", newpassword, "");
}
- new = alloca(strlen(newpassword) + 1);
+ new = alloca(strlen(newpassword)+1);
sprintf(new, "%s", newpassword);
if (!(cat = ast_category_get(cfg, category))) {
ast_debug(4, "failed to get category!\n");
@@ -1108,7 +1199,7 @@
static void vm_change_password_shell(struct ast_vm_user *vmu, char *newpassword)
{
char buf[255];
- snprintf(buf, sizeof(buf), "%s %s %s %s", ext_pass_cmd, vmu->context, vmu->mailbox, newpassword);
+ snprintf(buf,255,"%s %s %s %s",ext_pass_cmd,vmu->context,vmu->mailbox,newpassword);
if (!ast_safe_system(buf)) {
ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
/* Reset the password in memory, too */
@@ -1155,10 +1246,10 @@
ast_log(AST_LOG_WARNING, "msgnum %d, mailbox message %lu is zero.\n", msgnum, messageNum);
return;
}
- ast_debug(3, "deleting msgnum %d, which is mailbox message %lu\n", msgnum, messageNum);
+ ast_debug(3, "deleting msgnum %d, which is mailbox message %lu\n",msgnum,messageNum);
/* delete message */
- snprintf(arg, sizeof(arg), "%lu", messageNum);
- mail_setflag(vms->mailstream, arg, "\\DELETED");
+ snprintf (arg, sizeof(arg), "%lu",messageNum);
+ mail_setflag (vms->mailstream,arg,"\\DELETED");
}
#endif
@@ -1251,13 +1342,13 @@
{
int x = 0;
int res;
- int fd = -1;
+ int fd=-1;
size_t fdlen = 0;
void *fdm = MAP_FAILED;
- SQLSMALLINT colcount = 0;
+ SQLSMALLINT colcount=0;
SQLHSTMT stmt;
char sql[PATH_MAX];
- char fmt[80] = "";
+ char fmt[80]="";
char *c;
char coltitle[256];
SQLSMALLINT collen;
@@ -1266,7 +1357,7 @@
SQLSMALLINT nullable;
SQLULEN colsize;
SQLLEN colsize2;
- FILE *f = NULL;
+ FILE *f=NULL;
char rowdata[80];
char fn[PATH_MAX];
char full_fn[PATH_MAX];
@@ -1283,8 +1374,7 @@
*c = '\0';
if (!strcasecmp(fmt, "wav49"))
strcpy(fmt, "WAV");
-
- snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
+ snprintf(msgnums, sizeof(msgnums),"%d", msgnum);
if (msgnum > -1)
make_file(fn, sizeof(fn), dir, msgnum);
else
@@ -1299,7 +1389,7 @@
}
snprintf(full_fn, sizeof(full_fn), "%s.%s", fn, fmt);
- snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE dir=? AND msgnum=?", odbc_table);
+ snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE dir=? AND msgnum=?",odbc_table);
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
if (!stmt) {
[... 7235 lines stripped ...]
More information about the svn-commits
mailing list