app_conference.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "asterisk.h"
00029
00030
00031 #ifndef REVISION
00032 #define REVISION "unknown"
00033 #endif
00034
00035 static char *revision = REVISION;
00036
00037 ASTERISK_FILE_VERSION(__FILE__, REVISION)
00038
00039 #include "app_conference.h"
00040 #include "common.h"
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 static char *app = "Conference";
00056 static char *synopsis = "Channel Independent Conference";
00057 static char *descrip = "Channel Independent Conference Application";
00058
00059 static int app_conference_main(struct ast_channel* chan, void* data)
00060 {
00061 int res ;
00062 struct ast_module_user *u ;
00063
00064 u = ast_module_user_add(chan);
00065
00066
00067 res = member_exec( chan, data ) ;
00068
00069 ast_module_user_remove(u);
00070
00071 return res ;
00072 }
00073
00074 static int unload_module( void )
00075 {
00076 ast_log( LOG_NOTICE, "unloading app_conference module\n" ) ;
00077
00078 ast_module_user_hangup_all();
00079
00080 unregister_conference_cli() ;
00081
00082 return ast_unregister_application( app ) ;
00083 }
00084
00085 static int load_module( void )
00086 {
00087 ast_log( LOG_NOTICE, "Loading app_conference module, revision=%s\n", revision) ;
00088
00089 init_conference() ;
00090
00091 register_conference_cli() ;
00092
00093 return ast_register_application( app, app_conference_main, synopsis, descrip ) ;
00094 }
00095
00096
00097 void add_milliseconds(struct timeval* tv, long ms)
00098 {
00099
00100 tv->tv_usec += ( ms * 1000 ) ;
00101
00102
00103 long s = ( tv->tv_usec / 1000000 ) ;
00104
00105
00106 if ( s > 0 ) tv->tv_usec -= ( s * 1000000 ) ;
00107
00108
00109 tv->tv_sec += s ;
00110 }
00111
00112 #define AST_MODULE "Conference"
00113 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY,
00114 "Channel Independent Conference Application");
00115 #undef AST_MODULE
00116