Wed Apr 6 11:29:46 2011

Asterisk developer's documentation


monitor.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Channel monitoring
00021  */
00022 
00023 #ifndef _ASTERISK_MONITOR_H
00024 #define _ASTERISK_MONITOR_H
00025 
00026 #include "asterisk/channel.h"
00027 #include "asterisk/optional_api.h"
00028 
00029 enum AST_MONITORING_STATE {
00030    AST_MONITOR_RUNNING,
00031    AST_MONITOR_PAUSED
00032 };
00033 
00034 /* Streams recording control */
00035 #define X_REC_IN  1
00036 #define X_REC_OUT 2
00037 #define X_JOIN    4
00038 
00039 /*! Responsible for channel monitoring data */
00040 struct ast_channel_monitor {
00041    struct ast_filestream *read_stream;
00042    struct ast_filestream *write_stream;
00043    char read_filename[FILENAME_MAX];
00044    char write_filename[FILENAME_MAX];
00045    char filename_base[FILENAME_MAX];
00046    int filename_changed;
00047    char *format;
00048    int joinfiles;
00049    enum AST_MONITORING_STATE state;
00050    int (*stop)(struct ast_channel *chan, int need_lock);
00051 };
00052 
00053 /* Start monitoring a channel */
00054 AST_OPTIONAL_API(int, ast_monitor_start,
00055        (struct ast_channel *chan, const char *format_spec,
00056         const char *fname_base, int need_lock, int stream_action),
00057        { return -1; });
00058 
00059 /* Stop monitoring a channel */
00060 AST_OPTIONAL_API(int, ast_monitor_stop,
00061        (struct ast_channel *chan, int need_lock),
00062        { return -1; });
00063 
00064 /* Change monitoring filename of a channel */
00065 AST_OPTIONAL_API(int, ast_monitor_change_fname,
00066        (struct ast_channel *chan, const char *fname_base,
00067         int need_lock),
00068        { return -1; });
00069 
00070 AST_OPTIONAL_API(void, ast_monitor_setjoinfiles,
00071        (struct ast_channel *chan, int turnon),
00072        { return; });
00073 
00074 /* Pause monitoring of a channel */
00075 AST_OPTIONAL_API(int, ast_monitor_pause,
00076        (struct ast_channel *chan),
00077        { return -1; });
00078 
00079 /* Unpause monitoring of a channel */
00080 AST_OPTIONAL_API(int, ast_monitor_unpause,
00081        (struct ast_channel *chan),
00082        { return -1; });
00083 
00084 #endif /* _ASTERISK_MONITOR_H */

Generated on Wed Apr 6 11:29:46 2011 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7