Newer
Older
* Asterisk -- An open source telephony toolkit.
* Copyright (C) 1999 - 2006, Digium, Inc.
* Mark Spencer <markster@digium.com>
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*!
* \file
* \author Mark Spencer <markster@digium.com>
* \brief Comedian Mail - Voicemail System
* unixODBC (http://www.unixodbc.org/)
* A source distribution of University of Washington's IMAP c-client
* (http://www.washington.edu/imap/)
* \note For information about voicemail IMAP storage, https://wiki.asterisk.org/wiki/display/AST/IMAP+Voicemail+Storage
* \todo This module requires res_adsi to load. This needs to be optional
* \todo This file is now almost impossible to work with, due to all \#ifdefs.
* Feels like the database code before realtime. Someone - please come up
* with a plan to clean this up.
/*! \li \ref app_voicemail.c uses configuration file \ref voicemail.conf
* \addtogroup configuration_file Configuration Files
*/
* \page voicemail.conf voicemail.conf
* \verbinclude voicemail.conf.sample
*/
Sean Bright
committed
#include "asterisk.h"
#ifdef IMAP_STORAGE
#include <ctype.h>
#include <signal.h>
#include <pwd.h>
Russell Bryant
committed
#ifdef USE_SYSTEM_IMAP
#include <imap/c-client.h>
#include <imap/imap4r1.h>
#include <imap/linkage.h>
#elif defined (USE_SYSTEM_CCLIENT)
#include <c-client/c-client.h>
#include <c-client/imap4r1.h>
#include <c-client/linkage.h>
Russell Bryant
committed
#else
#include "c-client.h"
#include "imap4r1.h"
#include "linkage.h"
#endif
Russell Bryant
committed
#endif
Mark Michelson
committed
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <time.h>
#include <dirent.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/wait.h>
#endif
Mark Michelson
committed
Sean Bright
committed
#include "asterisk/logger.h"
Kevin P. Fleming
committed
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/config.h"
#include "asterisk/say.h"
#include "asterisk/module.h"
#include "asterisk/adsi.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
Kevin P. Fleming
committed
#include "asterisk/manager.h"
#include "asterisk/dsp.h"
#include "asterisk/localtime.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"
#include "asterisk/strings.h"
Matthew Fredrickson
committed
#include "asterisk/smdi.h"
#include "asterisk/astobj2.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/test.h"
#include "asterisk/format_cache.h"
Russell Bryant
committed
#ifdef ODBC_STORAGE
Kevin P. Fleming
committed
#include "asterisk/res_odbc.h"
#ifdef IMAP_STORAGE
#include "asterisk/threadstorage.h"
#endif
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*** DOCUMENTATION
<application name="VoiceMail" language="en_US">
<synopsis>
Leave a Voicemail message.
</synopsis>
<syntax>
<parameter name="mailboxs" argsep="&" required="true">
<argument name="mailbox1" argsep="@" required="true">
<argument name="mailbox" required="true" />
<argument name="context" />
</argument>
<argument name="mailbox2" argsep="@" multiple="true">
<argument name="mailbox" required="true" />
<argument name="context" />
</argument>
</parameter>
<parameter name="options">
<optionlist>
<option name="b">
<para>Play the <literal>busy</literal> greeting to the calling party.</para>
</option>
<option name="d">
<argument name="c" />
<para>Accept digits for a new extension in context <replaceable>c</replaceable>,
if played during the greeting. Context defaults to the current context.</para>
</option>
<option name="g">
<argument name="#" required="true" />
<para>Use the specified amount of gain when recording the voicemail
message. The units are whole-number decibels (dB). Only works on supported
technologies, which is DAHDI only.</para>
</option>
<option name="s">
<para>Skip the playback of instructions for leaving a message to the
calling party.</para>
</option>
<option name="u">
<para>Play the <literal>unavailable</literal> greeting.</para>
</option>
<option name="U">
<para>Mark message as <literal>URGENT</literal>.</para>
</option>
<option name="P">
<para>Mark message as <literal>PRIORITY</literal>.</para>
</option>
</optionlist>
</parameter>
</syntax>
<description>
<para>This application allows the calling party to leave a message for the specified
list of mailboxes. When multiple mailboxes are specified, the greeting will be taken from
the first mailbox specified. Dialplan execution will stop if the specified mailbox does not
exist.</para>
<para>The Voicemail application will exit if any of the following DTMF digits are received:</para>
<enumlist>
<enum name="0">
<para>Jump to the <literal>o</literal> extension in the current dialplan context.</para>
</enum>
<enum name="*">
<para>Jump to the <literal>a</literal> extension in the current dialplan context.</para>
</enum>
</enumlist>
<para>This application will set the following channel variable upon completion:</para>
<variablelist>
<variable name="VMSTATUS">
<para>This indicates the status of the execution of the VoiceMail application.</para>
<value name="SUCCESS" />
<value name="USEREXIT" />
<value name="FAILED" />
</variable>
</variablelist>
</description>
<see-also>
<ref type="application">VoiceMailMain</ref>
</see-also>
</application>
<application name="VoiceMailMain" language="en_US">
<synopsis>
Check Voicemail messages.
</synopsis>
<syntax>
<parameter name="mailbox" required="true" argsep="@">
<argument name="mailbox" />
<argument name="context" />
</parameter>
<parameter name="options">
<optionlist>
<option name="p">
<para>Consider the <replaceable>mailbox</replaceable> parameter as a prefix to
Loading
Loading full blame...