Most app_voicemail unit tests were not properly cleaning up
after themselves after running. This led to test mailboxes
lingering around in the system. It also meant that if any
unit tests in app_voicemail that create mailboxes were executed
and the module was not unloaded/loaded again prior to running
the test_voicemail_vm_info unit test, Asterisk would segfault
due to an attempt to copy a NULL string.
The load_config test did actually have logic to reinitialize
the config after the test. However, this did not work in practice
since load_config() would not reload the config since voicemail.conf
had not changed during the test; thus, additional logic has been
added to ensure that voicemail.conf is truly reloaded, after any
unit tests which modify the users list.
This prevents the SEGV due to invalid mailboxes lingering around,
and also ensures that the system state is restored to what it was
prior to the tests running.
Resolves: #629
This adds an option to allow preventing callers from leaving
messages marked as 'urgent'.
Resolves: #619
UserNote: The leaveurgent mailbox option can now be used to
control whether callers may leave messages marked as 'Urgent'.
When app_macro was deprecated, the macrocontext column was removed from
the INSERT statement but the binds were not renumbered. This broke the
insert.
This change removes the macrocontext column via alembic and re-numbers
the existing columns in the INSERT.
Fixes: #527
UserNote: The fix requires removing the macrocontext column from the
voicemail_messages table in the voicemail database via alembic upgrade.
UpgradeNote: The fix requires that the voicemail database be upgraded via
alembic. Upgrading to the latest voicemail database via alembic will
remove the macrocontext column from the voicemail_messages table.
This fixes a number of broken links throughout the
tree, mostly caused by wiki.asterisk.org being replaced
with docs.asterisk.org, which should eliminate the
need for sporadic fixes as in f28047db36.
Resolves: #430
Resequencing is a process that occurs when we open a voicemail folder
and discover that there are gaps between messages (e.g. `msg0000.txt`
is missing but `msg0001.txt` exists). Resequencing involves shifting
the existing messages down so we end up with a sequential list of
messages.
Currently, this process stops after reaching a threshold based on the
message limit (`maxmsg`) configured on the current folder. However, if
`maxmsg` is lowered when a voicemail folder contains more than
`maxmsg + 10` messages, resequencing will not run completely leaving
the mailbox in an inconsistent state.
We now resequence up to the maximum number of messages permitted by
`app_voicemail` (currently hard-coded at 9999 messages).
Fixes#86
This adds an AMI event that is emitted whenever a
mailbox password is successfully changed, allowing
AMI consumers to process these.
UserNote: The VoicemailPasswordChange event is
now emitted whenever a mailbox password is updated,
containing the mailbox information and the new
password.
Resolves: #398
If ADSI is available on a channel, app_voicemail will repeatedly
try to use ADSI, even if there is no CPE that supports it. This
leads to many unnecessary delays during the session. If ADSI is
available but ADSI setup fails, we now disable it to prevent
further attempts to use ADSI during the session.
Resolves: #354
in a particular mailbox folder. The forward command can be used
to copy a message within a mailbox or to another mailbox. Also adds
a VoicemailBoxSummarry, required to retrieve message ID's.
Resolves: #181
UserNote: The following manager actions have been added
VoicemailBoxSummary - Generate message list for a given mailbox
VoicemailRemove - Remove a message from a mailbox folder
VoicemailMove - Move a message from one folder to another within a mailbox
VoicemailForward - Copy a message from one folder in one mailbox
to another folder in another or the same mailbox.
Adds CLI commands to allow move/remove/forward individual messages
from a particular mailbox folder. The forward command can be used
to copy a message within a mailbox or to another mailbox. Also adds
a show mailbox, required to retrieve message ID's.
Resolves: #170
UserNote: The following CLI commands have been added to app_voicemail
voicemail show mailbox <mailbox> <context>
Show contents of mailbox <mailbox>@<context>
voicemail remove <mailbox> <context> <from_folder> <messageid>
Remove message <messageid> from <from_folder> in mailbox <mailbox>@<context>
voicemail move <mailbox> <context> <from_folder> <messageid> <to_folder>
Move message <messageid> in mailbox <mailbox>&<context> from <from_folder> to <to_folder>
voicemail forward <from_mailbox> <from_context> <from_folder> <messageid> <to_mailbox> <to_context> <to_folder>
Forward message <messageid> in mailbox <mailbox>@<context> <from_folder> to
mailbox <mailbox>@<context> <to_folder>
Fixes two compilation errors in app_voicemail_imap, one due to an unsed
variable and one due to a new variable added in the incorrect location
in _163.
Resolves: #174
Some callers of __messagecount did not correctly handle error return,
instead returning a -1 message count.
This caused a notification with "Messages-Waiting: yes" and
"Voice-Message: -1/0 (0/0)" if the IMAP server was unavailable.
Fixes: #64
For most modules that interacted with app_macro, this change is limited
to no longer looking for the current context from the macrocontext when
set. Additionally, the following modules are impacted:
app_dial - no longer supports M^ connected/redirecting macro
app_minivm - samples written using macro will no longer work.
The sample needs a re-write
app_queue - can no longer a macro on the called party's channel.
Use gosub which is currently supported
ccss - no callback macro, gosub only
app_voicemail - no macro support
channel - remove macrocontext and priority, no connected line or
redirection macro options
options - stdexten is deprecated to gosub as the default and only
pbx - removed macrolock
pbx_dundi - no longer look for macro
snmp - removed macro context, exten, and priority
ASTERISK-30304
Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6
Fixes a negative offset warning by initializing
the buffer to empty.
Additionally, although it doesn't currently complain
about it, the size of a buffer is increased to
accomodate the maximum size contents it could have.
ASTERISK-30240 #close
Change-Id: I8eecedf14d3f2a75864797f802277cac89a32877
msg_create_from_file currently does not dispatch emails,
which means that applications using this function, such
as MixMonitor, will not trigger notifications to users
(only AMI events are sent our currently). This is inconsistent
with other ways users can receive voicemail.
This is fixed by adding an option that attempts to send
an email and falling back to just the notifications as
done now if that fails. The existing behavior remains
the default.
ASTERISK-30283 #close
Change-Id: I597cbb9cf971a18d8776172b26ab187dc096a5c7
Adjusts some logging levels to be more or less important,
that is more prominent when actual problems occur and less
prominent for less noteworthy things.
ASTERISK-30153 #close
Change-Id: Ifc8f7df427aa018627db462125ae744986d3261b
Adds an option to VoiceMailMain that prevents the user
from deleting messages during that application invocation.
This can be useful for public or shared mailboxes, where
some users should be able to listen to messages but not
delete them.
ASTERISK-30063 #close
Change-Id: Icdfb8423ae8d1fce65a056b603eb84a672e80a26
Currently, if VoiceMailMain is called with a mailbox, if that
mailbox doesn't exist, then the application silently falls back
to prompting the user for the mailbox, as if no arguments were
provided.
However, if a specific mailbox is requested and it doesn't exist,
then no warning at all is emitted.
This fixes this behavior to now warn if a specifically
requested mailbox could not be accessed, before falling back to
prompting the user for the correct mailbox.
ASTERISK-29920 #close
Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4
added support for playing the correct plural sound file
dependen on where you have 1 or multipe messages
based on the existing SE/NO code
ASTERISK-29797
Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2
Refactors generic functions used for email generation
into utils.c so that they can be used by multiple
modules, including app_voicemail and app_minivm,
to avoid code duplication.
ASTERISK-29715 #close
Change-Id: I1de0ed3483623e9599711129edc817c45ad237ee
If users are able to press # for options while leaving
a message and then press 3 to rerecord the message, if
the caller hangs up during the rerecord prompt but before
Asterisk starts recording a message, then an "empty"
voicemail gets processed whereby an email gets sent out
notifying the user of a 0:00 duration message. The file
doesn't actually exist, so playback will fail since there
was no message to begin with.
This adds a check after the streaming of the rerecord
announcement to see if the caller has hung up. If so,
we bail out early so that we can clean up properly.
ASTERISK-29391 #close
Change-Id: Id965d72759a2fd3b39afb76fec08aaebebe75c31
There is an option to silence voicemail instructions but it does not
take into consideration if a recorded greeting exists or not. Add a
new 'S' option that does that.
ASTERISK-29632 #close
Change-Id: I03f2f043a9beb9d99deab302247e2a8686066fb4
Hitherto, VoiceMail() played a non-customizable beep tone to indicate
the caller could leave a message. In some cases, the beep may not
be desired, or a different tone may be desired.
To increase flexibility, a new option allows customization of the tone.
If the t option is specified, the default beep will be overridden.
Supplying an argument will cause it to use the specified file for the tone,
and omitting it will cause it to skip the beep altogether. If the option
is not used, the default behavior persists.
ASTERISK-29349
Change-Id: I1c439c0011497e28a28067fc1cf1e654c8843280
When using this option, answering the channel is deferred until
all prompts/greetings have been played and the caller is about
to leave their message.
ASTERISK-29118 #close
Change-Id: I41b9f0428783c0bd697c8c994f906d1e75ce9ddb
Rather than putting messages into INBOX and then moving them to Urgent
later, put them directly in to the Urgent folder. This prevents
mailcmd from being skipped.
ASTERISK-27273 #close
Change-Id: I49934e093290d308506ab8d45a40ef705c5ae4f5
This patch fixes a few compile warnings/errors that now occur when using gcc
10+.
Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.
Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
The gcc 10 -Wrestrict option was causing "overlap" errors when
snprintf was copying one char[256] structure member to another
char[256] member in the same structure.
Using ast_alloca instead of declaring the structure inline
solves the issue.
Here's a link to the "enhancement":
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html
We may follow up with a gcc bug report.
Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534
* The MailboxExists dialplan application was deprecated on 2006-09-26
in Asterisk 1.6.0 (commit ec83b11183)
* The MAILBOX_EXISTS dialplan function was deprecated on 2011-12-06 in
Asterisk 11.0.0 (commit fd64bb66f9)
Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f
In af90afd90c, Japanese language support
was added to app_voicemail and main/say.c, but the leading whitespace
is not consistent with Asterisk coding guidelines. This patch fixes
that.
Whitespace only, no functional change.
ASTERISK~23324
Reported by: Kevin McCoy
Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87
ast_store_realtime() is not NULL tolerant, so we need to initialize
the field values we pass to it to the empty string to avoid a crash.
ASTERISK-23739 #close
Reported by: Stas Kobzar
Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
If voicemail.conf exists but is empty, the config parsing process will
default a number of global variables to non-zero values. On the other
hand, if voicemail.conf is missing (arguably semantically equivalent
to an empty file), this process is skipped and the globals are
defaulted to 0.
Set the globals to the same values they would be set to if a
configuration were present. This allows voicemail configuration to be
done completely by Realtime without the need to create an empty
voicemail.conf file.
ASTERISK-27622 #close
Reported by: Jim Van Meggelen
Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409
This patch fixes several issues reported by the lgtm code analysis tool:
https://lgtm.com/projects/g/asterisk/asterisk
Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:
* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards
Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav"
and are using realtime ODBC backend, only the first format gets stored
in the database. So when you forward a message later on, there is a bug
generating the email, related to the stored format (GSM) being different
than the desired email format (WAV) specified for the user. Sox can
handle this, but Asterisk needs to tell sox exactly what to do.
ASTERISK-22192
Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd
This reverts commit fd2e8d0da7.
Reason for revert: Problematic for users who store their voicemail
on network storage devices, or share voicemail storage between
multiple Asterisk instances.
ASTERISK-28567 #close
Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41
The function leave_voicemail checks if expungeonhangup is set,
but does not check if IMAP stream is closed,
so it could call imap function with NULL stream.
This leads to segfault.
ASTERISK-28505 #close
Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c
You now select voicemail backends like normal dialplan applications, so
there is no longer a need for their own menuselect category.
Reported by snuff-work in #asterisk-dev
Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005
app_voicemail utilized the stasis cache when polling mailboxes for MWI. This
caused a memory leak (items were not being appropriately removed from the
cache), and subsequent slowdown in system processing. This patch removes the
stasis cache dependency, thus alleviating the memory leak. It does this by
utilizing the new MWI API that better manages state lifetime.
ASTERISK-28443
ASTERISK-27121
Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46
There is enough MWI functionality to warrant it having its own 'c' and header
files. This patch moves all current core MWI data structures, and functions
into the following files:
main/mwi.h
main/mwi.c
Note, code was simply moved, and not modified. However, this patch is also in
preparation for core MWI changes, and additions to come.
Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0
Because the per-mailbox options are the last thing on a line, don't look
for or stomp on any subsequent commas.
ASTERISK-27935 #close
Reported by: Sébastien Duthil
Change-Id: I07b2eb4a33c303d0c7114d5b906f8c067c60a153