44c4186d227074d68b30863d57bb2ceb1b376ef7
[asterisk/asterisk.git] / include / asterisk / app.h
1 /*
2  * Asterisk -- A telephony toolkit for Linux.
3  *
4  * Application convenience functions, designed to give consistent
5  * look and feel to asterisk apps.
6  * 
7  * Copyright (C) 1999, Mark Spencer
8  *
9  * Mark Spencer <markster@linux-support.net>
10  *
11  * This program is free software, distributed under the terms of
12  * the GNU General Public License
13  */
14
15 #ifndef _ASTERISK_APP_H
16 #define _ASTERISK_APP_H
17
18 #if defined(__cplusplus) || defined(c_plusplus)
19 extern "C" {
20 #endif
21 //! Plays a stream and gets DTMF data from a channel
22 /*!
23  * \param c Which channel one is interacting with
24  * \param prompt File to pass to ast_streamfile (the one that you wish to play)
25  * \param s The location where the DTMF data will be stored
26  * \param maxlen Max Length of the data
27  * \param timeout Timeout length waiting for data(in milliseconds).  Set to 0 for standard timeout(six seconds), or -1 for no time out.
28  *
29  *  This function was designed for application programmers for situations where they need 
30  *  to play a message and then get some DTMF data in response to the message.  If a digit 
31  *  is pressed during playback, it will immediately break out of the message and continue
32  *  execution of your code.
33  */
34 extern int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout);
35
36 //! Record voice (after playing prompt if specified), waiting for silence (in ms) up to a given timeout (in s) or '#'
37 int ast_app_getvoice(struct ast_channel *c, char *dest, char *dstfmt, char *prompt, int silence, int maxsec);
38
39 //! Determine if a given mailbox has any voicemail
40 extern int ast_app_has_voicemail(char *mailbox);
41
42 #if defined(__cplusplus) || defined(c_plusplus)
43 }
44 #endif
45
46 #endif