?? imapstorage.tex
字號:
By enabling IMAP Storage, Asterisk will use native IMAP as the storagemechanism for voicemail messages instead of using the standard file structure.Tighter integration of Asterisk voicemail and IMAP email services allowsadditional voicemail functionality, including:\begin{itemize} \item Listening to a voicemail on the phone will set its state to "read" in a user's mailbox automatically. \item Deleting a voicemail on the phone will delete it from the user's mailbox automatically. \item Accessing a voicemail recording email message will turn off the message waiting indicator (MWI) on the user's phone. \item Deleting a voicemail recording email will also turn off the message waiting indicator, and delete the message from the voicemail system.\end{itemize}\subsection{Installation Notes}\subsubsection{University of Washington IMAP C-Client}If you do not have the University of Washington's IMAP c-clientinstalled on your system, you will need to download the c-clientsource distribution (\url{http://www.washington.edu/imap/}) and compile it.Asterisk supports both the 2004 and 2006 versions of c-client, howevermail\_expunge\_full is enabled in the 2006 version.Note that Asterisk only uses the 'c-client' portion of the UW IMAP toolkit,but building it also builds an IMAP server and various other utilities.Because of this, the build instructions for the IMAP toolkit are somewhatcomplicated and can lead to confusion about what is needed.If you are going to be connecting Asterisk to an existing IMAP server,then you don't need to care about the server or utilities in the IMAPtoolkit at all. If you want to also install the UW IMAPD server, thatis outside the scope of this document.Building the c-client library is fairly straightforward; for example, on aDebian system there are two possibilities:\begin{enumerate} \item If you will not be using SSL to connect to the IMAP server: \begin{verbatim} $ make slx SSLTYPE=none! \end{verbatim} \item If you will be using SSL to connect to the IMAP server: \begin{verbatim} $ make slx EXTRACFLAGS="-I/usr/include/openssl" \end{verbatim}\end{enumerate}Once this completes you can proceed with the Asterisk build; there is noneed to run 'make install'.\subsubsection{Compiling Asterisk}Configure with ./configure --with-imap=/usr/src/imapor where ever you built thfe UWashington IMAP Toolkit. This directorywill be searched for a source installation. If no source installation isfound there, then a package installation of the IMAP c-client will be searched for in this directory. If one is not found, then configure will fail.A second configure option is to not specify a directory (i.e../configure --with-imap). This will assume that you have theimap-2004g source installed in the .. directory relative to theAsterisk source. If you do not have this source, then configure willdefault to the "system" option defined in the next paragraphA third option is ./configure --with-imap=system. This will assumethat you have installed a dynamically linked version of the c-clientlibrary (most likely via a package provided by your distro). This willattempt to link agains -lc-client and will search for c-client headersin your include path starting with the imap directory, and upon failure,in the c-client directory.When you run 'make menuselect', choose 'Voicemail Build Options' and theIMAP\_STORAGE option should be available for selection.After selecting the IMAP\_STORAGE option, use the 'x' key to exitmenuselect and save your changes, and the build/install Asterisknormally.\subsection{Modify voicemail.conf}The following directives have been added to voicemail.conf:\begin{astlisting}\begin{verbatim}imapserver=<name or IP address of IMAP mail server>imapport=<IMAP port, defaults to 143>imapflags=<IMAP flags, "novalidate-cert" for example>imapfolder=<IMAP folder to store messages to>imapgreetings=<yes or no>greetingsfolder=<IMAP folder to store greetings in if imapgreetings is enabled>expungeonhangup=<yes or no>authuser=<username>authpassword=<password>opentimeout=<TCP open timeout in seconds>closetimeout=<TCP close timeout in seconds>readtimeout=<TCP read timeout in seconds>writetimeout=<TCP write timeout in seconds>\end{verbatim}\end{astlisting}The "imapfolder" can be used to specify an alternative folder on your IMAP serverto store voicemails in. If not specified, the default folder 'INBOX' will be used.The "imapgreetings" parameter can be enabled in order to store voicemail greetingson the IMAP server. If disabled, then they will be stored on the local file systemas normal.The "greetingsfolder" can be set to store greetings on the IMAP server when"imapgreetings" is enabled in an alternative folder than that set by "imapfolder"or the default folder for voicemails.The "expungeonhangup" flag is used to determine if the voicemail system shouldexpunge all messages marked for deletion when the user hangs up the phone.Each mailbox definition should also have imapuser=$<$imap username$>$.For example:\begin{astlisting}\begin{verbatim}4123=>4123,James Rothenberger,jar@onebiztone.com,,attach=yes|imapuser=jar\end{verbatim}\end{astlisting}The directives "authuser" and "authpassword" are not needed when usingKerberos. They are defined to allow Asterisk to authenticate as a singleuser that has access to all mailboxes as an alternative to Kerberos.\subsection{IMAP Folders}Besides INBOX, users should create "Old", "Work", "Family" and "Friends"IMAP folders at the same level of hierarchy as the INBOX. These will beused as alternate folders for storing voicemail messages to mimic thebehavior of the current (file-based) voicemail system.\subsection{Separate vs. Shared Email Accounts}As administrator you will have to decide if you want to send the voicemailmessages to a separate IMAP account or use each user's existing IMAP mailboxfor voicemail storage. The IMAP storage mechanism will work either way.By implementing a single IMAP mailbox, the user will see voicemail messagesappear in the same INBOX as other messages. The disadvantage of this methodis that if the IMAP server does NOT support UIDPLUS, Asterisk voicemail willexpunge ALL messages marked for deletion when the user exits the voicemailsystem, not just the VOICEMAIL messages marked for deletion.By implementing separate IMAP mailboxes for voicemail and email, voicemailexpunges will not remove regular email flagged for deletion.\subsection{IMAP Server Implementations}There are various IMAP server implementations, each supports a potentiallydifferent set of features.\subsubsection{UW IMAP-2005 or earlier}UIDPLUS is currently NOT supported on these versions of UW-IMAP. Please notethat without UID\_EXPUNGE, Asterisk voicemail will expunge ALL messages markedfor deletion when a user exits the voicemail system (hangs up the phone).\subsubsection{UW IMAP-2006 Development Branch}This version supports UIDPLUS, which allows UID\_EXPUNGE capabilities. Thisfeature allow the system to expunge ONLY pertinent messages, instead of thedefault behavior, which is to expunge ALL messages marked for deletion whenEXPUNGE is called. The IMAP storage mechanism is this version of Asteriskwill check if the UID\_EXPUNGE feature is supported by the server, and use itif possible.\subsubsection{Cyrus IMAP}Cyrus IMAP server v2.3.3 has been tested using a hierarchy delimiter of '/'.\subsection{Quota Support}If the IMAP server supports quotas, Asterisk will check the quota whenaccessing voicemail. Currently only a warning is given to the user thattheir quota is exceeded.\subsection{Application Notes}Since the primary storage mechanism is IMAP, all message information thatwas previously stored in an associated text file, AND the recording itself,is now stored in a single email message. This means that the .gsm recordingwill ALWAYS be attached to the message (along with the user's preference ofrecording format if different - ie. .WAV). The voicemail message informationis stored in the email message headers. These headers include:\begin{verbatim}X-Asterisk-VM-Message-NumX-Asterisk-VM-Server-NameX-Asterisk-VM-ContextX-Asterisk-VM-ExtensionX-Asterisk-VM-PriorityX-Asterisk-VM-Caller-channelX-Asterisk-VM-Caller-ID-NumX-Asterisk-VM-Caller-ID-NameX-Asterisk-VM-DurationX-Asterisk-VM-CategoryX-Asterisk-VM-Orig-dateX-Asterisk-VM-Orig-time\end{verbatim}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -