nettoyage du repertoire debian/
[asterisk-app-conference.git] / conference.h
CommitLineData
c575c500
TN
1
2// $Id: conference.h 884 2007-06-27 14:56:21Z sbalea $
3
4/*
5 * app_conference
6 *
7 * A channel independent conference application for Asterisk
8 *
9 * Copyright (C) 2002, 2003 Junghanns.NET GmbH
10 * Copyright (C) 2003, 2004 HorizonLive.com, Inc.
11 * Copyright (C) 2005, 2006 HorizonWimba, Inc.
12 * Copyright (C) 2007 Wimba, Inc.
13 *
14 * Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
15 *
16 * Video Conferencing support added by
17 * Neil Stratford <neils@vipadia.com>
18 * Copyright (C) 2005, 2005 Vipadia Limited
19 *
20 * VAD driven video conferencing, text message support
21 * and miscellaneous enhancements added by
22 * Mihai Balea <mihai at hates dot ms>
23 *
24 * This program may be modified and distributed under the
25 * terms of the GNU General Public License. You should have received
26 * a copy of the GNU General Public License along with this
27 * program; if not, write to the Free Software Foundation, Inc.
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 */
30
31#ifndef _APP_CONF_CONFERENCE_H
32#define _APP_CONF_CONFERENCE_H
33
34//
35// includes
36//
37
38#include "app_conference.h"
39#include "common.h"
40
41//
42// struct declarations
43//
44
45typedef struct ast_conference_stats
46{
47 // conference name ( copied for ease of use )
48 char name[128] ;
49
50 // type of connection
51 unsigned short phone ;
52 unsigned short iaxclient ;
53 unsigned short sip ;
54
55 // type of users
56 unsigned short moderators ;
57 unsigned short listeners ;
58
59 // accounting data
60 unsigned long frames_in ;
61 unsigned long frames_out ;
62 unsigned long frames_mixed ;
63
64 struct timeval time_entered ;
65
66} ast_conference_stats ;
67
68
69struct ast_conference
70{
71 // conference name
72 char name[128] ;
73
74 // single-linked list of members in conference
75 struct ast_conf_member* memberlist ;
76 int membercount ;
77 int id_count;
78
79 // id of the default video source
80 // If nobody is talking and video is unlocked, we use this source
81 int default_video_source_id;
82
83 // id of the current video source
84 // this changes according to VAD rules and lock requests
85 int current_video_source_id;
86
87 // timestamp of when the current source has started talking
88 // TODO: do we really need this?
89 //struct timeval current_video_source_timestamp;
90
91 // Video source locked flag, 1 -> locked, 0 -> unlocked
92 short video_locked;
93
94 // conference thread id
95 pthread_t conference_thread ;
96
97 // conference data mutex
98 ast_mutex_t lock ;
99
100 // pointer to next conference in single-linked list
101 struct ast_conference* next ;
102
103 // pointer to translation paths
104 struct ast_trans_pvt* from_slinear_paths[ AC_SUPPORTED_FORMATS ] ;
105
106 // conference stats
107 ast_conference_stats stats ;
108
109 // keep track of current delivery time
110 struct timeval delivery_time ;
111
112 // 1 => on, 0 => off
113 short debug_flag ;
114} ;
115
116
117#include "member.h"
118
119//
120// function declarations
121//
122
123struct ast_conference* start_conference( struct ast_conf_member* member ) ;
124
125void conference_exec( struct ast_conference* conf ) ;
126
127struct ast_conference* find_conf( const char* name ) ;
128struct ast_conference* create_conf( char* name, struct ast_conf_member* member ) ;
129void remove_conf( struct ast_conference* conf ) ;
130int end_conference( const char *name, int hangup ) ;
131
132// find a particular member, locking if requested.
133struct ast_conf_member *find_member ( const char *chan, int lock) ;
134
135int queue_frame_for_listener( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ;
136int queue_frame_for_speaker( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ;
137int queue_silent_frame( struct ast_conference* conf, struct ast_conf_member* member ) ;
138
139int get_new_id( struct ast_conference *conf );
140void add_member( struct ast_conf_member* member, struct ast_conference* conf ) ;
141int remove_member( struct ast_conf_member* member, struct ast_conference* conf ) ;
142int count_member( struct ast_conf_member* member, struct ast_conference* conf, short add_member ) ;
143
144void do_VAD_switching(struct ast_conference *conf);
145int send_text_message_to_member(struct ast_conf_member *member, const char *text);
146void do_video_switching(struct ast_conference *conf, int new_id, int lock);
147
148// called by app_confernce.c:load_module()
149void init_conference( void ) ;
150
151int get_conference_count( void ) ;
152
153int show_conference_list ( int fd, const char* name );
154int manager_conference_list( struct mansession *s, const struct message *m);
155int show_conference_stats ( int fd );
156int kick_member ( const char* confname, int user_id);
157int kick_channel ( const char *confname, const char *channel);
158int kick_all ( void );
159int mute_member ( const char* confname, int user_id);
160int unmute_member ( const char* confname, int user_id);
161int mute_channel ( const char* confname, const char* user_chan);
162int unmute_channel ( const char* confname, const char* user_chan);
163int viewstream_switch ( const char* confname, int user_id, int stream_id);
164int viewchannel_switch ( const char* confname, const char* user_chan, const char* stream_chan);
165
166int get_conference_stats( ast_conference_stats* stats, int requested ) ;
167int get_conference_stats_by_name( ast_conference_stats* stats, const char* name ) ;
168
169int lock_conference(const char *conference, int member_id);
170int lock_conference_channel(const char *conference, const char *channel);
171int unlock_conference(const char *conference);
172
173int set_default_id(const char *conference, int member_id);
174int set_default_channel(const char *conference, const char *channel);
175
176int video_mute_member(const char *conference, int member_id);
177int video_unmute_member(const char *conference, int member_id);
178int video_mute_channel(const char *conference, const char *channel);
179int video_unmute_channel(const char *conference, const char *channel);
180
181int send_text(const char *conference, int member, const char *text);
182int send_text_channel(const char *conference, const char *channel, const char *text);
183int send_text_broadcast(const char *conference, const char *text);
184
185int drive(const char *conference, int src_member_id, int dst_member_id);
186int drive_channel(const char *conference, const char *src_channel, const char *dst_channel);
187
188int play_sound_channel(int fd, const char *channel, const char *file, int mute);
189int stop_sound_channel(int fd, const char *channel);
190
191int set_conference_debugging( const char* name, int state ) ;
192
193#endif