50 #include <dahdi/user.h> 642 #define CONFIG_FILE_NAME "meetme.conf" 643 #define SLA_CONFIG_FILE "sla.conf" 644 #define STR_CONCISE "concise" 647 #define DEFAULT_AUDIO_BUFFERS 32 650 #define DATE_FORMAT "%Y-%m-%d %H:%M:%S" 661 #define MEETME_DELAYDETECTTALK 300 662 #define MEETME_DELAYDETECTENDTALK 1000 664 #define AST_FRAME_BITS 32 683 #define CONF_SIZE 320 747 #define CONFFLAG_NO_AUDIO_UNTIL_UP (1ULL << 31) 748 #define CONFFLAG_INTROMSG (1ULL << 32) 749 #define CONFFLAG_INTROUSER_VMREC (1ULL << 33) 751 #define CONFFLAG_KILL_LAST_MAN_STANDING (1ULL << 34) 753 #define CONFFLAG_DONT_DENOISE (1ULL << 35) 802 static const char *
const app =
"MeetMe";
803 static const char *
const app2 =
"MeetMeCount";
804 static const char *
const app3 =
"MeetMeAdmin";
805 static const char *
const app4 =
"MeetMeChannelAdmin";
819 #define MAX_CONFNUM 80 821 #define OPTIONS_LEN 100 824 #define MAX_SETTINGS (MAX_CONFNUM + MAX_PIN + MAX_PIN + 3) 907 struct timeval start_time;
1058 struct timeval last_try;
1066 struct timeval ring_begin;
1080 struct timeval ring_begin;
1144 if (meetme_event_message_router) {
1146 meetme_event_message_router =
NULL;
1170 if (!meetme_event_message_router) {
1184 meetme_leave_type(),
1208 meetme_talking_type(),
1216 meetme_talk_request_type(),
1232 const char *conference_num;
1238 if (!channel_blob) {
1245 if (!message_type) {
1250 if (message_type == meetme_join_type()) {
1251 event =
"MeetmeJoin";
1252 }
else if (message_type == meetme_leave_type()) {
1253 event =
"MeetmeLeave";
1254 }
else if (message_type == meetme_end_type()) {
1255 event =
"MeetmeEnd";
1256 }
else if (message_type == meetme_mute_type()) {
1257 event =
"MeetmeMute";
1258 }
else if (message_type == meetme_talking_type()) {
1259 event =
"MeetmeTalking";
1260 }
else if (message_type == meetme_talk_request_type()) {
1261 event =
"MeetmeTalkRequest";
1273 if (!conference_num) {
1290 if (!user_prop_str) {
1294 ast_str_set(&user_prop_str, 0,
"%d", user_number);
1327 "status", on ?
"on" :
"off");
1350 "Meetme", meetme_conference->
confno);
1362 long duration = (long)(now.tv_sec - user->
jointime);
1364 struct ast_json *json_user_duration;
1373 if (!json_user_duration
1403 return "(unmonitored)";
1405 return "(not talking)";
1415 x = DAHDI_IOMUX_WRITE | DAHDI_IOMUX_SIGEVENT;
1416 res = ioctl(fd, DAHDI_IOMUX, &x);
1420 res = write(fd, data, len);
1422 if (
errno != EAGAIN) {
1442 gain_adjust = gain_map[volume + 5];
1454 gain_adjust = gain_map[volume + 5];
1520 signed char zero_volume = 0;
1528 unsigned char *data;
1533 "Conference: %s\r\n" 1547 len =
sizeof(
enter);
1551 len =
sizeof(
leave);
1572 if (user->
user_no == *user_no) {
1584 if (user->
user_no > *max_no) {
1611 struct dahdi_confinfo dahdic = { 0, };
1618 if (!strcmp(confno, cnf->
confno))
1622 if (cnf || (!make && !dynamic) || !cap_slin)
1651 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1652 cnf->
fd = open(
"/dev/dahdi/pseudo", O_RDWR);
1653 if (cnf->
fd < 0 || ioctl(cnf->
fd, DAHDI_SETCONF, &dahdic)) {
1683 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1712 if ((sscanf(cnf->
confno,
"%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
1713 conf_map[confno_int] = 1;
1730 int len = strlen(word);
1734 if (!strncmp(word, cnf->
confno, len) && ++which > state) {
1751 int len = strlen(word);
1755 snprintf(usrno,
sizeof(usrno),
"%d", usr->
user_no);
1756 if (!strncmp(word, usrno, len) && ++which > state) {
1772 int len = strlen(word);
1779 if (!strncasecmp(word,
"all", len)) {
1788 strtok_r(myline,
" ", &saved);
1789 strtok_r(
NULL,
" ", &saved);
1790 confno = strtok_r(
NULL,
" ", &saved);
1794 if (!strcmp(confno, cnf->
confno)) {
1829 if (pos == 3 && state == 0) {
1836 strtok_r(myline,
" ", &saved);
1837 strtok_r(
NULL,
" ", &saved);
1838 confno = strtok_r(
NULL,
" ", &saved);
1861 #define MC_HEADER_FORMAT "%-14s %-14s %-10s %-8s %-8s %-6s\n" 1862 #define MC_DATA_FORMAT "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n" 1868 "Usage: meetme list [<confno>] [" STR_CONCISE "]\n" 1869 " List all conferences or a specific conference.\n";
1877 int concise = (a->
argc == 3);
1888 ast_cli(a->
fd,
"No active MeetMe conferences.\n");
1898 hr = (now - cnf->
start) / 3600;
1899 min = ((now - cnf->
start) % 3600) / 60;
1900 sec = (now - cnf->
start) % 60;
1911 ast_cli(a->
fd,
"%s!%d!%d!%02d:%02d:%02d!%d!%d\n",
1920 total += cnf->
users;
1924 ast_cli(a->
fd,
"* Total number of MeetMe users: %d\n", total);
1931 int concise = (a->
argc == 4);
1936 ast_cli(a->
fd,
"No active MeetMe conferences.\n");
1957 hr = (now - user->
jointime) / 3600;
1958 min = ((now - user->
jointime) % 3600) / 60;
1961 ast_cli(a->
fd,
"User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
1972 ast_cli(a->
fd,
"%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
2008 if (strcasecmp(a->
argv[1],
"lock") == 0) {
2016 if (strcasecmp(a->
argv[1],
"mute") == 0) {
2018 if (strcasecmp(a->
argv[3],
"all") == 0) {
2025 if (strcasecmp(a->
argv[3],
"all") == 0) {
2031 }
else if (strcasecmp(a->
argv[1],
"kick") == 0) {
2032 if (strcasecmp(a->
argv[3],
"all") == 0) {
2060 e->
command =
"meetme {lock|unlock}";
2062 "Usage: meetme lock|unlock <confno>\n" 2063 " Lock or unlock a conference to new users.\n";
2082 "Usage: meetme kick <confno> all|<userno>\n" 2083 " Kick a conference or a user in a conference.\n";
2100 e->
command =
"meetme {mute|unmute}";
2102 "Usage: meetme mute|unmute <confno> all|<userno>\n" 2103 " Mute or unmute a conference or a user in a conference.\n";
2118 const char *
hold =
"Unknown";
2120 switch (hold_access) {
2140 e->
command =
"sla show trunks";
2142 "Usage: sla show trunks\n" 2143 " This will list all trunks defined in sla.conf\n";
2150 "=============================================================\n" 2151 "=== Configured SLA Trunks ===================================\n" 2152 "=============================================================\n" 2157 char ring_timeout[16] =
"(none)";
2162 snprintf(ring_timeout,
sizeof(ring_timeout),
"%u Seconds", trunk->
ring_timeout);
2165 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n" 2166 "=== Trunk Name: %s\n" 2167 "=== ==> Device: %s\n" 2168 "=== ==> AutoContext: %s\n" 2169 "=== ==> RingTimeout: %s\n" 2170 "=== ==> BargeAllowed: %s\n" 2171 "=== ==> HoldAccess: %s\n" 2172 "=== ==> Stations ...\n",
2183 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n===\n");
2188 ast_cli(a->
fd,
"=============================================================\n\n");
2195 #define S(e) case e: return # e; 2203 return "Uknown State";
2214 e->
command =
"sla show stations";
2216 "Usage: sla show stations\n" 2217 " This will list all stations defined in sla.conf\n";
2224 "=============================================================\n" 2225 "=== Configured SLA Stations =================================\n" 2226 "=============================================================\n" 2237 snprintf(ring_timeout,
sizeof(ring_timeout),
2241 snprintf(ring_delay,
sizeof(ring_delay),
2244 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n" 2245 "=== Station Name: %s\n" 2246 "=== ==> Device: %s\n" 2247 "=== ==> AutoContext: %s\n" 2248 "=== ==> RingTimeout: %s\n" 2249 "=== ==> RingDelay: %s\n" 2250 "=== ==> HoldAccess: %s\n" 2251 "=== ==> Trunks ...\n",
2252 station->name, station->device,
2253 S_OR(station->autocontext,
"(none)"),
2254 ring_timeout, ring_delay,
2258 snprintf(ring_timeout,
sizeof(ring_timeout),
2261 strcpy(ring_timeout,
"(none)");
2264 snprintf(ring_delay,
sizeof(ring_delay),
2267 strcpy(ring_delay,
"(none)");
2270 ast_cli(a->
fd,
"=== ==> Trunk Name: %s\n" 2271 "=== ==> State: %s\n" 2272 "=== ==> RingTimeout: %s\n" 2273 "=== ==> RingDelay: %s\n",
2276 ring_timeout, ring_delay);
2278 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n" 2284 ast_cli(a->
fd,
"============================================================\n" 2322 x = DAHDI_FLUSH_ALL;
2323 if (ioctl(fd, DAHDI_FLUSH, &x))
2408 if (user == sender) {
2430 if (!(event =
ast_calloc(1,
sizeof(*event)))) {
2471 strsep(&trunk_name,
"_");
2481 if (trunk_ref->
chan == chan && !strcmp(trunk_ref->
trunk->
name, trunk_name)) {
2496 ast_debug(1,
"Trunk not found for event!\n");
2512 if ((sscanf(conf->
confno,
"%4d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) {
2513 conf_map[confno_int] = 0;
2525 char currenttime[32];
2542 confno,
"startTime<= ", currenttime,
2543 "endtime>= ", currenttime,
NULL);
2549 if (!strcasecmp(var->
name,
"bookid")) {
2552 if (!strcasecmp(var->
name,
"endtime")) {
2567 strcat(currenttime,
"0");
2570 confno,
"startTime<= ", currenttime,
2571 "endtime>= ", currenttime,
NULL);
2575 ast_debug(3,
"Trying to update the endtime of Conference %s to %s\n", confno, currenttime);
2591 ast_channel_musicclass_set(chan, musicclass);
2597 ast_channel_musicclass_set(chan, original_moh);
2605 return "conf-hasleft";
2608 return "conf-hasjoin";
2664 if (!current->
vmrec) {
2689 int last_talking = user->
talking;
2690 if (last_talking == talking)
2697 int was_talking = (last_talking > 0);
2698 int now_talking = (talking > 0);
2699 if (was_talking != now_talking) {
2981 if (conf->
users == 1) {
2989 }
else if (conf->
users == 2) {
3047 if (conf->
users == 1) {
3096 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
3102 struct dahdi_confinfo dahdic;
3108 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
3158 switch (*menu_mode) {
3172 recordingtmp, recordingtmp_size, cap_slin);
3181 struct dahdi_confinfo dahdic, dahdic_empty;
3191 int musiconhold = 0, mohtempstopped = 0;
3194 int currentmarked = 0;
3198 int talkreq_manager = 0;
3199 int using_pseudo = 0;
3203 int announcement_played = 0;
3208 const char *agifiledefault =
"conf-background.agi", *tmpvar;
3209 char meetmesecs[30] =
"";
3212 char members[10] =
"";
3213 int dtmf = 0, opt_waitmarked_timeout = 0;
3215 struct dahdi_bufferinfo bi;
3218 char *exitkeys =
NULL;
3219 unsigned int calldurationlimit = 0;
3221 long play_warning = 0;
3222 long warning_freq = 0;
3223 const char *warning_sound =
NULL;
3224 const char *end_sound =
NULL;
3226 long time_left_ms = 0;
3227 struct timeval nexteventts = { 0, };
3229 int setusercount = 0;
3230 int confsilence = 0, totalsilence = 0;
3235 goto conf_run_cleanup;
3240 goto conf_run_cleanup;
3246 (sscanf(optargs[OPT_ARG_WAITMARKED],
"%30d", &opt_waitmarked_timeout) == 1) &&
3247 (opt_waitmarked_timeout > 0)) {
3248 timeout = time(
NULL) + opt_waitmarked_timeout;
3252 calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]);
3253 ast_verb(3,
"Setting call duration limit to %u seconds.\n", calldurationlimit);
3257 char *limit_str, *warning_str, *warnfreq_str;
3261 limit_str =
strsep(&parse,
":");
3262 warning_str =
strsep(&parse,
":");
3263 warnfreq_str =
parse;
3265 timelimit = atol(limit_str);
3267 play_warning = atol(warning_str);
3269 warning_freq = atol(warnfreq_str);
3272 timelimit = play_warning = warning_freq = 0;
3273 warning_sound =
NULL;
3274 }
else if (play_warning > timelimit) {
3275 if (!warning_freq) {
3278 while (play_warning > timelimit)
3279 play_warning -= warning_freq;
3280 if (play_warning < 1)
3281 play_warning = warning_freq = 0;
3285 ast_verb(3,
"Setting conference duration limit to: %ldms.\n", timelimit);
3287 ast_verb(3,
"Setting warning time to %ldms from the conference duration limit.\n", play_warning);
3290 ast_verb(3,
"Setting warning frequency to %ldms.\n", warning_freq);
3299 warning_sound = var ?
var :
"timeleft";
3310 calldurationlimit = 0;
3312 if (!play_warning && !end_sound && timelimit) {
3313 calldurationlimit = timelimit / 1000;
3314 timelimit = play_warning = warning_freq = 0;
3316 ast_debug(2,
"Limit Data for this call:\n");
3317 ast_debug(2,
"- timelimit = %ld\n", timelimit);
3318 ast_debug(2,
"- play_warning = %ld\n", play_warning);
3319 ast_debug(2,
"- warning_freq = %ld\n", warning_freq);
3320 ast_debug(2,
"- warning_sound = %s\n", warning_sound ? warning_sound :
"UNDEF");
3321 ast_debug(2,
"- end_sound = %s\n", end_sound ? end_sound :
"UNDEF");
3328 exitkeys =
ast_strdupa(optargs[OPT_ARG_EXITKEYS]);
3351 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
3363 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
3391 if (calldurationlimit > 0) {
3414 if (rt_schedule && conf->
maxusers) {
3452 mailbox =
strsep(&context,
"@");
3460 context =
"default";
3469 "%s/meetme-username-%s-%d", destdir,
3476 "%s/meetme-username-%s-%d", destdir,
3495 if (rt_log_members) {
3497 snprintf(members,
sizeof(members),
"%d", conf->
users);
3507 if (conf->
users == 1)
3545 int keepplaying = 1;
3547 if (conf->
users == 2) {
3610 fd = open(
"/dev/dahdi/pseudo", O_RDWR | O_NONBLOCK);
3617 memset(&bi, 0,
sizeof(bi));
3619 bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
3620 bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
3622 if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
3628 if (ioctl(fd, DAHDI_SETLINEAR, &x)) {
3639 memset(&dahdic, 0,
sizeof(dahdic));
3640 memset(&dahdic_empty, 0,
sizeof(dahdic_empty));
3643 if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
3648 if (dahdic.confmode) {
3651 ast_debug(1,
"DAHDI channel is in a conference already, retrying with pseudo\n");
3656 memset(&dahdic, 0,
sizeof(dahdic));
3687 dahdic.confmode = DAHDI_CONF_CONF;
3689 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3691 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3693 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3695 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3747 ret =
pbx_exec(chan, agi_app, agifile);
3758 int lastusers = conf->
users;
3766 int menu_was_active = 0;
3772 if (rt_schedule && conf->
endtime) {
3773 char currenttime[32];
3774 long localendtime = 0;
3780 if (now.tv_sec % 60 == 0) {
3785 conf->
confno,
"starttime <=", currenttime,
3786 "endtime >=", currenttime,
NULL);
3788 for ( ;
var; var = var->
next) {
3789 if (!strcasecmp(var->
name,
"endtime")) {
3790 struct ast_tm endtime_tm;
3793 localendtime = tmp.tv_sec;
3800 if (localendtime > conf->
endtime){
3810 if (!announcement_played && conf->
endalert) {
3820 announcement_played = 1;
3825 announcement_played = 0;
3846 int minutes = 0, seconds = 0, remain = 0;
3853 if (time_left_ms < to) {
3857 if (time_left_ms <= 0) {
3871 if (time_left_ms >= 5000) {
3873 remain = (time_left_ms + 500) / 1000;
3874 if (remain / 60 >= 1) {
3875 minutes = remain / 60;
3876 seconds = remain % 60;
3915 if (timeout && now.tv_sec >= timeout) {
3931 menu_was_active = menu_mode;
3938 if (currentmarked == 1 && conf->
users > 1) {
3940 if (conf->
users - 1 == 1) {
3961 if (currentmarked == 0) {
3962 if (lastmarked != 0) {
3974 dahdic.confmode = DAHDI_CONF_CONF;
3975 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3986 }
else if (currentmarked >= 1 && lastmarked == 0) {
3990 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3992 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3994 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3996 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
4017 if (conf->
users == 1) {
4041 if (conf->
users != lastusers) {
4042 if (conf->
users < lastusers) {
4045 lastusers = conf->
users;
4053 dahdic.confmode ^= DAHDI_CONF_TALKER;
4054 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
4070 dahdic.confmode |= DAHDI_CONF_TALKER;
4071 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
4083 talkreq_manager = 1;
4090 talkreq_manager = 0;
4127 ast_debug(1,
"Ooh, something swapped out under us, starting over\n");
4186 if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
4202 }
else if (!menu_mode) {
4206 menu_to_play =
"conf-adminmenu-18";
4209 menu_to_play =
"conf-usermenu-162";
4224 chan, user, recordingtmp,
sizeof(recordingtmp), cap_slin);
4227 if (musiconhold && !menu_mode) {
4232 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
4250 ast_debug(1,
"Got DTMF %c, goto context %s\n", dtmfstr[0], exitcontext);
4255 ast_debug(2,
"Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", dtmfstr, exitcontext);
4289 "Got ignored control frame on channel %s, f->frametype=%u,f->subclass=%d\n",
4294 "Got unrecognized frame on channel %s, f->frametype=%u,f->subclass=%d\n",
4298 }
else if (outfd > -1) {
4301 memset(&fr, 0,
sizeof(fr));
4319 if (idx >= AST_FRAME_BITS) {
4320 goto bailoutandtrynormal;
4363 goto bailoutandtrynormal;
4367 bailoutandtrynormal:
4390 lastmarked = currentmarked;
4404 dahdic.confmode = 0;
4405 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
4455 if (rt_log_members) {
4457 snprintf(members,
sizeof(members),
"%d", conf->
users);
4482 snprintf(meetmesecs,
sizeof(meetmesecs),
"%d", (
int) (time(
NULL) - user->
jointime));
4501 char *dynamic_pin,
size_t pin_buf_len,
int refcount,
struct ast_flags64 *confflags,
int *too_early,
char **optargs)
4511 if (!strcmp(confno, cnf->
confno)) {
4524 char recordingfilename[256] =
"";
4525 char recordingformat[11] =
"";
4526 char currenttime[32] =
"";
4527 char eatime[32] =
"";
4528 char bookid[51] =
"";
4533 struct timeval endtime = { .tv_sec = 0 };
4542 ast_debug(1,
"Looking for conference %s that starts after %s\n", confno, currenttime);
4545 confno,
"starttime <= ", currenttime,
"endtime >= ",
4548 if (!var && fuzzystart) {
4555 confno,
"starttime <= ", currenttime,
"endtime >= ",
4559 if (!var && earlyalert) {
4565 confno,
"starttime <= ", eatime,
"endtime >= ",
4580 if (rt_schedule && *too_early) {
4589 for (origvar = var;
var; var = var->
next) {
4590 if (!strcasecmp(var->
name,
"pin")) {
4592 }
else if (!strcasecmp(var->
name,
"adminpin")) {
4594 }
else if (!strcasecmp(var->
name,
"bookId")) {
4596 }
else if (!strcasecmp(var->
name,
"opts")) {
4598 }
else if (!strcasecmp(var->
name,
"maxusers")) {
4599 maxusers = atoi(var->
value);
4600 }
else if (!strcasecmp(var->
name,
"adminopts")) {
4602 }
else if (!strcasecmp(var->
name,
"recordingfilename")) {
4604 }
else if (!strcasecmp(var->
name,
"recordingformat")) {
4606 }
else if (!strcasecmp(var->
name,
"endtime")) {
4607 struct ast_tm endtime_tm;
4615 cnf =
build_conf(confno, pin ? pin :
"", pinadmin ? pinadmin :
"", make, dynamic, refcount, chan,
NULL);
4622 cnf->
endtime = endtime.tv_sec;
4673 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4677 if (confflags && !cnf->
chan &&
4679 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4703 ast_debug(1,
"The requested confno is '%s'?\n", confno);
4707 if (!strcmp(confno, cnf->
confno))
4718 ast_debug(1,
"Building dynamic conference '%s'\n", confno);
4720 if (dynamic_pin[0] ==
'q') {
4722 if (
ast_app_getdata(chan,
"conf-getpin", dynamic_pin, pin_buf_len - 1, 0) < 0)
4725 cnf =
build_conf(confno, dynamic_pin,
"", make, dynamic, refcount, chan,
NULL);
4727 cnf =
build_conf(confno,
"",
"", make, dynamic, refcount, chan,
NULL);
4743 if (strcasecmp(var->
name,
"conf"))
4749 ast_debug(3,
"Will conf %s match %s?\n", confno, args.confno);
4750 if (!strcasecmp(args.confno, confno)) {
4754 S_OR(args.pinadmin,
""),
4755 make, dynamic, refcount, chan,
NULL);
4760 ast_debug(1,
"%s isn't a valid conference\n", confno);
4764 }
else if (dynamic_pin) {
4768 if (dynamic_pin[0] ==
'q') {
4769 dynamic_pin[0] =
'\0';
4774 if (confflags && !cnf->
chan &&
4777 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4781 if (confflags && !cnf->
chan &&
4783 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4816 count = conf->
users;
4824 snprintf(val,
sizeof(val),
"%d", count);
4847 int empty = 0, empty_no_pin = 0;
4848 int always_prompt = 0;
4849 const char *notdata;
4886 strcpy(the_pin,
"q");
4903 if ((empty_no_pin) || (!dynamic)) {
4909 if (!strcasecmp(var->
name,
"conf")) {
4912 confno_tmp =
strsep(&stringp,
"|,");
4917 if (!strcmp(confno_tmp, cnf->
confno)) {
4956 if (!strcmp(confno_tmp, cnf->
confno)) {
4983 for (i = 0; i <
ARRAY_LEN(conf_map); i++) {
4985 snprintf(confno,
sizeof(confno),
"%d", i);
5000 if (sscanf(confno,
"%30d", &confno_int) == 1) {
5016 res =
ast_app_getdata(chan,
"conf-getconfno", confno,
sizeof(confno) - 1, 0);
5026 cnf =
find_conf(chan, confno, 1, dynamic, the_pin,
5027 sizeof(the_pin), 1, &confflags);
5032 the_pin,
sizeof(the_pin), 1, &confflags, &too_early, optargs);
5033 if (rt_schedule && too_early)
5066 if (req_pin && not_exempt) {
5071 for (j = 0; j < 3; j++) {
5072 if (*the_pin && (always_prompt == 0)) {
5080 res =
ast_app_getdata(chan,
"conf-getpin", pin + strlen(pin),
sizeof(pin) - 1 - strlen(pin), 0);
5083 if ((!strcasecmp(pin, cnf->
pin) &&
5087 !strcasecmp(pin, cnf->
pinadmin))) {
5103 res =
conf_run(chan, cnf, &confflags, optargs);
5131 if (*the_pin && (always_prompt == 0)) {
5148 res =
conf_run(chan, cnf, &confflags, optargs);
5154 }
while (allowretry);
5167 if (conf && callerident && sscanf(callerident,
"%30d", &cid) == 1) {
5245 if (!args.command) {
5253 if (!strcmp(cnf->
confno, args.confno))
5275 switch (*args.command) {
5292 switch (*args.command) {
5407 if (!args.channel) {
5412 if (!args.command) {
5431 switch (*args.command) {
5469 userno = strtoul(userid, &userid, 10);
5479 if (!strcmp(confid, conf->
confno))
5525 char idText[80] =
"";
5532 snprintf(idText,
sizeof(idText),
"ActionID: %s\r\n", actionid);
5553 "Event: MeetmeList\r\n" 5555 "Conference: %s\r\n" 5556 "UserNumber: %d\r\n" 5557 "CallerIDNum: %s\r\n" 5558 "CallerIDName: %s\r\n" 5559 "ConnectedLineNum: %s\r\n" 5560 "ConnectedLineName: %s\r\n" 5564 "MarkedUser: %s\r\n" 5580 user->
talking > 0 ?
"Yes" : user->
talking == 0 ?
"No" :
"Not monitored");
5596 char idText[80] =
"";
5604 snprintf(idText,
sizeof(idText),
"ActionID: %s\r\n", actionid);
5622 strcpy(markedusers,
"N/A");
5626 hr = (now - cnf->
start) / 3600;
5627 min = ((now - cnf->
start) % 3600) / 60;
5628 sec = (now - cnf->
start) % 60;
5631 "Event: MeetmeListRooms\r\n" 5633 "Conference: %s\r\n" 5636 "Activity: %2.2d:%2.2d:%2.2d\r\n" 5646 cnf->
locked ?
"Yes" :
"No");
5667 }
else if (filename[0] !=
'/') {
5674 if ((slash = strrchr(slash,
'/'))) {
5689 const char *oldrecordingfilename =
NULL;
5692 if (!cnf || !cnf->
lchan) {
5696 filename_buffer[0] =
'\0';
5700 flags = O_CREAT | O_TRUNC | O_WRONLY;
5710 if (!s && !(
ast_strlen_zero(filename_buffer)) && (filename_buffer != oldrecordingfilename)) {
5712 oldrecordingfilename = filename_buffer;
5757 if (!strcmp(data, conf->
confno))
5810 if ((sscanf(val,
"%30d", &audio_buffers) != 1)) {
5813 }
else if ((audio_buffers < DAHDI_DEFAULT_NUM_BUFS) || (audio_buffers > DAHDI_MAX_NUM_BUFS)) {
5815 DAHDI_DEFAULT_NUM_BUFS, DAHDI_MAX_NUM_BUFS);
5827 if ((sscanf(val,
"%30d", &fuzzystart) != 1)) {
5833 if ((sscanf(val,
"%30d", &earlyalert) != 1)) {
5839 if ((sscanf(val,
"%30d", &endalert) != 1)) {
5845 if ((sscanf(val,
"%30d", &extendby) != 1)) {
5889 if (trunk_ref->
trunk != trunk || station_ref->
station == station)
5916 if (strcasecmp(trunk_ref->
trunk->
name, name))
5967 if (!(ringing_station =
ast_calloc(1,
sizeof(*ringing_station))))
5974 return ringing_station;
5979 if (ringing_station->
station) {
5991 if (!(failed_station =
ast_calloc(1,
sizeof(*failed_station)))) {
5999 return failed_station;
6004 if (failed_station->
station) {
6040 if (trunk_ref->
trunk != trunk || (inactive_only ? trunk_ref->
chan : 0)
6041 || trunk_ref == exclude) {
6046 "SLA:%s_%s", station->name, trunk->
name);
6121 snprintf(buf,
sizeof(buf),
"SLA_%s,K", ringing_trunk->
trunk->
name);
6153 if (ringing_trunk->
trunk == trunk_ref->
trunk)
6181 if (station == timed_out_station->
station)
6205 if (s_trunk_ref->
trunk != ringing_trunk->
trunk)
6218 *trunk_ref = s_trunk_ref;
6229 return ringing_trunk;
6241 pthread_t dont_care;
6260 if (!ringing_trunk) {
6266 ast_debug(1,
"Found no ringing trunk for station '%s' to answer!\n", ringing_station->
station->name);
6322 if (station == ringing_station->
station)
6338 if (station != failed_station->
station)
6357 char *tech, *tech_data;
6361 int caller_is_saved;
6369 tech =
strsep(&tech_data,
"/");
6377 caller_is_saved = 0;
6378 if (!
sla.attempt_callerid) {
6379 caller_is_saved = 1;
6387 if (caller_is_saved) {
6406 station->
dial = dial;
6420 if (trunk_ref->
chan)
6433 if (trunk_ref->
trunk == trunk)
6451 unsigned int delay = UINT_MAX;
6452 int time_left, time_elapsed;
6459 if (!ringing_trunk || !trunk_ref)
6465 delay = trunk_ref->ring_delay;
6472 time_left = (delay * 1000) - time_elapsed;
6511 if (time_left != INT_MAX && time_left > 0)
6531 if (trunk_ref->
trunk == ringing_trunk->
trunk)
6571 event->trunk_ref->trunk->on_hold = 1;
6576 event->trunk_ref->chan =
NULL;
6589 int time_left, time_elapsed;
6594 if (time_left <= 0) {
6601 if (time_left < *timeout)
6602 *timeout = time_left;
6620 unsigned int ring_timeout = 0;
6621 int time_elapsed, time_left = INT_MAX, final_trunk_time_left = INT_MIN;
6629 int trunk_time_elapsed, trunk_time_left;
6632 if (ringing_trunk->
trunk == trunk_ref->
trunk)
6654 trunk_time_left = (trunk_ref->
ring_timeout * 1000) - trunk_time_elapsed;
6655 if (trunk_time_left > final_trunk_time_left)
6656 final_trunk_time_left = trunk_time_left;
6667 time_left = (ring_timeout * 1000) - time_elapsed;
6672 if (final_trunk_time_left > INT_MIN && final_trunk_time_left < time_left)
6673 time_left = final_trunk_time_left;
6676 if (time_left <= 0) {
6685 if (time_left < *timeout)
6686 *timeout = time_left;
6725 if (time_left <= 0) {
6730 if (time_left < *timeout)
6731 *timeout = time_left;
6742 unsigned int timeout = UINT_MAX;
6743 struct timeval wait;
6744 unsigned int change_made = 0;
6763 if (timeout == UINT_MAX)
6768 ts->tv_sec = wait.tv_sec;
6769 ts->tv_nsec = wait.tv_usec * 1000;
6779 event->trunk_ref =
NULL;
6784 event->station =
NULL;
6799 struct timespec ts = { 0, };
6800 unsigned int have_timeout = 0;
6816 switch (event->
type) {
6856 char *tech, *tech_data;
6863 int caller_is_saved;
6866 int current_state = 0;
6875 tech_data =
ast_strdupa(trunk_ref->trunk->device);
6876 tech =
strsep(&tech_data,
"/");
6886 caller_is_saved = 0;
6887 if (!
sla.attempt_callerid) {
6888 caller_is_saved = 1;
6896 if (caller_is_saved) {
6910 unsigned int done = 0;
6935 ast_debug(3,
"Originating station device %s no longer active\n", station->device);
6936 trunk_ref->trunk->chan =
NULL;
6941 if (current_state != last_state) {
6944 last_state = current_state;
6951 if (!trunk_ref->trunk->chan) {
6960 snprintf(conf_name,
sizeof(conf_name),
"SLA_%s", trunk_ref->trunk->name);
6964 conf =
build_conf(conf_name,
"",
"", 1, 1, 1, trunk_ref->trunk->chan,
NULL);
6971 conf_run(trunk_ref->trunk->chan, conf, &conf_flags,
NULL);
6979 trunk_ref->trunk->chan =
NULL;
6980 trunk_ref->trunk->on_hold = 0;
7008 char *station_name, *trunk_name;
7022 station_name =
strsep(&trunk_name,
"_");
7051 "'%s' due to access controls.\n", trunk_name);
7063 "SLA:%s_%s", station->name, trunk_ref->trunk->name);
7070 if (ringing_trunk->
trunk == trunk_ref->trunk) {
7078 if (ringing_trunk) {
7090 trunk_ref->chan = chan;
7092 if (!trunk_ref->trunk->chan) {
7095 pthread_t dont_care;
7147 strncat(conf_name,
",K",
sizeof(conf_name) - strlen(conf_name) - 1);
7162 if (trunk_ref->
trunk) {
7186 if (!(ringing_trunk =
ast_calloc(1,
sizeof(*ringing_trunk)))) {
7202 return ringing_trunk;
7207 if (ringing_trunk->
trunk) {
7244 ast_log(
LOG_ERROR,
"The SLATrunk application requires an argument, the trunk name\n");
7250 if (args.argc == 2) {
7266 ast_log(
LOG_ERROR,
"Call came in on %s, but the trunk is already in use!\n",
7279 snprintf(conf_name,
sizeof(conf_name),
"SLA_%s", args.trunk_name);
7294 conf_run(chan, conf, &conf_flags, opts);
7308 if (ringing_trunk->
trunk == trunk) {
7315 if (ringing_trunk) {
7328 char *
buf, *station_name, *trunk_name;
7334 station_name =
strsep(&trunk_name,
"_");
7340 if (!strcasecmp(trunk_name, trunk_ref->
trunk->
name)) {
7349 ast_log(
LOG_ERROR,
"Could not determine state for trunk %s on station %s!\n",
7350 trunk_name, station_name);
7384 ast_debug(1,
"sla_station destructor for '%s'\n", station->name);
7392 snprintf(exten,
sizeof(exten),
"%s_%s", station->name, trunk_ref->
trunk->
name);
7393 snprintf(hint,
sizeof(hint),
"SLA:%s", exten);
7408 struct sla_trunk *trunk = obj, *trunk2 = arg;
7415 struct sla_station *station = obj, *station2 = arg;
7427 pthread_join(
sla.thread,
NULL);
7443 sla_stations =
NULL;
7448 char *tech, *tech_data;
7451 tech =
strsep(&tech_data,
"/");
7463 ast_debug(1,
"sla_trunk destructor for '%s'\n", trunk->
name);
7479 int existing_trunk = 0;
7509 if (!strcasecmp(var->
name,
"autocontext"))
7511 else if (!strcasecmp(var->
name,
"ringtimeout")) {
7512 if (sscanf(var->
value,
"%30u", &trunk->ring_timeout) != 1) {
7514 var->
value, trunk->name);
7515 trunk->ring_timeout = 0;
7517 }
else if (!strcasecmp(var->
name,
"barge"))
7519 else if (!strcasecmp(var->
name,
"hold")) {
7520 if (!strcasecmp(var->
value,
"private"))
7522 else if (!strcasecmp(var->
value,
"open"))
7526 var->
value, trunk->name);
7528 }
else if (strcasecmp(var->
name,
"type") && strcasecmp(var->
name,
"device")) {
7539 "context '%s' for SLA!\n", trunk->autocontext);
7546 "for trunk '%s'!\n", trunk->name);
7551 if (!existing_trunk) {
7567 char *trunk_name, *
options, *cur;
7568 int existing_trunk_ref = 0;
7569 int existing_station_ref = 0;
7572 trunk_name =
strsep(&options,
",");
7581 if (trunk_ref->
trunk == trunk) {
7582 trunk_ref->
mark = 0;
7583 existing_trunk_ref = 1;
7594 while ((cur =
strsep(&options,
","))) {
7596 name =
strsep(&value,
"=");
7597 if (!strcasecmp(name,
"ringtimeout")) {
7598 if (sscanf(value,
"%30u", &trunk_ref->
ring_timeout) != 1) {
7600 "trunk '%s' on station '%s'\n", value, trunk->name, station->name);
7603 }
else if (!strcasecmp(name,
"ringdelay")) {
7604 if (sscanf(value,
"%30u", &trunk_ref->
ring_delay) != 1) {
7606 "trunk '%s' on station '%s'\n", value, trunk->name, station->name);
7611 "trunk '%s' on station '%s'\n", name, trunk->name, station->name);
7616 if (station_ref->
station == station) {
7617 station_ref->
mark = 0;
7618 existing_station_ref = 1;
7624 if (!existing_trunk_ref) {
7627 trunk_ref->
mark = 1;
7632 if (!existing_station_ref) {
7639 if (!existing_trunk_ref) {
7651 int existing_station = 0;
7660 existing_station = 1;
7675 if (!strcasecmp(var->
name,
"trunk")) {
7679 }
else if (!strcasecmp(var->
name,
"autocontext")) {
7681 }
else if (!strcasecmp(var->
name,
"ringtimeout")) {
7682 if (sscanf(var->
value,
"%30u", &station->ring_timeout) != 1) {
7684 var->
value, station->name);
7685 station->ring_timeout = 0;
7687 }
else if (!strcasecmp(var->
name,
"ringdelay")) {
7688 if (sscanf(var->
value,
"%30u", &station->ring_delay) != 1) {
7690 var->
value, station->name);
7691 station->ring_delay = 0;
7693 }
else if (!strcasecmp(var->
name,
"hold")) {
7694 if (!strcasecmp(var->
value,
"private"))
7696 else if (!strcasecmp(var->
value,
"open"))
7700 var->
value, station->name);
7703 }
else if (strcasecmp(var->
name,
"type") && strcasecmp(var->
name,
"device")) {
7716 "context '%s' for SLA!\n", station->autocontext);
7724 "for trunk '%s'!\n", station->name);
7730 snprintf(exten,
sizeof(exten),
"%s_%s", station->name, trunk_ref->
trunk->
name);
7731 snprintf(hint,
sizeof(hint),
"SLA:%s", exten);
7737 "for trunk '%s'!\n", station->name);
7745 "for trunk '%s'!\n", station->name);
7751 if (!existing_station) {
7768 station_ref->
mark = 1;
7786 trunk_ref->
mark = 1;
7808 if (!station_ref->
mark) {
7828 if (station->
mark) {
7836 if (!trunk_ref->
mark) {
7859 const char *cat =
NULL;
7891 if (!strcasecmp(cat,
"general"))
7898 if (!strcasecmp(type,
"trunk"))
7900 else if (!strcasecmp(type,
"station"))
7925 if (!strcasecmp(
"lock", keyword)) {
7927 }
else if (!strcasecmp(
"parties", keyword)) {
7929 }
else if (!strcasecmp(
"activity", keyword)) {
7932 return (now - conf->
start);
7933 }
else if (!strcasecmp(
"dynamic", keyword)) {
7965 ast_log(
LOG_ERROR,
"Syntax: MEETME_INFO() requires a conference number\n");
7971 if (!strcmp(args.confno, conf->
confno)) {
7979 snprintf(buf, len,
"%d", result);
7980 }
else if (result == -1) {
7982 snprintf(buf, len,
"0");
7983 }
else if (result == -2) {
7985 snprintf(buf, len,
"0");
7993 .
name =
"MEETME_INFO",
8084 .optional_modules =
"func_speex",
const ast_string_field name
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
unsigned int active_stations
static void meetme_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ast_variable * ast_load_realtime(const char *family,...) attribute_sentinel
static char musicclass[MAX_MUSICCLASS]
struct ast_variable * next
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
static int conf_free(struct ast_conference *conf)
Remove the conference from the list and free it.
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
enum sip_cc_notify_state state
static struct sla_trunk_ref * sla_choose_idle_trunk(const struct sla_station *station)
For a given station, choose the highest priority idle trunk.
const char * warning_sound
#define ast_channel_lock(chan)
static char exten[AST_MAX_EXTENSION]
static char * complete_meetmecmd_list(const char *line, const char *word, int pos, int state)
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
ast_device_state
Device States.
#define ast_frdup(fr)
Copies a frame.
char * str
Subscriber phone number (Malloced)
int ast_dial_destroy(struct ast_dial *dial)
Destroys a dialing structure.
static void sla_add_trunk_to_station(struct sla_station *station, struct ast_variable *var)
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
#define AST_LIST_LOCK(head)
Locks a list.
struct sla_trunk_ref * trunk_ref
static int user_chan_cb(void *obj, void *args, int flags)
static int action_meetmelistrooms(struct mansession *s, const struct message *m)
static struct ast_conf_user * find_user(struct ast_conference *conf, const char *callerident)
Asterisk locking-related definitions:
static const char * get_announce_filename(enum announcetypes type)
static struct @35 sla
A structure for data used by the sla thread.
void astman_append(struct mansession *s, const char *fmt,...)
Asterisk main include file. File version handling, generic pbx functions.
static void sla_handle_ringing_trunk_event(void)
static int dispose_conf(struct ast_conference *conf)
Decrement reference counts, as incremented by find_conf()
struct timeval start_time
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
static void tweak_talk_volume(struct ast_conf_user *user, enum volume_action action)
struct ast_channel * chan
#define ast_copy_flags64(dest, src, flagz)
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)
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
unsigned int ring_timeout
#define AST_OPTION_TXGAIN
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
static int careful_write(int fd, unsigned char *data, int len, int block)
static void sla_ring_stations(void)
Ring stations based on current set of ringing trunks.
static int sla_build_station(struct ast_config *cfg, const char *cat)
Main dialing structure. Contains global options, channels being dialed, and more! ...
static struct ast_conference * find_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)
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
static int rt_extend_conf(const char *confno)
static int user_set_unmuted_cb(void *obj, void *check_admin_arg, int flags)
static void sla_queue_event_nolock(enum sla_event_type type)
static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
static unsigned char leave[]
static char * meetme_kick_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static char * meetme_mute_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ast_party_id id
Connected party ID.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
static unsigned char enter[]
#define ast_test_flag(p, flag)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
static void sla_ringing_station_destroy(struct sla_ringing_station *ringing_station)
struct sla_station * station
Support for translation of data formats. translate.c.
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
static void meetme_set_defaults(void)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_party_name name
Subscriber name.
struct ast_frame * origframe
void ast_dsp_free(struct ast_dsp *dsp)
static void * recordthread(void *args)
static int action_meetmeunmute(struct mansession *s, const struct message *m)
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
static const char *const app4
static int sla_check_station_hold_access(const struct sla_trunk *trunk, const struct sla_station *station)
const ast_string_field autocontext
struct ast_channel * confchan
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
static const char * istalking(int x)
struct ast_channel_snapshot * snapshot
Convenient Signal Processing routines.
static void hold(struct ast_channel *chan)
Helper method to place a channel in a bridge on hold.
#define CONFFLAG_INTROUSER_VMREC
#define MEETME_DELAYDETECTENDTALK
static int meetme_stasis_init(void)
sla_event_type
Event types that can be queued up for the SLA thread.
static int conf_exec(struct ast_channel *chan, const char *data)
The meetme() application.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
void astman_send_list_complete_start(struct mansession *s, const struct message *m, const char *event_name, int count)
Start the list complete event.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
descriptor for a cli entry.
struct ast_channel * chan
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
static int sla_station_mark(void *obj, void *arg, int flags)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int user_listen_volup_cb(void *obj, void *unused, int flags)
static void sla_dial_state_callback(struct ast_dial *dial)
static int user_reset_vol_cb(void *obj, void *unused, int flags)
#define ao2_callback(c, flags, cb_fn, arg)
int ast_unload_realtime(const char *family)
Release any resources cached for a realtime family.
#define CONFIG_STATUS_FILEINVALID
struct ast_dsp * ast_dsp_new(void)
Allocates a new dsp, assumes 8khz for internal sample rate.
struct announce_listitem::@38 entry
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
struct ast_conference::@40 announcelist
Structure for variables, used for configurations and for channel variables.
#define CONFFLAG_DONT_DENOISE
struct ast_frame * transframe[32]
static int sla_check_ringing_station(const struct sla_station *station)
Check to see if this station is already ringing.
static const char *const app2
static int count_exec(struct ast_channel *chan, const char *data)
The MeetmeCount application.
static int load_module(void)
Load the module.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
static void sla_change_trunk_state(const struct sla_trunk *trunk, enum sla_trunk_state state, enum sla_which_trunk_refs inactive_only, const struct sla_trunk_ref *exclude)
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
static const struct ast_app_option meetme_opts[128]
int ast_devstate_prov_del(const char *label)
Remove device state provider.
A station that is ringing.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
static int sla_calc_station_delays(unsigned int *timeout)
Calculate the ring delay for a station.
ast_channel_state
ast_channel states
static void sla_event_destroy(struct sla_event *event)
char * str
Subscriber name (Malloced)
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
static const char *const slastation_app
#define ast_cond_wait(cond, mutex)
void ast_party_caller_free(struct ast_party_caller *doomed)
Destroy the caller party contents.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_cond_init(cond, attr)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static struct aco_type item
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)
Find or create a conference.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
Add device state provider.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define ast_set_flag64(p, flag)
static void sla_stop_ringing_trunk(struct sla_ringing_trunk *ringing_trunk)
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
static char * sla_show_stations(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void astman_send_ack(struct mansession *s, const struct message *m, char *msg)
Send ack in manager transaction.
#define ast_mutex_lock(a)
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
A reference to a station.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
void ast_verbose(const char *fmt,...)
#define ast_strdup(str)
A wrapper for strdup()
static void answer_trunk_chan(struct ast_channel *chan)
static int hangup(void *data)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static int action_meetmelist(struct mansession *s, const struct message *m)
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
const ast_string_field device
static struct stasis_message_router * meetme_event_message_router
static void * sla_thread(void *data)
int ast_filedelete(const char *filename, const char *fmt)
Deletes a file.
struct sla_trunk_ref * trunk_ref
void ast_cli(int fd, const char *fmt,...)
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block)
Sets an option on a channel.
static void sla_queue_event(enum sla_event_type type)
Structure used to handle a large number of boolean flags == used only in app_dial?
int ast_unregister_application(const char *app)
Unregister an application.
struct ast_conf_user::@41 list
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 char * complete_meetmecmd_mute_kick(const char *line, const char *word, int pos, int state)
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
void ast_free_ptr(void *ptr)
free() wrapper
#define ast_cond_signal(cond)
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
static int sla_ring_station(struct sla_ringing_trunk *ringing_trunk, struct sla_station *station)
Ring a station.
static void conf_play(struct ast_channel *chan, struct ast_conference *conf, enum entrance_sound sound)
#define ast_pthread_create_detached_background(a, b, c, d)
int ast_update_realtime(const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel
Update realtime configuration.
#define ast_verb(level,...)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
static int sla_check_station_delay(struct sla_station *station, struct sla_ringing_trunk *ringing_trunk)
Calculate the ring delay for a given ringing trunk on a station.
static struct sla_failed_station * sla_create_failed_station(struct sla_station *station)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
static int user_max_cmp(void *obj, void *arg, int flags)
struct ast_frame_subclass subclass
static enum ast_device_state sla_state_to_devstate(enum sla_trunk_state state)
int ast_context_remove_extension(const char *context, const char *extension, int priority, const char *registrar)
Simply remove extension from context.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
Blob of data associated with a channel.
static struct ast_json * status_to_json(int on)
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
static const struct ast_app_option sla_trunk_opts[128]
#define CONFFLAG_INTROMSG
pthread_cond_t ast_cond_t
#define ast_strlen_zero(foo)
enum sla_trunk_state state
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.
All configuration options for statsd client.
static int user_listen_voldown_cb(void *obj, void *unused, int flags)
int ast_record_review(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, const char *path)
Allow to record message and have a review option.
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)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define ast_pthread_create_background(a, b, c, d)
static int sla_load_config(int reload)
static int user_set_kickme_cb(void *obj, void *check_admin_arg, int flags)
static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struct ast_flags64 *confflags, char *optargs[])
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
struct ast_party_id id
Caller party ID.
void ast_dial_set_state_callback(struct ast_dial *dial, ast_dial_state_callback callback)
Set a callback for state changes.
Configuration File Parser.
#define CONFFLAG_KILL_LAST_MAN_STANDING
static char mailbox[AST_MAX_MAILBOX_UNIQUEID]
static int user_no_cmp(void *obj, void *arg, int flags)
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
static char exitcontext[AST_MAX_CONTEXT]
#define ast_debug(level,...)
Log a DEBUG message.
u-Law to Signed linear conversion
static void sla_station_destructor(void *obj)
#define ast_config_load(filename, flags)
Load a config file.
struct sla_station * station
ast_dial_result
List of return codes for dial run API calls.
struct ast_trans_pvt * ast_translator_build_path(struct ast_format *dest, struct ast_format *source)
Builds a translator path Build a path (possibly NULL) from source to dest.
int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt,...)
Tells Asterisk the State for Device is changed.
static int can_write(struct ast_channel *chan, struct ast_flags64 *confflags)
General Asterisk PBX channel definitions.
Asterisk JSON abstraction layer.
static void * run_station(void *data)
int ast_realtime_require_field(const char *family,...) attribute_sentinel
Inform realtime what fields that may be stored.
static int unload_module(void)
Asterisk file paths, configured in asterisk.conf.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
void astman_send_list_complete_end(struct mansession *s)
End the list complete event.
struct timeval ring_begin
enum ast_dial_result ast_dial_join(struct ast_dial *dial)
Cancel async thread.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_test_status_update(a, b, c...)
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
static const struct _map_x_s dtmfstr[]
mapping between dtmf flags and strings
#define AST_PTHREADT_NULL
static int sla_calc_station_timeouts(unsigned int *timeout)
Process station ring timeouts.
Data structure associated with a custom dialplan function.
#define AST_MAX_EXTENSION
#define AST_STRING_FIELD(name)
Declare a string field.
Caller Party information.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define ao2_ref(o, delta)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_softhangup(struct ast_channel *chan, int reason)
Softly hangup up a channel.
static void sla_queue_event_full(enum sla_event_type type, struct sla_trunk_ref *trunk_ref, struct sla_station *station, int lock)
void ast_config_destroy(struct ast_config *config)
Destroys a config.
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
static struct sla_station_ref * sla_create_station_ref(struct sla_station *station)
struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate)
Returns a timeval corresponding to the duration of n samples at rate r. Useful to convert samples to ...
static enum ast_device_state sla_state(const char *data)
static struct ast_custom_function meetme_info_acf
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int sla_process_timers(struct timespec *ts)
Calculate the time until the next known event.
static int meetmemute(struct mansession *s, const struct message *m, int mute)
static void conf_start_moh(struct ast_channel *chan, const char *musicclass)
int ast_atomic_dec_and_test(volatile int *p)
decrement *p by 1 and return true if the variable has reached 0.
static enum ast_device_state meetmestate(const char *data)
Callback for devicestate providers.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
static struct sla_ringing_station * sla_create_ringing_station(struct sla_station *station)
static int sla_trunk_cmp(void *obj, void *arg, int flags)
unsigned int barge_disabled
static void tweak_listen_volume(struct ast_conf_user *user, enum volume_action action)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
static int sla_station_exec(struct ast_channel *chan, const char *data)
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
static void sla_trunk_destructor(void *obj)
AST_LIST_HEAD_NOLOCK(contactliststruct, contact)
struct sla_station * station
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
static struct sla_trunk_ref * create_trunk_ref(struct sla_trunk *trunk)
struct timeval ring_begin
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
static void tweak_volume(struct volume *vol, enum volume_action action)
ast_mutex_t announcelistlock
void ast_channel_caller_set(struct ast_channel *chan, struct ast_party_caller *value)
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
static int action_meetmemute(struct mansession *s, const struct message *m)
static void reset_volumes(struct ast_conf_user *user)
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)
enum ast_dial_result ast_dial_state(struct ast_dial *dial)
Return state of dial.
Core PBX routines and definitions.
char * ast_strptime(const char *s, const char *format, struct ast_tm *tm)
Special version of strptime(3) which places the answer in the common structure ast_tm. Also, unlike strptime(3), ast_strptime() initializes its memory prior to use.
int ast_app_parse_options64(const struct ast_app_option *options, struct ast_flags64 *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
enum ast_dial_result ast_dial_run(struct ast_dial *dial, struct ast_channel *chan, int async)
Execute dialing synchronously or asynchronously.
#define stasis_message_router_create(topic)
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
static void conf_flush(int fd, struct ast_channel *chan)
static void * announce_thread(void *data)
#define CONFIG_STATUS_FILEUNCHANGED
static int set_talk_volume(struct ast_conf_user *user, int volume)
#define AST_LIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
static void sla_destroy(void)
#define ast_test_suite_event_notify(s, f,...)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
static char * meetme_cmd_helper(struct ast_cli_args *a)
static int sla_in_use(void)
struct sla_trunk_ref * trunk_ref
static int acf_meetme_info_eval(const char *keyword, const struct ast_conference *conf)
struct ast_config * ast_load_realtime_multientry(const char *family,...) attribute_sentinel
Retrieve realtime configuration.
unsigned int num_stations
static struct sla_trunk_ref * sla_find_trunk_ref(const struct sla_station *station, const struct sla_trunk *trunk)
static struct sla_ringing_trunk * sla_choose_ringing_trunk(struct sla_station *station, struct sla_trunk_ref **trunk_ref, int rm)
Choose the highest priority ringing trunk for a station.
static char * sla_show_trunks(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
struct sla_trunk::@43 stations
struct ast_flags64 userflags
static void sla_ringing_trunk_destroy(struct sla_ringing_trunk *ringing_trunk)
#define DEFAULT_AUDIO_BUFFERS
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static int sla_trunk_exec(struct ast_channel *chan, const char *data)
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
#define AST_OPTION_RXGAIN
struct ast_channel * chan
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)
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define ao2_unlink(container, obj)
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
STASIS_MESSAGE_TYPE_DEFN_LOCAL(meetme_join_type)
static unsigned int monitor
enum recording_state recording
static int user_talk_volup_cb(void *obj, void *unused, int flags)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence_ms, const char *path)
Record a file based on input from a channel. Use default accept and cancel DTMF. This function will p...
int ast_dial_append(struct ast_dial *dial, const char *tech, const char *device, const struct ast_assigned_ids *assignedids)
Append a channel.
struct ast_filestream * ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode)
Starts writing a file.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
static struct ast_cli_entry cli_meetme[]
char namerecloc[PATH_MAX]
static int set_listen_volume(struct ast_conf_user *user, int volume)
static void load_config_meetme(int reload)
#define ao2_iterator_next(iter)
#define ast_cond_destroy(cond)
#define ao2_alloc(data_size, destructor_fn)
static int rt_log_members
int ast_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority)
struct stasis_message * ast_channel_blob_create(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Creates a ast_channel_blob message.
struct ast_channel * ast_dial_answered(struct ast_dial *dial)
Return channel that answered.
char * strcasestr(const char *, const char *)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
static void sla_queue_event_conf(enum sla_event_type type, struct ast_channel *chan, struct ast_conference *conf)
Queue a SLA event from the conference.
static int sla_station_is_marked(void *obj, void *arg, int flags)
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
static const char * trunkstate2str(enum sla_trunk_state state)
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
static int sla_check_device(const char *device)
unsigned int ring_timeout
char namerecloc[PATH_MAX]
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_pthread_create(a, b, c, d)
struct ast_dial * ast_dial_create(void)
New dialing structure.
static const char *const app3
char language[MAX_LANGUAGE]
int ast_closestream(struct ast_filestream *f)
Closes a stream.
static int sla_station_cmp(void *obj, void *arg, int flags)
static void conf_queue_dtmf(const struct ast_conference *conf, const struct ast_conf_user *sender, struct ast_frame *f)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
#define CONFFLAG_NO_AUDIO_UNTIL_UP
static const char *const slatrunk_app
static char * meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
const char * ast_config_AST_SPOOL_DIR
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
#define ao2_find(container, arg, flags)
unsigned int hold_stations
struct ao2_container * usercontainer
int ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout)
Plays a stream and gets DTMF data from a channel.
static int sla_trunk_is_marked(void *obj, void *arg, int flags)
structure to hold users read from users.conf
Structure used to handle boolean flags.
static int sla_station_release_refs(void *obj, void *arg, int flags)
#define ast_clear_flag64(p, flag)
static void sla_hangup_stations(void)
static int sla_trunk_mark(void *obj, void *arg, int flags)
struct sla_station * station
static const char *const app
#define MEETME_DELAYDETECTTALK
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
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...
struct ast_frame ast_null_frame
struct @35::@52 failed_stations
static void * dial_trunk(void *data)
#define EVENT_FLAG_REPORTING
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
static char * complete_userno(struct ast_conference *cnf, const char *word, int state)
static int sla_build_trunk(struct ast_config *cfg, const char *cat)
int ast_channel_fd(const struct ast_channel *chan, int which)
int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
Process the audio frame for silence.
static const char gain_map[]
Map 'volume' levels from -5 through +5 into decibel (dB) settings for channel drivers.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
char * strsep(char **str, const char *delims)
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
struct sla_station * station
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
int ast_add_extension(const char *context, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar)
Add and extension to an extension context.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
struct timeval ast_mktime(struct ast_tm *const tmp, const char *zone)
Timezone-independent version of mktime(3).
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
Standard Command Line Interface.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
ast_app: A registered application
const char * ast_channel_name(const struct ast_channel *chan)
static int audio_buffers
The number of audio buffers to be allocated on pseudo channels when in a conference.
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
Writes a frame to a stream.
int attribute_pure ast_false(const char *val)
Make sure something is false. Determine if a string containing a boolean value is "false"...
A station that failed to be dialed.
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
static int acf_meetme_info(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
struct sla_ringing_trunk::@47 timed_out_stations
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
static const char * sla_hold_str(unsigned int hold_access)
static int load_config(int reload)
struct ast_trans_pvt * transpath[32]
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
int ast_answer(struct ast_channel *chan)
Answer a channel.
ast_cond_t announcelist_addition
static struct ast_conference * find_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 int sla_check_failed_station(const struct sla_station *station)
Check to see if this station has failed to be dialed in the past minute.
struct stasis_forward * sub
Data structure associated with a single frame of data.
unsigned int announcethread_stop
Internal Asterisk hangup causes.
void ast_context_destroy(struct ast_context *con, const char *registrar)
Destroy a context (matches the specified context or ANY context if NULL)
const char * ast_channel_language(const struct ast_channel *chan)
static int sla_calc_trunk_timeouts(unsigned int *timeout)
Process trunk ring timeouts.
static char * complete_meetmecmd_lock(const char *word, int pos, int state)
Abstract JSON element (object, array, string, int, ...).
static void sla_failed_station_destroy(struct sla_failed_station *failed_station)
static const char sla_registrar[]
static int admin_exec(struct ast_channel *chan, const char *data)
The MeetMeadmin application.
#define AST_OPTION_TONE_VERIFY
static unsigned int conf_map[1024]
struct ast_channel_id uniqueid
const char * ast_channel_context(const struct ast_channel *chan)
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
static struct sla_station * sla_find_station(const char *name)
struct ast_channel * lchan
union ast_frame::@263 data
static struct sla_trunk_ref * sla_find_trunk_ref_byname(const struct sla_station *station, const char *name)
Find a trunk reference on a station by name.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
enum ast_frame_type frametype
enum announcetypes announcetype
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
static int user_set_hangup_cb(void *obj, void *check_admin_arg, int flags)
#define ast_mutex_init(pmutex)
A station's reference to a trunk.
unsigned char valid
TRUE if the name information is valid/present.
static struct ao2_container * sla_trunks
unsigned int ring_timeout
static char context[AST_MAX_CONTEXT]
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define ast_mutex_destroy(a)
static int sla_check_inuse_station(const struct sla_station *station)
Check to see if a station is in use.
static int sla_trunk_release_refs(void *obj, void *arg, int flags)
struct ast_context * ast_context_find_or_create(struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *name, const char *registrar)
Register a new context or find an existing one.
The MeetMe Conference object.
struct ast_format * format
static void sla_handle_dial_state_event(void)
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
const char * ast_channel_macrocontext(const struct ast_channel *chan)
static void sla_station_ref_destructor(void *obj)
struct ast_conference::@39 list
struct ast_app * pbx_findapp(const char *app)
Look up an application.
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
static void sla_trunk_ref_destructor(void *obj)
static struct sla_ringing_trunk * queue_ringing_trunk(struct sla_trunk *trunk)
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
static void sla_stop_ringing_station(struct sla_ringing_station *ringing_station, enum sla_station_hangup hangup)
int ast_dsp_get_threshold_from_settings(enum threshold which)
Get silence threshold from dsp.conf.
static void filename_parse(char *filename, char *buffer)
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
Asterisk module definitions.
struct @35::@50 ringing_trunks
static struct ao2_container * sla_stations
struct ast_channel_monitor * ast_channel_monitor(const struct ast_channel *chan)
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
int ast_str_append_event_header(struct ast_str **fields_string, const char *header, const char *value)
append an event header to an ast string
unsigned int attempt_callerid
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
struct sla_station * station
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
unsigned char valid
TRUE if the number information is valid/present.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
struct ast_channel * chan
#define ast_cond_timedwait(cond, mutex, time)
#define ast_custom_function_register(acf)
Register a custom function.
static void sla_handle_hold_event(struct sla_event *event)
static struct sla_trunk * sla_find_trunk(const char *name)
static int channel_admin_exec(struct ast_channel *chan, const char *data)
The MeetMeChannelAdmin application MeetMeChannelAdmin(channel, command)
int ast_stopstream(struct ast_channel *c)
Stops a stream.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
static int user_talk_voldown_cb(void *obj, void *unused, int flags)
Structure for mutex and tracking information.
static int user_set_muted_cb(void *obj, void *check_admin_arg, int flags)
struct @35::@51 ringing_stations
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
const char * ast_channel_musicclass(const struct ast_channel *chan)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
#define ast_mutex_unlock(a)
ast_mutex_t recordthreadlock
static void meetme_stasis_cleanup(void)
static char * complete_confno(const char *word, int state)
#define AST_APP_ARG(name)
Define an application argument.
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
static int sla_check_timed_out_station(const struct sla_ringing_trunk *ringing_trunk, const struct sla_station *station)
Check to see if dialing this station already timed out for this ringing trunk.
static char * meetme_lock_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
int ast_mkdir(const char *path, int mode)
Recursively create directory path.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag)
Send ack in manager transaction to begin a list.
ast_mutex_t announcethreadlock
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
struct ast_party_number number
Subscriber phone number.
#define ast_test_flag64(p, flag)
#define ao2_link(container, obj)