Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Enumerations | Functions | Variables
app_meetme.c File Reference

Meet me conference bridge. More...

#include "asterisk.h"
#include <dahdi/user.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/app.h"
#include "asterisk/dsp.h"
#include "asterisk/musiconhold.h"
#include "asterisk/manager.h"
#include "asterisk/cli.h"
#include "asterisk/say.h"
#include "asterisk/utils.h"
#include "asterisk/translate.h"
#include "asterisk/ulaw.h"
#include "asterisk/astobj2.h"
#include "asterisk/devicestate.h"
#include "asterisk/dial.h"
#include "asterisk/causes.h"
#include "asterisk/paths.h"
#include "asterisk/test.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/json.h"
#include "asterisk/format_compatibility.h"
#include "enter.h"
#include "leave.h"

Go to the source code of this file.

Data Structures

struct  announce_listitem
 
struct  ast_conf_user
 The MeetMe User object. More...
 
struct  ast_conference
 The MeetMe Conference object. More...
 
struct  confs
 
struct  volume
 

Macros

#define AST_FRAME_BITS   32
 
#define CONF_SIZE   320
 
#define CONFFLAG_DONT_DENOISE   (1ULL << 35)
 
#define CONFFLAG_INTROMSG   (1ULL << 32)
 
#define CONFFLAG_INTROUSER_VMREC   (1ULL << 33)
 
#define CONFFLAG_KILL_LAST_MAN_STANDING   (1ULL << 34)
 
#define CONFFLAG_NO_AUDIO_UNTIL_UP   (1ULL << 31)
 
#define CONFIG_FILE_NAME   "meetme.conf"
 
#define DATE_FORMAT   "%Y-%m-%d %H:%M:%S"
 
#define DEFAULT_AUDIO_BUFFERS   32
 
#define MAX_CONFNUM   80
 
#define MAX_PIN   80
 
#define MAX_SETTINGS   (MAX_CONFNUM + MAX_PIN + MAX_PIN + 3)
 
#define MC_DATA_FORMAT   "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n"
 
#define MC_HEADER_FORMAT   "%-14s %-14s %-10s %-8s %-8s %-6s\n"
 
#define MEETME_DELAYDETECTENDTALK   1000
 
#define MEETME_DELAYDETECTTALK   300
 
#define OPTIONS_LEN   100
 
#define STR_CONCISE   "concise"
 

Enumerations

enum  {
  ADMINFLAG_MUTED = (1 << 1), ADMINFLAG_SELFMUTED = (1 << 2), ADMINFLAG_KICKME = (1 << 3), ADMINFLAG_T_REQUEST = (1 << 4),
  ADMINFLAG_HANGUP = (1 << 5)
}
 
enum  {
  CONFFLAG_ADMIN = (1 << 0), CONFFLAG_MONITOR = (1 << 1), CONFFLAG_KEYEXIT = (1 << 2), CONFFLAG_STARMENU = (1 << 3),
  CONFFLAG_TALKER = (1 << 4), CONFFLAG_QUIET = (1 << 5), CONFFLAG_ANNOUNCEUSERCOUNT = (1 << 6), CONFFLAG_AGI = (1 << 7),
  CONFFLAG_MOH = (1 << 8), CONFFLAG_MARKEDEXIT = (1 << 9), CONFFLAG_WAITMARKED = (1 << 10), CONFFLAG_EXIT_CONTEXT = (1 << 11),
  CONFFLAG_MARKEDUSER = (1 << 12), CONFFLAG_INTROUSER = (1 << 13), CONFFLAG_RECORDCONF = (1<< 14), CONFFLAG_MONITORTALKER = (1 << 15),
  CONFFLAG_DYNAMIC = (1 << 16), CONFFLAG_DYNAMICPIN = (1 << 17), CONFFLAG_EMPTY = (1 << 18), CONFFLAG_EMPTYNOPIN = (1 << 19),
  CONFFLAG_ALWAYSPROMPT = (1 << 20), CONFFLAG_OPTIMIZETALKER = (1 << 21), CONFFLAG_NOONLYPERSON = (1 << 22), CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
  CONFFLAG_STARTMUTED = (1 << 24), CONFFLAG_PASS_DTMF = (1 << 25), CONFFLAG_KICK_CONTINUE = (1 << 26), CONFFLAG_DURATION_STOP = (1 << 27),
  CONFFLAG_DURATION_LIMIT = (1 << 28)
}
 
enum  {
  OPT_ARG_WAITMARKED = 0, OPT_ARG_EXITKEYS = 1, OPT_ARG_DURATION_STOP = 2, OPT_ARG_DURATION_LIMIT = 3,
  OPT_ARG_MOH_CLASS = 4, OPT_ARG_INTROMSG = 5, OPT_ARG_INTROUSER_VMREC = 6, OPT_ARG_ARRAY_SIZE = 7
}
 
enum  announcetypes { CONF_HASJOIN, CONF_HASLEFT }
 
enum  entrance_sound { ENTER, LEAVE }
 
enum  menu_modes { MENU_DISABLED = 0, MENU_NORMAL, MENU_ADMIN, MENU_ADMIN_EXTENDED }
 
enum  recording_state { MEETME_RECORD_OFF, MEETME_RECORD_STARTED, MEETME_RECORD_ACTIVE, MEETME_RECORD_TERMINATE }
 
enum  volume_action { VOL_UP, VOL_DOWN }
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static int acf_meetme_info (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 
static int acf_meetme_info_eval (const char *keyword, const struct ast_conference *conf)
 
static int action_meetmelist (struct mansession *s, const struct message *m)
 
static int action_meetmelistrooms (struct mansession *s, const struct message *m)
 
static int action_meetmemute (struct mansession *s, const struct message *m)
 
static int action_meetmeunmute (struct mansession *s, const struct message *m)
 
static int admin_exec (struct ast_channel *chan, const char *data)
 The MeetMeAdmin application. More...
 
static void * announce_thread (void *data)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static struct ast_conferencebuild_conf (const char *confno, const char *pin, const char *pinadmin, int make, int dynamic, int refcount, const struct ast_channel *chan, struct ast_test *test)
 Find or create a conference. More...
 
static int can_write (struct ast_channel *chan, struct ast_flags64 *confflags)
 
static int careful_write (int fd, unsigned char *data, int len, int block)
 
static int channel_admin_exec (struct ast_channel *chan, const char *data)
 The MeetMeChannelAdmin application MeetMeChannelAdmin(channel, command)
 
static char * complete_confno (const char *word, int state)
 
static char * complete_meetmecmd_list (const char *line, const char *word, int pos, int state)
 
static char * complete_meetmecmd_lock (const char *word, int pos, int state)
 
static char * complete_meetmecmd_mute_kick (const char *line, const char *word, int pos, int state)
 
static char * complete_userno (struct ast_conference *cnf, const char *word, int state)
 
static int conf_exec (struct ast_channel *chan, const char *data)
 The meetme() application.
 
static void conf_flush (int fd, struct ast_channel *chan)
 
static int conf_free (struct ast_conference *conf)
 Remove the conference from the list and free it. More...
 
static void conf_play (struct ast_channel *chan, struct ast_conference *conf, enum entrance_sound sound)
 
static void conf_queue_dtmf (const struct ast_conference *conf, const struct ast_conf_user *sender, struct ast_frame *f)
 
static int conf_run (struct ast_channel *chan, struct ast_conference *conf, struct ast_flags64 *confflags, char *optargs[])
 
static void conf_start_moh (struct ast_channel *chan, const char *musicclass)
 
static int count_exec (struct ast_channel *chan, const char *data)
 The MeetmeCount application.
 
static int dispose_conf (struct ast_conference *conf)
 Decrement reference counts, as incremented by find_conf()
 
static void filename_parse (char *filename, char *buffer)
 
static struct ast_conferencefind_conf (struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags64 *confflags)
 
static struct ast_conferencefind_conf_realtime (struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags64 *confflags, int *too_early, char **optargs)
 
static struct ast_conf_userfind_user (struct ast_conference *conf, const char *callerident)
 
static const char * get_announce_filename (enum announcetypes type)
 
static const char * istalking (int x)
 
static int load_config (int reload)
 
static void load_config_meetme (int reload)
 
static int load_module (void)
 Load the module. More...
 
static char * meetme_cmd_helper (struct ast_cli_args *a)
 
static char * meetme_kick_cmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static char * meetme_lock_cmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static void meetme_menu (enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct ast_format_cap *cap_slin)
 
static void meetme_menu_admin (enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
 
static void meetme_menu_admin_extended (enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct ast_format_cap *cap_slin)
 
static void meetme_menu_normal (enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
 
static char * meetme_mute_cmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static void meetme_set_defaults (void)
 
static char * meetme_show_cmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
static void meetme_stasis_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message)
 
static void meetme_stasis_cleanup (void)
 
static void meetme_stasis_generate_msg (struct ast_conference *meetme_conference, struct ast_channel *chan, struct ast_conf_user *user, struct stasis_message_type *message_type, struct ast_json *extras)
 
static int meetme_stasis_init (void)
 
static int meetmemute (struct mansession *s, const struct message *m, int mute)
 
static enum ast_device_state meetmestate (const char *data)
 Callback for devicestate providers.
 
static void * recordthread (void *args)
 
static int reload (void)
 
static void reset_volumes (struct ast_conf_user *user)
 
static int rt_extend_conf (const char *confno)
 
static void send_talking_event (struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
 
static int set_listen_volume (struct ast_conf_user *user, int volume)
 
static int set_talk_volume (struct ast_conf_user *user, int volume)
 
static void set_user_talking (struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_join_type)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_leave_type)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_end_type)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_mute_type)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_talking_type)
 
 STASIS_MESSAGE_TYPE_DEFN_LOCAL (meetme_talk_request_type)
 
static struct ast_jsonstatus_to_json (int on)
 
static void tweak_listen_volume (struct ast_conf_user *user, enum volume_action action)
 
static void tweak_talk_volume (struct ast_conf_user *user, enum volume_action action)
 
static void tweak_volume (struct volume *vol, enum volume_action action)
 
static int unload_module (void)
 
static int user_chan_cb (void *obj, void *args, int flags)
 
static int user_listen_voldown_cb (void *obj, void *unused, int flags)
 
static int user_listen_volup_cb (void *obj, void *unused, int flags)
 
static int user_max_cmp (void *obj, void *arg, int flags)
 
static int user_no_cmp (void *obj, void *arg, int flags)
 
static int user_reset_vol_cb (void *obj, void *unused, int flags)
 
static int user_set_hangup_cb (void *obj, void *check_admin_arg, int flags)
 
static int user_set_kickme_cb (void *obj, void *check_admin_arg, int flags)
 
static int user_set_muted_cb (void *obj, void *check_admin_arg, int flags)
 
static int user_set_unmuted_cb (void *obj, void *check_admin_arg, int flags)
 
static int user_talk_voldown_cb (void *obj, void *unused, int flags)
 
static int user_talk_volup_cb (void *obj, void *unused, int flags)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "MeetMe conference bridge" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_DEPRECATED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_DEVSTATE_PROVIDER, .optional_modules = "func_speex", }
 
static const char *const app = "MeetMe"
 
static const char *const app2 = "MeetMeCount"
 
static const char *const app3 = "MeetMeAdmin"
 
static const char *const app4 = "MeetMeChannelAdmin"
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static int audio_buffers
 The number of audio buffers to be allocated on pseudo channels when in a conference.
 
static struct ast_cli_entry cli_meetme []
 
static unsigned int conf_map [1024] = {0, }
 
static struct confs confs = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , }
 
static int earlyalert
 
static int endalert
 
static int extendby
 
static int fuzzystart
 
static const char gain_map []
 Map 'volume' levels from -5 through +5 into decibel (dB) settings for channel drivers. More...
 
static struct stasis_message_routermeetme_event_message_router
 
static struct ast_custom_function meetme_info_acf
 
static const struct ast_app_option meetme_opts [128] = { [ 'A' ] = { .flag = CONFFLAG_MARKEDUSER }, [ 'a' ] = { .flag = CONFFLAG_ADMIN }, [ 'b' ] = { .flag = CONFFLAG_AGI }, [ 'c' ] = { .flag = CONFFLAG_ANNOUNCEUSERCOUNT }, [ 'C' ] = { .flag = CONFFLAG_KICK_CONTINUE }, [ 'D' ] = { .flag = CONFFLAG_DYNAMICPIN }, [ 'd' ] = { .flag = CONFFLAG_DYNAMIC }, [ 'E' ] = { .flag = CONFFLAG_EMPTYNOPIN }, [ 'e' ] = { .flag = CONFFLAG_EMPTY }, [ 'F' ] = { .flag = CONFFLAG_PASS_DTMF }, [ 'G' ] = { .flag = (1ULL << 32) , .arg_index = OPT_ARG_INTROMSG + 1 }, [ 'v' ] = { .flag = (1ULL << 33) , .arg_index = OPT_ARG_INTROUSER_VMREC + 1 }, [ 'i' ] = { .flag = CONFFLAG_INTROUSER }, [ 'I' ] = { .flag = CONFFLAG_INTROUSERNOREVIEW }, [ 'k' ] = { .flag = (1ULL << 34) }, [ 'M' ] = { .flag = CONFFLAG_MOH , .arg_index = OPT_ARG_MOH_CLASS + 1 }, [ 'm' ] = { .flag = CONFFLAG_STARTMUTED }, [ 'n' ] = { .flag = (1ULL << 35) }, [ 'o' ] = { .flag = CONFFLAG_OPTIMIZETALKER }, [ 'P' ] = { .flag = CONFFLAG_ALWAYSPROMPT }, [ 'p' ] = { .flag = CONFFLAG_KEYEXIT , .arg_index = OPT_ARG_EXITKEYS + 1 }, [ 'q' ] = { .flag = CONFFLAG_QUIET }, [ 'r' ] = { .flag = CONFFLAG_RECORDCONF }, [ 's' ] = { .flag = CONFFLAG_STARMENU }, [ 'T' ] = { .flag = CONFFLAG_MONITORTALKER }, [ 'l' ] = { .flag = CONFFLAG_MONITOR }, [ 't' ] = { .flag = CONFFLAG_TALKER }, [ 'w' ] = { .flag = CONFFLAG_WAITMARKED , .arg_index = OPT_ARG_WAITMARKED + 1 }, [ 'X' ] = { .flag = CONFFLAG_EXIT_CONTEXT }, [ 'x' ] = { .flag = CONFFLAG_MARKEDEXIT }, [ '1' ] = { .flag = CONFFLAG_NOONLYPERSON }, [ 'S' ] = { .flag = CONFFLAG_DURATION_STOP , .arg_index = OPT_ARG_DURATION_STOP + 1 }, [ 'L' ] = { .flag = CONFFLAG_DURATION_LIMIT , .arg_index = OPT_ARG_DURATION_LIMIT + 1 }, }
 
static int rt_log_members
 
static int rt_schedule
 

Detailed Description

Meet me conference bridge.

Author
Mark Spencer marks.nosp@m.ter@.nosp@m.digiu.nosp@m.m.co.nosp@m.m

Definition in file app_meetme.c.

Macro Definition Documentation

#define CONFFLAG_DONT_DENOISE   (1ULL << 35)

If set, don't enable a denoiser for the channel

Definition at line 763 of file app_meetme.c.

#define CONFFLAG_INTROMSG   (1ULL << 32)

If set play an intro announcement at start of conference

Definition at line 758 of file app_meetme.c.

#define CONFFLAG_KILL_LAST_MAN_STANDING   (1ULL << 34)

If there's only one person left in a conference when someone leaves, kill the conference

Definition at line 761 of file app_meetme.c.

#define CONFFLAG_NO_AUDIO_UNTIL_UP   (1ULL << 31)

Do not write any audio to this channel until the state is up.

Definition at line 757 of file app_meetme.c.

#define DATE_FORMAT   "%Y-%m-%d %H:%M:%S"

String format for scheduled conferences

Definition at line 662 of file app_meetme.c.

#define DEFAULT_AUDIO_BUFFERS   32

each buffer is 20ms, so this is 640ms total

Definition at line 659 of file app_meetme.c.

Enumeration Type Documentation

anonymous enum
Enumerator
ADMINFLAG_MUTED 

User is muted

ADMINFLAG_SELFMUTED 

User muted self

ADMINFLAG_KICKME 

User has been kicked

ADMINFLAG_T_REQUEST 

User has requested to speak

ADMINFLAG_HANGUP 

User will be leaving the conference

Definition at line 664 of file app_meetme.c.

664  {
665  ADMINFLAG_MUTED = (1 << 1), /*!< User is muted */
666  ADMINFLAG_SELFMUTED = (1 << 2), /*!< User muted self */
667  ADMINFLAG_KICKME = (1 << 3), /*!< User has been kicked */
668  /*! User has requested to speak */
669  ADMINFLAG_T_REQUEST = (1 << 4),
670  ADMINFLAG_HANGUP = (1 << 5), /*!< User will be leaving the conference */
671 };
anonymous enum
Enumerator
CONFFLAG_ADMIN 

user has admin access on the conference

CONFFLAG_MONITOR 

If set the user can only receive audio from the conference

CONFFLAG_KEYEXIT 

If set asterisk will exit conference when key defined in p() option is pressed

CONFFLAG_STARMENU 

If set asterisk will provide a menu to the user when '*' is pressed

CONFFLAG_TALKER 

If set the use can only send audio to the conference

CONFFLAG_QUIET 

If set there will be no enter or leave sounds

CONFFLAG_ANNOUNCEUSERCOUNT 

If set, when user joins the conference, they will be told the number of users that are already in

CONFFLAG_AGI 

Set to run AGI Script in Background

CONFFLAG_MOH 

Set to have music on hold when user is alone in conference

CONFFLAG_MARKEDEXIT 

If set, the channel will leave the conference if all marked users leave

CONFFLAG_WAITMARKED 

If set, the MeetMe will wait until a marked user enters

CONFFLAG_EXIT_CONTEXT 

If set, the MeetMe will exit to the specified context

CONFFLAG_MARKEDUSER 

If set, the user will be marked

CONFFLAG_INTROUSER 

If set, user will be ask record name on entry of conference

CONFFLAG_RECORDCONF 

If set, the MeetMe will be recorded

CONFFLAG_MONITORTALKER 

If set, the user will be monitored if the user is talking or not

CONFFLAG_OPTIMIZETALKER 

If set, treat talking users as muted users

CONFFLAG_NOONLYPERSON 

If set, won't speak the extra prompt when the first person enters the conference

CONFFLAG_INTROUSERNOREVIEW 

If set, user will be asked to record name on entry of conference without review

CONFFLAG_STARTMUTED 

If set, the user will be initially self-muted

CONFFLAG_PASS_DTMF 

Pass DTMF through the conference

CONFFLAG_KICK_CONTINUE 

If set, the user should continue in the dialplan if kicked out

Definition at line 697 of file app_meetme.c.

697  {
698  /*! user has admin access on the conference */
699  CONFFLAG_ADMIN = (1 << 0),
700  /*! If set the user can only receive audio from the conference */
701  CONFFLAG_MONITOR = (1 << 1),
702  /*! If set asterisk will exit conference when key defined in p() option is pressed */
703  CONFFLAG_KEYEXIT = (1 << 2),
704  /*! If set asterisk will provide a menu to the user when '*' is pressed */
705  CONFFLAG_STARMENU = (1 << 3),
706  /*! If set the use can only send audio to the conference */
707  CONFFLAG_TALKER = (1 << 4),
708  /*! If set there will be no enter or leave sounds */
709  CONFFLAG_QUIET = (1 << 5),
710  /*! If set, when user joins the conference, they will be told the number
711  * of users that are already in */
712  CONFFLAG_ANNOUNCEUSERCOUNT = (1 << 6),
713  /*! Set to run AGI Script in Background */
714  CONFFLAG_AGI = (1 << 7),
715  /*! Set to have music on hold when user is alone in conference */
716  CONFFLAG_MOH = (1 << 8),
717  /*! If set, the channel will leave the conference if all marked users leave */
718  CONFFLAG_MARKEDEXIT = (1 << 9),
719  /*! If set, the MeetMe will wait until a marked user enters */
720  CONFFLAG_WAITMARKED = (1 << 10),
721  /*! If set, the MeetMe will exit to the specified context */
722  CONFFLAG_EXIT_CONTEXT = (1 << 11),
723  /*! If set, the user will be marked */
724  CONFFLAG_MARKEDUSER = (1 << 12),
725  /*! If set, user will be ask record name on entry of conference */
726  CONFFLAG_INTROUSER = (1 << 13),
727  /*! If set, the MeetMe will be recorded */
728  CONFFLAG_RECORDCONF = (1<< 14),
729  /*! If set, the user will be monitored if the user is talking or not */
730  CONFFLAG_MONITORTALKER = (1 << 15),
731  CONFFLAG_DYNAMIC = (1 << 16),
732  CONFFLAG_DYNAMICPIN = (1 << 17),
733  CONFFLAG_EMPTY = (1 << 18),
734  CONFFLAG_EMPTYNOPIN = (1 << 19),
735  CONFFLAG_ALWAYSPROMPT = (1 << 20),
736  /*! If set, treat talking users as muted users */
737  CONFFLAG_OPTIMIZETALKER = (1 << 21),
738  /*! If set, won't speak the extra prompt when the first person
739  * enters the conference */
740  CONFFLAG_NOONLYPERSON = (1 << 22),
741  /*! If set, user will be asked to record name on entry of conference
742  * without review */
743  CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
744  /*! If set, the user will be initially self-muted */
745  CONFFLAG_STARTMUTED = (1 << 24),
746  /*! Pass DTMF through the conference */
747  CONFFLAG_PASS_DTMF = (1 << 25),
748  /*! If set, the user should continue in the dialplan if kicked out */
749  CONFFLAG_KICK_CONTINUE = (1 << 26),
750  CONFFLAG_DURATION_STOP = (1 << 27),
751  CONFFLAG_DURATION_LIMIT = (1 << 28),
752 };

Function Documentation

static int admin_exec ( struct ast_channel chan,
const char *  data 
)
static

The MeetMeAdmin application.

MeetMeAdmin(confno, command, caller)

Definition at line 4777 of file app_meetme.c.

References ADMINFLAG_KICKME, ADMINFLAG_MUTED, ADMINFLAG_SELFMUTED, ADMINFLAG_T_REQUEST, ast_conf_user::adminflags, ao2_callback, ao2_ref, AST_APP_ARG, ast_atomic_fetchadd_int(), AST_DECLARE_APP_ARGS, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, AST_STANDARD_APP_ARGS, ast_strdupa, CONFFLAG_ADMIN, ast_conference::confno, dispose_conf(), ast_conference::locked, OBJ_NODATA, pbx_builtin_setvar_helper(), RAII_VAR, and ast_conference::refcount.

Referenced by load_module().

4777  {
4778  char *params;
4779  struct ast_conference *cnf;
4780  struct ast_conf_user *user = NULL;
4781  AST_DECLARE_APP_ARGS(args,
4782  AST_APP_ARG(confno);
4783  AST_APP_ARG(command);
4784  AST_APP_ARG(user);
4785  );
4786  int res = 0;
4787 
4788  if (ast_strlen_zero(data)) {
4789  ast_log(LOG_WARNING, "MeetMeAdmin requires an argument!\n");
4790  if (chan) {
4791  pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
4792  }
4793  return -1;
4794  }
4795 
4796  params = ast_strdupa(data);
4797  AST_STANDARD_APP_ARGS(args, params);
4798 
4799  if (!args.command) {
4800  ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n");
4801  if (chan) {
4802  pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
4803  }
4804  return -1;
4805  }
4806 
4807  AST_LIST_LOCK(&confs);
4808  AST_LIST_TRAVERSE(&confs, cnf, list) {
4809  if (!strcmp(cnf->confno, args.confno))
4810  break;
4811  }
4812 
4813  if (!cnf) {
4814  ast_log(LOG_WARNING, "Conference number '%s' not found!\n", args.confno);
4816  if (chan) {
4817  pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOTFOUND");
4818  }
4819  return 0;
4820  }
4821 
4823 
4824  if (args.user) {
4825  user = find_user(cnf, args.user);
4826  if (!user) {
4827  ast_log(LOG_NOTICE, "Specified User not found!\n");
4828  res = -2;
4829  goto usernotfound;
4830  }
4831  } else {
4832  /* fail for commands that require a user */
4833  switch (*args.command) {
4834  case 'm': /* Unmute */
4835  case 'M': /* Mute */
4836  case 't': /* Lower user's talk volume */
4837  case 'T': /* Raise user's talk volume */
4838  case 'u': /* Lower user's listen volume */
4839  case 'U': /* Raise user's listen volume */
4840  case 'r': /* Reset user's volume level */
4841  case 'k': /* Kick user */
4842  res = -2;
4843  ast_log(LOG_NOTICE, "No user specified!\n");
4844  goto usernotfound;
4845  default:
4846  break;
4847  }
4848  }
4849 
4850  switch (*args.command) {
4851  case 76: /* L: Lock */
4852  cnf->locked = 1;
4853  break;
4854  case 108: /* l: Unlock */
4855  cnf->locked = 0;
4856  break;
4857  case 75: /* K: kick all users */
4858  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_set_kickme_cb, NULL);
4859  break;
4860  case 101: /* e: Eject last user*/
4861  {
4862  int max_no = 0;
4863  RAII_VAR(struct ast_conf_user *, eject_user, NULL, ao2_cleanup);
4864 
4865  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
4866  eject_user = ao2_find(cnf->usercontainer, &max_no, 0);
4867  if (!eject_user) {
4868  res = -1;
4869  ast_log(LOG_NOTICE, "No last user to kick!\n");
4870  break;
4871  }
4872 
4873  if (!ast_test_flag64(&eject_user->userflags, CONFFLAG_ADMIN)) {
4874  eject_user->adminflags |= ADMINFLAG_KICKME;
4875  } else {
4876  res = -1;
4877  ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
4878  }
4879  break;
4880  }
4881  case 77: /* M: Mute */
4882  user->adminflags |= ADMINFLAG_MUTED;
4883  break;
4884  case 78: /* N: Mute all (non-admin) users */
4885  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_set_muted_cb, &cnf);
4886  break;
4887  case 109: /* m: Unmute */
4889  break;
4890  case 110: /* n: Unmute all users */
4891  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_set_unmuted_cb, NULL);
4892  break;
4893  case 107: /* k: Kick user */
4894  user->adminflags |= ADMINFLAG_KICKME;
4895  break;
4896  case 118: /* v: Lower all users listen volume */
4897  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_listen_voldown_cb, NULL);
4898  break;
4899  case 86: /* V: Raise all users listen volume */
4900  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_listen_volup_cb, NULL);
4901  break;
4902  case 115: /* s: Lower all users speaking volume */
4903  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_talk_voldown_cb, NULL);
4904  break;
4905  case 83: /* S: Raise all users speaking volume */
4906  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_talk_volup_cb, NULL);
4907  break;
4908  case 82: /* R: Reset all volume levels */
4909  ao2_callback(cnf->usercontainer, OBJ_NODATA, user_reset_vol_cb, NULL);
4910  break;
4911  case 114: /* r: Reset user's volume level */
4912  reset_volumes(user);
4913  break;
4914  case 85: /* U: Raise user's listen volume */
4915  tweak_listen_volume(user, VOL_UP);
4916  break;
4917  case 117: /* u: Lower user's listen volume */
4918  tweak_listen_volume(user, VOL_DOWN);
4919  break;
4920  case 84: /* T: Raise user's talk volume */
4921  tweak_talk_volume(user, VOL_UP);
4922  break;
4923  case 116: /* t: Lower user's talk volume */
4924  tweak_talk_volume(user, VOL_DOWN);
4925  break;
4926  case 'E': /* E: Extend conference */
4927  if (rt_extend_conf(args.confno)) {
4928  res = -1;
4929  }
4930  break;
4931  }
4932 
4933  if (args.user) {
4934  /* decrement reference from find_user */
4935  ao2_ref(user, -1);
4936  }
4937 usernotfound:
4939 
4940  dispose_conf(cnf);
4941  if (chan) {
4942  pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", res == -2 ? "NOTFOUND" : res ? "FAILED" : "OK");
4943  }
4944 
4945  return 0;
4946 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:40
static int dispose_conf(struct ast_conference *conf)
Decrement reference counts, as incremented by find_conf()
Definition: app_meetme.c:2065
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:140
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
Definition: astobj2.h:1693
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:757
unsigned int locked
Definition: app_meetme.c:866
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:298
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
The MeetMe User object.
Definition: app_meetme.c:904
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:491
structure to hold users read from users.conf
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
The MeetMe Conference object.
Definition: app_meetme.c:850
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_APP_ARG(name)
Define an application argument.
char confno[MAX_CONFNUM]
Definition: app_meetme.c:853
static struct ast_conference* build_conf ( const char *  confno,
const char *  pin,
const char *  pinadmin,
int  make,
int  dynamic,
int  refcount,
const struct ast_channel chan,
struct ast_test *  test 
)
static

Find or create a conference.

Parameters
confnoThe conference name/number
pinThe regular user pin
pinadminThe admin pin
makeMake the conf if it doesn't exist
dynamicMark the newly created conference as dynamic
refcountHow many references to mark on the conference
chanThe asterisk channel
test
Returns
A pointer to the conference struct, or NULL if it wasn't found and make or dynamic were not set.

Definition at line 1428 of file app_meetme.c.

References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_ref, ast_atomic_fetchadd_int(), ast_calloc, ast_copy_string(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_slin, ast_hangup(), AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_request(), ast_set_read_format(), ast_set_write_format(), ast_conference::chan, ast_conference::confno, ast_conference::dahdiconf, ast_conference::fd, ast_conference::isdynamic, ast_conference::listenlock, ast_conference::maxusers, ast_conference::pin, ast_conference::pinadmin, ast_conference::playlock, ast_conference::recordthread, ast_conference::recordthreadlock, ast_conference::refcount, and ast_conference::start.

1431 {
1432  struct ast_conference *cnf;
1433  struct dahdi_confinfo dahdic = { 0, };
1434  int confno_int = 0;
1436 
1437  AST_LIST_LOCK(&confs);
1438 
1439  AST_LIST_TRAVERSE(&confs, cnf, list) {
1440  if (!strcmp(confno, cnf->confno))
1441  break;
1442  }
1443 
1444  if (cnf || (!make && !dynamic) || !cap_slin)
1445  goto cnfout;
1446 
1447  ast_format_cap_append(cap_slin, ast_format_slin, 0);
1448  /* Make a new one */
1449  cnf = ast_calloc(1, sizeof(*cnf));
1450  if (!cnf) {
1451  goto cnfout;
1452  }
1453 
1454  cnf->usercontainer = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_MUTEX, 0,
1455  NULL, user_no_cmp);
1456  if (!cnf->usercontainer) {
1457  goto cnfout;
1458  }
1459 
1460  ast_mutex_init(&cnf->playlock);
1461  ast_mutex_init(&cnf->listenlock);
1462  cnf->recordthread = AST_PTHREADT_NULL;
1463  ast_mutex_init(&cnf->recordthreadlock);
1464  cnf->announcethread = AST_PTHREADT_NULL;
1465  ast_mutex_init(&cnf->announcethreadlock);
1466  ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
1467  ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
1468  ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
1469  ast_copy_string(cnf->uniqueid, ast_channel_uniqueid(chan), sizeof(cnf->uniqueid));
1470 
1471  /* Setup a new dahdi conference */
1472  dahdic.confno = -1;
1473  dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1474  cnf->fd = open("/dev/dahdi/pseudo", O_RDWR);
1475  if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &dahdic)) {
1476  if (test) {
1477  /* if we are creating a conference for a unit test, it is not neccesary
1478  * to open a pseudo channel, so, if we fail continue creating
1479  * the conference. */
1480  ast_test_status_update(test, "Unable to open DAHDI pseudo device\n");
1481  } else {
1482  ast_log(LOG_WARNING, "Unable to open DAHDI pseudo device\n");
1483  if (cnf->fd >= 0)
1484  close(cnf->fd);
1485  ao2_ref(cnf->usercontainer, -1);
1486  ast_mutex_destroy(&cnf->playlock);
1487  ast_mutex_destroy(&cnf->listenlock);
1488  ast_mutex_destroy(&cnf->recordthreadlock);
1489  ast_mutex_destroy(&cnf->announcethreadlock);
1490  ast_free(cnf);
1491  cnf = NULL;
1492  goto cnfout;
1493  }
1494  }
1495 
1496  cnf->dahdiconf = dahdic.confno;
1497 
1498  /* Setup a new channel for playback of audio files */
1499  cnf->chan = ast_request("DAHDI", cap_slin, NULL, chan, "pseudo", NULL);
1500  if (cnf->chan) {
1503  dahdic.chan = 0;
1504  dahdic.confno = cnf->dahdiconf;
1505  dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1506  if (ioctl(ast_channel_fd(cnf->chan, 0), DAHDI_SETCONF, &dahdic)) {
1507  if (test) {
1508  ast_test_status_update(test, "Error setting conference on pseudo channel\n");
1509  }
1510  ast_log(LOG_WARNING, "Error setting conference\n");
1511  if (cnf->chan)
1512  ast_hangup(cnf->chan);
1513  else
1514  close(cnf->fd);
1515  ao2_ref(cnf->usercontainer, -1);
1516  ast_mutex_destroy(&cnf->playlock);
1517  ast_mutex_destroy(&cnf->listenlock);
1518  ast_mutex_destroy(&cnf->recordthreadlock);
1519  ast_mutex_destroy(&cnf->announcethreadlock);
1520  ast_free(cnf);
1521  cnf = NULL;
1522  goto cnfout;
1523  }
1524  }
1525 
1526  /* Fill the conference struct */
1527  cnf->start = time(NULL);
1528  cnf->maxusers = 0x7fffffff;
1529  cnf->isdynamic = dynamic ? 1 : 0;
1530  ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->dahdiconf, cnf->confno);
1531  AST_LIST_INSERT_HEAD(&confs, cnf, list);
1532 
1533  /* Reserve conference number in map */
1534  if ((sscanf(cnf->confno, "%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
1535  conf_map[confno_int] = 1;
1536 
1537 cnfout:
1538  ao2_cleanup(cap_slin);
1539  if (cnf)
1540  ast_atomic_fetchadd_int(&cnf->refcount, refcount);
1541 
1543 
1544  return cnf;
1545 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:40
struct ast_channel * chan
Definition: app_meetme.c:854
ast_mutex_t playlock
Definition: app_meetme.c:851
pthread_t recordthread
Definition: app_meetme.c:868
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:140
unsigned int isdynamic
Definition: app_meetme.c:865
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a list container.
Definition: astobj2.h:1327
ast_mutex_t listenlock
Definition: app_meetme.c:852
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
Definition: lock.h:757
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
Definition: channel.c:6354
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
Definition: channel.c:5762
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
#define ast_format_cap_append(cap, format, framing)
Add format capability to capabilities structure.
Definition: format_cap.h:99
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
Definition: channel.c:5803
#define ast_format_cap_alloc(flags)
Allocate a new ast_format_cap structure.
Definition: format_cap.h:49
char pin[MAX_PIN]
Definition: app_meetme.c:873
Format capabilities structure, holds formats + preference order + etc.
Definition: format_cap.c:54
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:491
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
Definition: linkedlists.h:711
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:202
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
Definition: channel.c:2541
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425
char pinadmin[MAX_PIN]
Definition: app_meetme.c:874
The MeetMe Conference object.
Definition: app_meetme.c:850
struct ast_format * ast_format_slin
Built-in cached signed linear 8kHz format.
Definition: format_cache.c:41
ast_mutex_t recordthreadlock
Definition: app_meetme.c:869
char confno[MAX_CONFNUM]
Definition: app_meetme.c:853
static int conf_free ( struct ast_conference conf)
static

Remove the conference from the list and free it.

We assume that this was called while holding conflock.

Definition at line 1976 of file app_meetme.c.

References ao2_ref, ast_filedelete(), ast_hangup(), AST_LIST_LOCK, AST_LIST_REMOVE, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_softhangup(), AST_SOFTHANGUP_EXPLICIT, ast_translator_free_path(), ast_conference::chan, ast_conference::fd, ast_conference::lchan, ast_conference::listenlock, announce_listitem::namerecloc, ast_conference::playlock, ast_conference::recording, ast_conference::recordingfilename, ast_conference::recordingformat, and ast_conference::recordthreadlock.

Referenced by dispose_conf().

1977 {
1978  int x;
1979  struct announce_listitem *item;
1980 
1981  AST_LIST_REMOVE(&confs, conf, list);
1982 
1983  meetme_stasis_generate_msg(conf, NULL, NULL, meetme_end_type(), NULL);
1984 
1985  if (conf->recording == MEETME_RECORD_ACTIVE) {
1986  conf->recording = MEETME_RECORD_TERMINATE;
1988  while (1) {
1989  usleep(1);
1990  AST_LIST_LOCK(&confs);
1991  if (conf->recording == MEETME_RECORD_OFF)
1992  break;
1994  }
1995  }
1996 
1997  for (x = 0; x < AST_FRAME_BITS; x++) {
1998  if (conf->transframe[x])
1999  ast_frfree(conf->transframe[x]);
2000  if (conf->transpath[x])
2001  ast_translator_free_path(conf->transpath[x]);
2002  }
2003  if (conf->announcethread != AST_PTHREADT_NULL) {
2004  ast_mutex_lock(&conf->announcelistlock);
2005  conf->announcethread_stop = 1;
2007  ast_cond_signal(&conf->announcelist_addition);
2008  ast_mutex_unlock(&conf->announcelistlock);
2009  pthread_join(conf->announcethread, NULL);
2010 
2011  while ((item = AST_LIST_REMOVE_HEAD(&conf->announcelist, entry))) {
2012  /* If it's a voicemail greeting file we don't want to remove it */
2013  if (!item->vmrec){
2014  ast_filedelete(item->namerecloc, NULL);
2015  }
2016  ao2_ref(item, -1);
2017  }
2018  ast_mutex_destroy(&conf->announcelistlock);
2019  }
2020 
2021  if (conf->origframe)
2022  ast_frfree(conf->origframe);
2023  ast_hangup(conf->lchan);
2024  ast_hangup(conf->chan);
2025  if (conf->fd >= 0)
2026  close(conf->fd);
2027  if (conf->recordingfilename) {
2028  ast_free(conf->recordingfilename);
2029  }
2030  if (conf->usercontainer) {
2031  ao2_ref(conf->usercontainer, -1);
2032  }
2033  if (conf->recordingformat) {
2034  ast_free(conf->recordingformat);
2035  }
2036  ast_mutex_destroy(&conf->playlock);
2037  ast_mutex_destroy(&conf->listenlock);
2038  ast_mutex_destroy(&conf->recordthreadlock);
2039  ast_mutex_destroy(&conf->announcethreadlock);
2040  ast_free(conf);
2041 
2042  return 0;
2043 }
#define AST_LIST_LOCK(head)
Locks a list.
Definition: linkedlists.h:40
struct ast_channel * chan
Definition: app_meetme.c:854
ast_mutex_t playlock
Definition: app_meetme.c:851
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
Definition: channel.c:2471
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Definition: linkedlists.h:140
char * recordingformat
Definition: app_meetme.c:872
ast_mutex_t listenlock
Definition: app_meetme.c:852
int ast_filedelete(const char *filename, const char *fmt)
Deletes a file.
Definition: file.c:1141
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:856
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:833
enum recording_state recording
Definition: app_meetme.c:864
char namerecloc[PATH_MAX]
Definition: app_meetme.c:841
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
Definition: channel.c:2541
Definition: search.h:40
char * recordingfilename
Definition: app_meetme.c:871
struct ast_channel * lchan
Definition: app_meetme.c:855
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
Definition: translate.c:476
ast_mutex_t recordthreadlock
Definition: app_meetme.c:869
static int load_module ( void  )
static

Load the module.

Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.

Definition at line 5527 of file app_meetme.c.

References admin_exec(), ast_cli_register_multiple, ast_custom_function_register, ast_devstate_prov_add(), ast_manager_register_xml, ast_realtime_require_field(), ast_register_application_xml, channel_admin_exec(), conf_exec(), count_exec(), and meetmestate().

5528 {
5529  int res = 0;
5530 
5531  res |= load_config(0);
5532 
5533  res |= meetme_stasis_init();
5534 
5535  ast_cli_register_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
5536  res |= ast_manager_register_xml("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute);
5537  res |= ast_manager_register_xml("MeetmeUnmute", EVENT_FLAG_CALL, action_meetmeunmute);
5538  res |= ast_manager_register_xml("MeetmeList", EVENT_FLAG_REPORTING, action_meetmelist);
5539  res |= ast_manager_register_xml("MeetmeListRooms", EVENT_FLAG_REPORTING, action_meetmelistrooms);
5544 
5545  res |= ast_devstate_prov_add("Meetme", meetmestate);
5546 
5547  res |= ast_custom_function_register(&meetme_info_acf);
5548  ast_realtime_require_field("meetme", "confno", RQ_UINTEGER2, 3, "members", RQ_UINTEGER1, 3, NULL);
5549 
5550  return res;
5551 }
static int conf_exec(struct ast_channel *chan, const char *data)
The meetme() application.
Definition: app_meetme.c:4389
static int count_exec(struct ast_channel *chan, const char *data)
The MeetmeCount application.
Definition: app_meetme.c:4344
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
Add device state provider.
Definition: devicestate.c:391
int ast_realtime_require_field(const char *family,...) attribute_sentinel
Inform realtime what fields that may be stored.
Definition: main/config.c:3549
static enum ast_device_state meetmestate(const char *data)
Callback for devicestate providers.
Definition: app_meetme.c:5310
static int admin_exec(struct ast_channel *chan, const char *data)
The MeetMeAdmin application.
Definition: app_meetme.c:4777
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
Definition: manager.h:191
#define ast_custom_function_register(acf)
Register a custom function.
Definition: pbx.h:1558
static int channel_admin_exec(struct ast_channel *chan, const char *data)
The MeetMeChannelAdmin application MeetMeChannelAdmin(channel, command)
Definition: app_meetme.c:4950
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Definition: module.h:640

Variable Documentation

const char gain_map[]
static

Map 'volume' levels from -5 through +5 into decibel (dB) settings for channel drivers.

Note
these are not a straight linear-to-dB conversion... the numbers have been modified to give the user a better level of adjustability.

Definition at line 937 of file app_meetme.c.

struct ast_custom_function meetme_info_acf
static
Initial value:
= {
.name = "MEETME_INFO",
.read = acf_meetme_info,
}

Definition at line 5482 of file app_meetme.c.

int rt_log_members
static

Log participant count to the RealTime backend

Definition at line 825 of file app_meetme.c.