41 #include <dahdi/user.h>
524 #define CONFIG_FILE_NAME "meetme.conf"
525 #define SLA_CONFIG_FILE "sla.conf"
526 #define STR_CONCISE "concise"
529 #define DEFAULT_AUDIO_BUFFERS 32
532 #define DATE_FORMAT "%Y-%m-%d %H:%M:%S"
542 #define MEETME_DELAYDETECTTALK 300
543 #define MEETME_DELAYDETECTENDTALK 1000
545 #define AST_FRAME_BITS 32
564 #define CONF_SIZE 320
626 #define CONFFLAG_NO_AUDIO_UNTIL_UP (1ULL << 31)
628 #define CONFFLAG_INTROMSG (1ULL << 32)
630 #define CONFFLAG_DONT_DENOISE (1ULL << 33)
676 static const char *
const app =
"MeetMe";
677 static const char *
const app2 =
"MeetMeCount";
678 static const char *
const app3 =
"MeetMeAdmin";
679 static const char *
const app4 =
"MeetMeChannelAdmin";
693 #define MAX_CONFNUM 80
695 #define OPTIONS_LEN 100
698 #define MAX_SETTINGS (MAX_CONFNUM + MAX_PIN + MAX_PIN + 3)
730 unsigned int isdynamic:1;
731 unsigned int locked:1;
732 unsigned int gmuted:1;
751 pthread_t announcethread;
753 unsigned int announcethread_stop:1;
780 struct timeval start_time;
827 unsigned int ring_timeout;
831 unsigned int ring_delay;
834 unsigned int hold_access:1;
862 unsigned int num_stations;
864 unsigned int active_stations;
866 unsigned int hold_stations;
868 unsigned int ring_timeout;
871 unsigned int barge_disabled:1;
874 unsigned int hold_access:1;
890 struct sla_trunk *trunk;
896 unsigned int ring_timeout;
900 unsigned int ring_delay;
931 struct timeval last_try;
939 struct timeval ring_begin;
953 struct timeval ring_begin;
1011 return "(unmonitored)";
1013 return "(not talking)";
1023 x = DAHDI_IOMUX_WRITE | DAHDI_IOMUX_SIGEVENT;
1024 res = ioctl(fd, DAHDI_IOMUX, &x);
1028 res = write(fd, data, len);
1030 if (
errno != EAGAIN) {
1050 gain_adjust = gain_map[volume + 5];
1062 gain_adjust = gain_map[volume + 5];
1128 signed char zero_volume = 0;
1136 unsigned char *data;
1141 "Conference: %s\r\n"
1155 len =
sizeof(
enter);
1159 len =
sizeof(
leave);
1180 if (user->
user_no == *user_no) {
1192 if (user->
user_no > *max_no) {
1213 static struct ast_conference *
build_conf(
const char *confno,
const char *pin,
1214 const char *pinadmin,
int make,
int dynamic,
int refcount,
1215 const struct ast_channel *chan,
struct ast_test *test)
1217 struct ast_conference *cnf;
1218 struct dahdi_confinfo dahdic = { 0, };
1224 if (!strcmp(confno, cnf->
confno))
1228 if (cnf || (!make && !dynamic))
1250 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1251 cnf->
fd = open(
"/dev/dahdi/pseudo", O_RDWR);
1252 if (cnf->
fd < 0 || ioctl(cnf->
fd, DAHDI_SETCONF, &dahdic)) {
1282 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1283 if (ioctl(cnf->
chan->
fds[0], DAHDI_SETCONF, &dahdic)) {
1304 cnf->
start = time(NULL);
1311 if ((sscanf(cnf->
confno,
"%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
1325 struct ast_conference *cnf;
1328 int len = strlen(word);
1332 if (!strncmp(word, cnf->
confno, len) && ++which > state) {
1349 int len = strlen(word);
1353 snprintf(usrno,
sizeof(usrno),
"%d", usr->
user_no);
1354 if (!strncmp(word, usrno, len) && ++which > state) {
1370 int len = strlen(word);
1375 struct ast_conference *cnf;
1377 if (!strncasecmp(word,
"all", len)) {
1386 strtok_r(myline,
" ", &saved);
1387 strtok_r(NULL,
" ", &saved);
1388 confno = strtok_r(NULL,
" ", &saved);
1392 if (!strcmp(confno, cnf->
confno)) {
1427 if (pos == 3 && state == 0) {
1434 strtok_r(myline,
" ", &saved);
1435 strtok_r(NULL,
" ", &saved);
1436 confno = strtok_r(NULL,
" ", &saved);
1455 struct ast_conference *cnf;
1459 #define MC_HEADER_FORMAT "%-14s %-14s %-10s %-8s %-8s %-6s\n"
1460 #define MC_DATA_FORMAT "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n"
1466 "Usage: meetme list [<confno>] [" STR_CONCISE "]\n"
1467 " List all conferences or a specific conference.\n";
1475 int concise = (a->
argc == 3);
1486 ast_cli(a->
fd,
"No active MeetMe conferences.\n");
1496 hr = (now - cnf->
start) / 3600;
1497 min = ((now - cnf->
start) % 3600) / 60;
1498 sec = (now - cnf->
start) % 60;
1509 ast_cli(a->
fd,
"%s!%d!%d!%02d:%02d:%02d!%d!%d\n",
1518 total += cnf->
users;
1522 ast_cli(a->
fd,
"* Total number of MeetMe users: %d\n", total);
1529 int concise = (a->
argc == 4);
1534 ast_cli(a->
fd,
"No active MeetMe conferences.\n");
1555 hr = (now - user->
jointime) / 3600;
1556 min = ((now - user->
jointime) % 3600) / 60;
1559 ast_cli(a->
fd,
"User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
1570 ast_cli(a->
fd,
"%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
1606 if (strcasecmp(a->
argv[1],
"lock") == 0) {
1614 if (strcasecmp(a->
argv[1],
"mute") == 0) {
1616 if (strcasecmp(a->
argv[3],
"all") == 0) {
1623 if (strcasecmp(a->
argv[3],
"all") == 0) {
1629 }
else if (strcasecmp(a->
argv[1],
"kick") == 0) {
1630 if (strcasecmp(a->
argv[3],
"all") == 0) {
1658 e->
command =
"meetme {lock|unlock}";
1660 "Usage: meetme lock|unlock <confno>\n"
1661 " Lock or unlock a conference to new users.\n";
1680 "Usage: meetme kick <confno> all|<userno>\n"
1681 " Kick a conference or a user in a conference.\n";
1698 e->
command =
"meetme {mute|unmute}";
1700 "Usage: meetme mute|unmute <confno> all|<userno>\n"
1701 " Mute or unmute a conference or a user in a conference.\n";
1716 const char *hold =
"Unknown";
1718 switch (hold_access) {
1734 struct sla_trunk *trunk;
1738 e->
command =
"sla show trunks";
1740 "Usage: sla show trunks\n"
1741 " This will list all trunks defined in sla.conf\n";
1748 "=============================================================\n"
1749 "=== Configured SLA Trunks ===================================\n"
1750 "=============================================================\n"
1754 struct sla_station_ref *station_ref;
1755 char ring_timeout[16] =
"(none)";
1760 snprintf(ring_timeout,
sizeof(ring_timeout),
"%u Seconds", trunk->
ring_timeout);
1763 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n"
1764 "=== Trunk Name: %s\n"
1765 "=== ==> Device: %s\n"
1766 "=== ==> AutoContext: %s\n"
1767 "=== ==> RingTimeout: %s\n"
1768 "=== ==> BargeAllowed: %s\n"
1769 "=== ==> HoldAccess: %s\n"
1770 "=== ==> Stations ...\n",
1781 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n===\n");
1786 ast_cli(a->
fd,
"=============================================================\n\n");
1793 #define S(e) case e: return # e;
1801 return "Uknown State";
1812 e->
command =
"sla show stations";
1814 "Usage: sla show stations\n"
1815 " This will list all stations defined in sla.conf\n";
1822 "=============================================================\n"
1823 "=== Configured SLA Stations =================================\n"
1824 "=============================================================\n"
1828 struct sla_trunk_ref *trunk_ref;
1829 char ring_timeout[16] =
"(none)";
1830 char ring_delay[16] =
"(none)";
1835 snprintf(ring_timeout,
sizeof(ring_timeout),
1839 snprintf(ring_delay,
sizeof(ring_delay),
1842 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n"
1843 "=== Station Name: %s\n"
1844 "=== ==> Device: %s\n"
1845 "=== ==> AutoContext: %s\n"
1846 "=== ==> RingTimeout: %s\n"
1847 "=== ==> RingDelay: %s\n"
1848 "=== ==> HoldAccess: %s\n"
1849 "=== ==> Trunks ...\n",
1850 station->name, station->device,
1851 S_OR(station->autocontext,
"(none)"),
1852 ring_timeout, ring_delay,
1856 snprintf(ring_timeout,
sizeof(ring_timeout),
1859 strcpy(ring_timeout,
"(none)");
1861 snprintf(ring_delay,
sizeof(ring_delay),
1864 strcpy(ring_delay,
"(none)");
1865 ast_cli(a->
fd,
"=== ==> Trunk Name: %s\n"
1866 "=== ==> State: %s\n"
1867 "=== ==> RingTimeout: %s\n"
1868 "=== ==> RingDelay: %s\n",
1871 ring_timeout, ring_delay);
1873 ast_cli(a->
fd,
"=== ---------------------------------------------------------\n"
1879 ast_cli(a->
fd,
"============================================================\n"
1917 x = DAHDI_FLUSH_ALL;
1918 if (ioctl(fd, DAHDI_FLUSH, &x))
2001 if (user == sender) {
2013 struct sla_trunk_ref *trunk_ref,
struct sla_station *station,
int lock)
2023 if (!(event =
ast_calloc(1,
sizeof(*event)))) {
2056 struct ast_conference *conf)
2059 struct sla_trunk_ref *trunk_ref = NULL;
2064 strsep(&trunk_name,
"_");
2074 if (trunk_ref->
chan == chan && !strcmp(trunk_ref->
trunk->
name, trunk_name)) {
2089 ast_debug(1,
"Trunk not found for event!\n");
2105 if ((sscanf(conf->
confno,
"%4d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) {
2118 char currenttime[32];
2135 confno,
"startTime<= ", currenttime,
2136 "endtime>= ", currenttime, NULL);
2142 if (!strcasecmp(var->
name,
"bookid")) {
2145 if (!strcasecmp(var->
name,
"endtime")) {
2160 strcat(currenttime,
"0");
2163 confno,
"startTime<= ", currenttime,
2164 "endtime>= ", currenttime, NULL);
2168 ast_debug(3,
"Trying to update the endtime of Conference %s to %s\n", confno, currenttime);
2198 return "conf-hasleft";
2201 return "conf-hasjoin";
2211 struct ast_conference *conf = data;
2213 char filename[PATH_MAX] =
"";
2283 int last_talking = user->
talking;
2284 if (last_talking == talking)
2291 int was_talking = (last_talking > 0);
2292 int now_talking = (talking > 0);
2293 if (was_talking != now_talking) {
2563 if (conf->
users == 1) {
2571 }
else if (conf->
users == 2) {
2629 if (conf->
users == 1) {
2672 snprintf(recordingtmp, recordingtmp_size,
"meetme-conf-rec-%s-%s", conf->
confno, chan->
uniqueid);
2678 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
2684 struct dahdi_confinfo dahdic;
2690 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
2691 if (ioctl(conf->
lchan->
fds[0], DAHDI_SETCONF, &dahdic)) {
2740 switch (*menu_mode) {
2754 recordingtmp, recordingtmp_size);
2763 struct dahdi_confinfo dahdic, dahdic_empty;
2773 int musiconhold = 0, mohtempstopped = 0;
2776 int currentmarked = 0;
2780 int talkreq_manager = 0;
2781 int using_pseudo = 0;
2785 int announcement_played = 0;
2789 char *agifile, *mod_speex;
2790 const char *agifiledefault =
"conf-background.agi", *tmpvar;
2791 char meetmesecs[30] =
"";
2794 char members[10] =
"";
2795 int dtmf = 0, opt_waitmarked_timeout = 0;
2797 struct dahdi_bufferinfo bi;
2800 char *exitkeys = NULL;
2801 unsigned int calldurationlimit = 0;
2803 long play_warning = 0;
2804 long warning_freq = 0;
2805 const char *warning_sound = NULL;
2806 const char *end_sound = NULL;
2808 long time_left_ms = 0;
2809 struct timeval nexteventts = { 0, };
2811 int setusercount = 0;
2812 int confsilence = 0, totalsilence = 0;
2814 if (!(user =
ao2_alloc(
sizeof(*user), NULL))) {
2821 (sscanf(optargs[OPT_ARG_WAITMARKED],
"%30d", &opt_waitmarked_timeout) == 1) &&
2822 (opt_waitmarked_timeout > 0)) {
2823 timeout = time(NULL) + opt_waitmarked_timeout;
2827 calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]);
2828 ast_verb(3,
"Setting call duration limit to %u seconds.\n", calldurationlimit);
2832 char *limit_str, *warning_str, *warnfreq_str;
2836 limit_str =
strsep(&parse,
":");
2837 warning_str =
strsep(&parse,
":");
2838 warnfreq_str =
parse;
2840 timelimit = atol(limit_str);
2842 play_warning = atol(warning_str);
2844 warning_freq = atol(warnfreq_str);
2847 timelimit = play_warning = warning_freq = 0;
2848 warning_sound = NULL;
2849 }
else if (play_warning > timelimit) {
2850 if (!warning_freq) {
2853 while (play_warning > timelimit)
2854 play_warning -= warning_freq;
2855 if (play_warning < 1)
2856 play_warning = warning_freq = 0;
2860 ast_verb(3,
"Setting conference duration limit to: %ldms.\n", timelimit);
2862 ast_verb(3,
"Setting warning time to %ldms from the conference duration limit.\n", play_warning);
2865 ast_verb(3,
"Setting warning frequency to %ldms.\n", warning_freq);
2874 warning_sound = var ? var :
"timeleft";
2882 end_sound = var ? var : NULL;
2885 calldurationlimit = 0;
2887 if (!play_warning && !end_sound && timelimit) {
2888 calldurationlimit = timelimit / 1000;
2889 timelimit = play_warning = warning_freq = 0;
2891 ast_debug(2,
"Limit Data for this call:\n");
2892 ast_debug(2,
"- timelimit = %ld\n", timelimit);
2893 ast_debug(2,
"- play_warning = %ld\n", play_warning);
2894 ast_debug(2,
"- warning_freq = %ld\n", warning_freq);
2895 ast_debug(2,
"- warning_sound = %s\n", warning_sound ? warning_sound :
"UNDEF");
2896 ast_debug(2,
"- end_sound = %s\n", end_sound ? end_sound :
"UNDEF");
2903 exitkeys =
ast_strdupa(optargs[OPT_ARG_EXITKEYS]);
2920 snprintf(recordingtmp,
sizeof(recordingtmp),
"meetme-conf-rec-%s-%s", conf->
confno, chan->
uniqueid);
2926 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
2938 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
2939 if (ioctl(conf->
lchan->
fds[0], DAHDI_SETCONF, &dahdic)) {
2966 if (calldurationlimit > 0) {
2989 if (rt_schedule && conf->
maxusers) {
3015 char destdir[PATH_MAX];
3025 "%s/meetme-username-%s-%d", destdir,
3040 if (rt_log_members) {
3042 snprintf(members,
sizeof(members),
"%d", conf->
users);
3052 if (conf->
users == 1)
3091 int keepplaying = 1;
3093 if (conf->
users == 2) {
3155 origfd = chan->
fds[0];
3158 fd = open(
"/dev/dahdi/pseudo", O_RDWR | O_NONBLOCK);
3165 memset(&bi, 0,
sizeof(bi));
3167 bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
3168 bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
3170 if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
3176 if (ioctl(fd, DAHDI_SETLINEAR, &x)) {
3187 memset(&dahdic, 0,
sizeof(dahdic));
3188 memset(&dahdic_empty, 0,
sizeof(dahdic_empty));
3191 if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
3196 if (dahdic.confmode) {
3199 ast_debug(1,
"DAHDI channel is in a conference already, retrying with pseudo\n");
3204 memset(&dahdic, 0,
sizeof(dahdic));
3212 if (!(item =
ao2_alloc(
sizeof(*item), NULL)))
3232 dahdic.confmode = DAHDI_CONF_CONF;
3234 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3236 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3238 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3240 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3253 "CallerIDnum: %s\r\n"
3254 "CallerIDname: %s\r\n"
3255 "ConnectedLineNum: %s\r\n"
3256 "ConnectedLineName: %s\r\n",
3307 ret =
pbx_exec(chan, agi_app, agifile);
3318 int lastusers = conf->
users;
3326 int menu_was_active = 0;
3332 if (rt_schedule && conf->
endtime) {
3333 char currenttime[32];
3334 long localendtime = 0;
3340 if (now.tv_sec % 60 == 0) {
3345 conf->
confno,
"starttime <=", currenttime,
3346 "endtime >=", currenttime, NULL);
3348 for ( ;
var; var = var->
next) {
3349 if (!strcasecmp(var->
name,
"endtime")) {
3350 struct ast_tm endtime_tm;
3353 localendtime = tmp.tv_sec;
3360 if (localendtime > conf->
endtime){
3370 if (!announcement_played && conf->
endalert) {
3380 announcement_played = 1;
3385 announcement_played = 0;
3406 int minutes = 0, seconds = 0, remain = 0;
3413 if (time_left_ms < to) {
3417 if (time_left_ms <= 0) {
3431 if (time_left_ms >= 5000) {
3433 remain = (time_left_ms + 500) / 1000;
3434 if (remain / 60 >= 1) {
3435 minutes = remain / 60;
3436 seconds = remain % 60;
3475 if (timeout && now.tv_sec >= timeout) {
3491 menu_was_active = menu_mode;
3498 if (currentmarked == 1 && conf->
users > 1) {
3500 if (conf->
users - 1 == 1) {
3521 if (currentmarked == 0) {
3522 if (lastmarked != 0) {
3534 dahdic.confmode = DAHDI_CONF_CONF;
3535 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3546 }
else if (currentmarked >= 1 && lastmarked == 0) {
3550 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3552 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3554 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3556 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3577 if (conf->
users == 1) {
3601 if (conf->
users != lastusers) {
3602 if (conf->
users < lastusers) {
3605 lastusers = conf->
users;
3612 dahdic.confmode ^= DAHDI_CONF_TALKER;
3613 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3635 dahdic.confmode |= DAHDI_CONF_TALKER;
3636 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3653 talkreq_manager = 1;
3667 talkreq_manager = 0;
3704 ast_debug(1,
"Ooh, something swapped out under us, starting over\n");
3763 if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
3779 }
else if (!menu_mode) {
3783 menu_to_play =
"conf-adminmenu-18";
3786 menu_to_play =
"conf-usermenu-162";
3801 chan, user, recordingtmp,
sizeof(recordingtmp));
3804 if (musiconhold && !menu_mode) {
3809 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3827 ast_debug(1,
"Got DTMF %c, goto context %s\n", dtmfstr[0], exitcontext);
3832 ast_debug(2,
"Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", dtmfstr, exitcontext);
3866 "Got ignored control frame on channel %s, f->frametype=%u,f->subclass=%d\n",
3871 "Got unrecognized frame on channel %s, f->frametype=%u,f->subclass=%d\n",
3875 }
else if (outfd > -1) {
3878 memset(&fr, 0,
sizeof(fr));
3896 if (idx >= AST_FRAME_BITS) {
3897 goto bailoutandtrynormal;
3940 goto bailoutandtrynormal;
3944 bailoutandtrynormal:
3967 lastmarked = currentmarked;
3981 dahdic.confmode = 0;
3982 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3996 if (!(item =
ao2_alloc(
sizeof(*item), NULL)))
4030 "CallerIDNum: %s\r\n"
4031 "CallerIDName: %s\r\n"
4032 "ConnectedLineNum: %s\r\n"
4033 "ConnectedLineName: %s\r\n"
4034 "Duration: %ld\r\n",
4041 (
long)(now.tv_sec - user->
jointime));
4046 if (rt_log_members) {
4048 snprintf(members,
sizeof(members),
"%d", conf->
users);
4068 snprintf(meetmesecs,
sizeof(meetmesecs),
"%d", (
int) (time(NULL) - user->
jointime));
4083 char *dynamic_pin,
size_t pin_buf_len,
int refcount,
struct ast_flags64 *confflags,
int *too_early,
char **optargs)
4086 struct ast_conference *cnf;
4093 if (!strcmp(confno, cnf->
confno)) {
4103 char *pin = NULL, *pinadmin = NULL;
4106 char recordingfilename[256] =
"";
4107 char recordingformat[11] =
"";
4108 char currenttime[32] =
"";
4109 char eatime[32] =
"";
4110 char bookid[51] =
"";
4115 struct timeval endtime = { .tv_sec = 0 };
4124 ast_debug(1,
"Looking for conference %s that starts after %s\n", confno, currenttime);
4127 confno,
"starttime <= ", currenttime,
"endtime >= ",
4130 if (!var && fuzzystart) {
4137 confno,
"starttime <= ", currenttime,
"endtime >= ",
4141 if (!var && earlyalert) {
4147 confno,
"starttime <= ", eatime,
"endtime >= ",
4162 if (rt_schedule && *too_early) {
4171 for (origvar = var;
var; var = var->
next) {
4172 if (!strcasecmp(var->
name,
"pin")) {
4174 }
else if (!strcasecmp(var->
name,
"adminpin")) {
4176 }
else if (!strcasecmp(var->
name,
"bookId")) {
4178 }
else if (!strcasecmp(var->
name,
"opts")) {
4180 }
else if (!strcasecmp(var->
name,
"maxusers")) {
4181 maxusers = atoi(var->
value);
4182 }
else if (!strcasecmp(var->
name,
"adminopts")) {
4184 }
else if (!strcasecmp(var->
name,
"recordingfilename")) {
4186 }
else if (!strcasecmp(var->
name,
"recordingformat")) {
4188 }
else if (!strcasecmp(var->
name,
"endtime")) {
4189 struct ast_tm endtime_tm;
4197 cnf =
build_conf(confno, pin ? pin :
"", pinadmin ? pinadmin :
"", make, dynamic, refcount, chan, NULL);
4204 cnf->
endtime = endtime.tv_sec;
4229 snprintf(recordingtmp,
sizeof(recordingtmp),
"meetme-conf-rec-%s-%s", cnf->
confno, chan->
uniqueid);
4255 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4259 if (confflags && !cnf->
chan &&
4261 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4271 char *dynamic_pin,
size_t pin_buf_len,
int refcount,
struct ast_flags64 *confflags)
4276 struct ast_conference *cnf;
4285 ast_debug(1,
"The requested confno is '%s'?\n", confno);
4289 if (!strcmp(confno, cnf->
confno))
4300 ast_debug(1,
"Building dynamic conference '%s'\n", confno);
4302 if (dynamic_pin[0] ==
'q') {
4304 if (
ast_app_getdata(chan,
"conf-getpin", dynamic_pin, pin_buf_len - 1, 0) < 0)
4307 cnf =
build_conf(confno, dynamic_pin,
"", make, dynamic, refcount, chan, NULL);
4309 cnf =
build_conf(confno,
"",
"", make, dynamic, refcount, chan, NULL);
4325 if (strcasecmp(var->
name,
"conf"))
4331 ast_debug(3,
"Will conf %s match %s?\n", confno,
args.confno);
4332 if (!strcasecmp(
args.confno, confno)) {
4337 make, dynamic, refcount, chan, NULL);
4342 ast_debug(1,
"%s isn't a valid conference\n", confno);
4346 }
else if (dynamic_pin) {
4350 if (dynamic_pin[0] ==
'q') {
4351 dynamic_pin[0] =
'\0';
4356 if (confflags && !cnf->
chan &&
4359 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4363 if (confflags && !cnf->
chan &&
4365 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4377 struct ast_conference *conf;
4395 conf =
find_conf(chan,
args.confno, 0, 0, NULL, 0, 1, NULL);
4398 count = conf->
users;
4406 snprintf(val,
sizeof(val),
"%d", count);
4425 struct ast_conference *cnf = NULL;
4429 int empty = 0, empty_no_pin = 0;
4430 int always_prompt = 0;
4431 const char *notdata;
4432 char *info, the_pin[
MAX_PIN] =
"";
4468 strcpy(the_pin,
"q");
4485 if ((empty_no_pin) || (!dynamic)) {
4491 if (!strcasecmp(var->
name,
"conf")) {
4494 confno_tmp =
strsep(&stringp,
"|,");
4499 if (!strcmp(confno_tmp, cnf->
confno)) {
4538 if (!strcmp(confno_tmp, cnf->
confno)) {
4567 snprintf(confno,
sizeof(confno),
"%d", i);
4582 if (sscanf(confno,
"%30d", &confno_int) == 1) {
4598 res =
ast_app_getdata(chan,
"conf-getconfno", confno,
sizeof(confno) - 1, 0);
4608 cnf =
find_conf(chan, confno, 1, dynamic, the_pin,
4609 sizeof(the_pin), 1, &confflags);
4614 the_pin,
sizeof(the_pin), 1, &confflags, &too_early, optargs);
4615 if (rt_schedule && too_early)
4648 if (req_pin && not_exempt) {
4653 for (j = 0; j < 3; j++) {
4654 if (*the_pin && (always_prompt == 0)) {
4662 res =
ast_app_getdata(chan,
"conf-getpin", pin + strlen(pin),
sizeof(pin) - 1 - strlen(pin), 0);
4665 if ((!strcasecmp(pin, cnf->
pin) &&
4669 !strcasecmp(pin, cnf->
pinadmin))) {
4685 res =
conf_run(chan, cnf, &confflags, optargs);
4713 if (*the_pin && (always_prompt == 0)) {
4730 res =
conf_run(chan, cnf, &confflags, optargs);
4736 }
while (allowretry);
4749 if (conf && callerident && sscanf(callerident,
"%30d", &cid) == 1) {
4795 const char *channel =
args;
4797 if (!strcmp(user->
chan->
name, channel)) {
4809 struct ast_conference *cnf;
4827 if (!
args.command) {
4857 switch (*
args.command) {
4874 switch (*
args.command) {
4976 struct ast_conference *conf = NULL;
4991 if (!
args.channel) {
4996 if (!
args.command) {
5015 switch (*
args.command) {
5037 struct ast_conference *conf;
5053 userno = strtoul(userid, &userid, 10);
5063 if (!strcmp(confid, conf->
confno))
5109 char idText[80] =
"";
5110 struct ast_conference *cnf;
5116 snprintf(idText,
sizeof(idText),
"ActionID: %s\r\n", actionid);
5137 "Event: MeetmeList\r\n"
5139 "Conference: %s\r\n"
5140 "UserNumber: %d\r\n"
5141 "CallerIDNum: %s\r\n"
5142 "CallerIDName: %s\r\n"
5143 "ConnectedLineNum: %s\r\n"
5144 "ConnectedLineName: %s\r\n"
5148 "MarkedUser: %s\r\n"
5164 user->
talking > 0 ?
"Yes" : user->
talking == 0 ?
"No" :
"Not monitored");
5172 "Event: MeetmeListComplete\r\n"
5173 "EventList: Complete\r\n"
5176 "\r\n", total, idText);
5191 }
else if (filename[0] !=
'/') {
5198 if ((slash = strrchr(slash,
'/'))) {
5207 struct ast_conference *cnf =
args;
5213 const char *oldrecordingfilename = NULL;
5214 char filename_buffer[PATH_MAX];
5216 if (!cnf || !cnf->
lchan) {
5220 filename_buffer[0] =
'\0';
5224 flags = O_CREAT | O_TRUNC | O_WRONLY;
5234 if (!s && !(
ast_strlen_zero(filename_buffer)) && (filename_buffer != oldrecordingfilename)) {
5236 oldrecordingfilename = filename_buffer;
5276 struct ast_conference *conf;
5281 if (!strcmp(data, conf->
confno))
5322 if ((sscanf(val,
"%30d", &audio_buffers) != 1)) {
5325 }
else if ((audio_buffers < DAHDI_DEFAULT_NUM_BUFS) || (audio_buffers > DAHDI_MAX_NUM_BUFS)) {
5327 DAHDI_DEFAULT_NUM_BUFS, DAHDI_MAX_NUM_BUFS);
5339 if ((sscanf(val,
"%30d", &fuzzystart) != 1)) {
5345 if ((sscanf(val,
"%30d", &earlyalert) != 1)) {
5351 if ((sscanf(val,
"%30d", &endalert) != 1)) {
5357 if ((sscanf(val,
"%30d", &extendby) != 1)) {
5370 static void unref_obj(
void *obj)
5383 struct sla_trunk tmp_trunk = {
5406 struct sla_station_ref *station_ref;
5407 struct sla_trunk_ref *trunk_ref;
5412 if (trunk_ref->
trunk != trunk || station_ref->
station == station)
5436 struct sla_trunk_ref *trunk_ref = NULL;
5439 if (strcasecmp(trunk_ref->
trunk->
name, name))
5464 struct sla_station_ref *station_ref = obj;
5474 struct sla_station_ref *station_ref;
5490 if (!(ringing_station =
ast_calloc(1,
sizeof(*ringing_station))))
5497 return ringing_station;
5502 if (ringing_station->
station) {
5504 ringing_station->
station = NULL;
5512 struct sla_failed_station *failed_station;
5514 if (!(failed_station =
ast_calloc(1,
sizeof(*failed_station)))) {
5522 return failed_station;
5527 if (failed_station->
station) {
5529 failed_station->
station = NULL;
5556 struct sla_trunk_ref *trunk_ref;
5563 if (trunk_ref->
trunk != trunk || (inactive_only ? trunk_ref->
chan : 0)
5564 || trunk_ref == exclude) {
5569 "SLA:%s_%s", station->name, trunk->
name);
5594 RAII_VAR(
struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
5597 struct ast_conference *conf;
5631 station->
dial = NULL;
5642 struct sla_station_ref *station_ref;
5644 snprintf(buf,
sizeof(buf),
"SLA_%s,K", ringing_trunk->
trunk->
name);
5658 struct sla_ringing_trunk *ringing_trunk;
5659 struct sla_trunk_ref *trunk_ref;
5660 struct sla_station_ref *station_ref;
5676 if (ringing_trunk->
trunk == trunk_ref->
trunk)
5701 struct sla_station_ref *timed_out_station;
5704 if (station == timed_out_station->
station)
5720 struct sla_trunk_ref **trunk_ref,
int rm)
5722 struct sla_trunk_ref *s_trunk_ref;
5723 struct sla_ringing_trunk *ringing_trunk = NULL;
5728 if (s_trunk_ref->
trunk != ringing_trunk->
trunk)
5741 *trunk_ref = s_trunk_ref;
5752 return ringing_trunk;
5760 RAII_VAR(
struct sla_trunk_ref *, s_trunk_ref, NULL, unref_obj);
5761 struct sla_ringing_trunk *ringing_trunk = NULL;
5764 pthread_t dont_care;
5783 if (!ringing_trunk) {
5789 ast_debug(1,
"Found no ringing trunk for station '%s' to answer!\n", ringing_station->
station->name);
5845 if (station == ringing_station->
station)
5857 struct sla_failed_station *failed_station;
5861 if (station != failed_station->
station)
5880 char *tech, *tech_data;
5884 int caller_is_saved;
5892 tech =
strsep(&tech_data,
"/");
5900 caller_is_saved = 0;
5901 if (!
sla.attempt_callerid) {
5902 caller_is_saved = 1;
5910 if (caller_is_saved) {
5916 struct sla_failed_station *failed_station;
5929 station->
dial = dial;
5940 struct sla_trunk_ref *trunk_ref;
5943 if (trunk_ref->
chan)
5951 const struct sla_trunk *trunk)
5953 struct sla_trunk_ref *trunk_ref = NULL;
5956 if (trunk_ref->
trunk == trunk)
5971 struct sla_ringing_trunk *ringing_trunk)
5973 RAII_VAR(
struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
5974 unsigned int delay = UINT_MAX;
5975 int time_left, time_elapsed;
5982 if (!ringing_trunk || !trunk_ref)
5988 delay = trunk_ref->ring_delay;
5995 time_left = (delay * 1000) - time_elapsed;
6005 struct sla_station_ref *station_ref;
6006 struct sla_ringing_trunk *ringing_trunk;
6034 if (time_left != INT_MAX && time_left > 0)
6046 struct sla_trunk_ref *trunk_ref;
6051 struct sla_ringing_trunk *ringing_trunk;
6054 if (trunk_ref->
trunk == ringing_trunk->
trunk)
6094 event->trunk_ref->trunk->on_hold = 1;
6099 event->trunk_ref->chan = NULL;
6108 struct sla_ringing_trunk *ringing_trunk;
6112 int time_left, time_elapsed;
6117 if (time_left <= 0) {
6124 if (time_left < *timeout)
6125 *timeout = time_left;
6138 struct sla_ringing_trunk *ringing_trunk;
6143 unsigned int ring_timeout = 0;
6144 int time_elapsed, time_left = INT_MAX, final_trunk_time_left = INT_MIN;
6145 struct sla_trunk_ref *trunk_ref;
6151 struct sla_station_ref *station_ref;
6152 int trunk_time_elapsed, trunk_time_left;
6155 if (ringing_trunk->
trunk == trunk_ref->
trunk)
6177 trunk_time_left = (trunk_ref->
ring_timeout * 1000) - trunk_time_elapsed;
6178 if (trunk_time_left > final_trunk_time_left)
6179 final_trunk_time_left = trunk_time_left;
6190 time_left = (ring_timeout * 1000) - time_elapsed;
6195 if (final_trunk_time_left > INT_MIN && final_trunk_time_left < time_left)
6196 time_left = final_trunk_time_left;
6199 if (time_left <= 0) {
6208 if (time_left < *timeout)
6209 *timeout = time_left;
6227 struct sla_ringing_trunk *ringing_trunk;
6248 if (time_left <= 0) {
6253 if (time_left < *timeout)
6254 *timeout = time_left;
6265 unsigned int timeout = UINT_MAX;
6266 struct timeval wait;
6267 unsigned int change_made = 0;
6286 if (timeout == UINT_MAX)
6291 ts->tv_sec = wait.tv_sec;
6292 ts->tv_nsec = wait.tv_usec * 1000;
6302 event->trunk_ref = NULL;
6307 event->station = NULL;
6315 struct sla_failed_station *failed_station;
6322 struct timespec ts = { 0, };
6323 unsigned int have_timeout = 0;
6339 switch (event->
type) {
6379 char *tech, *tech_data;
6382 struct ast_conference *conf;
6386 int caller_is_saved;
6389 int current_state = 0;
6398 tech_data =
ast_strdupa(trunk_ref->trunk->device);
6399 tech =
strsep(&tech_data,
"/");
6409 caller_is_saved = 0;
6410 if (!
sla.attempt_callerid) {
6411 caller_is_saved = 1;
6412 caller = trunk_ref->chan->caller;
6419 if (caller_is_saved) {
6421 trunk_ref->chan->caller = caller;
6433 unsigned int done = 0;
6458 ast_debug(3,
"Originating station device %s no longer active\n", station->device);
6459 trunk_ref->trunk->chan = NULL;
6464 if (current_state != last_state) {
6465 ast_debug(3,
"Indicating State Change %d to channel %s\n", current_state, trunk_ref->chan->name);
6467 last_state = current_state;
6474 if (!trunk_ref->trunk->chan) {
6483 snprintf(conf_name,
sizeof(conf_name),
"SLA_%s", trunk_ref->trunk->name);
6487 conf =
build_conf(conf_name,
"",
"", 1, 1, 1, trunk_ref->trunk->chan, NULL);
6494 conf_run(trunk_ref->trunk->chan, conf, &conf_flags, NULL);
6502 trunk_ref->trunk->chan = NULL;
6503 trunk_ref->trunk->on_hold = 0;
6517 struct sla_trunk_ref *trunk_ref = NULL;
6531 char *station_name, *trunk_name;
6533 RAII_VAR(
struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
6536 struct ast_conference *conf;
6545 station_name =
strsep(&trunk_name,
"_");
6574 "'%s' due to access controls.\n", trunk_name);
6586 "SLA:%s_%s", station->name, trunk_ref->trunk->name);
6589 struct sla_ringing_trunk *ringing_trunk;
6593 if (ringing_trunk->
trunk == trunk_ref->trunk) {
6601 if (ringing_trunk) {
6613 trunk_ref->chan = chan;
6615 if (!trunk_ref->trunk->chan) {
6618 pthread_t dont_care;
6661 conf =
build_conf(conf_name,
"",
"", 0, 0, 1, chan, NULL);
6663 conf_run(chan, conf, &conf_flags, NULL);
6670 strncat(conf_name,
",K",
sizeof(conf_name) - strlen(conf_name) - 1);
6683 struct sla_trunk_ref *trunk_ref = obj;
6685 if (trunk_ref->
trunk) {
6687 trunk_ref->
trunk = NULL;
6693 struct sla_trunk_ref *trunk_ref;
6707 struct sla_ringing_trunk *ringing_trunk;
6709 if (!(ringing_trunk =
ast_calloc(1,
sizeof(*ringing_trunk)))) {
6725 return ringing_trunk;
6730 if (ringing_trunk->
trunk) {
6732 ringing_trunk->
trunk = NULL;
6754 struct ast_conference *conf;
6756 RAII_VAR(
struct sla_trunk *, trunk, NULL, unref_obj);
6757 struct sla_ringing_trunk *ringing_trunk;
6767 ast_log(
LOG_ERROR,
"The SLATrunk application requires an argument, the trunk name\n");
6773 if (
args.argc == 2) {
6789 ast_log(
LOG_ERROR,
"Call came in on %s, but the trunk is already in use!\n",
6802 snprintf(conf_name,
sizeof(conf_name),
"SLA_%s",
args.trunk_name);
6803 conf =
build_conf(conf_name,
"",
"", 1, 1, 1, chan, NULL);
6817 conf_run(chan, conf, &conf_flags, opts);
6831 if (ringing_trunk->
trunk == trunk) {
6838 if (ringing_trunk) {
6851 char *buf, *station_name, *trunk_name;
6853 struct sla_trunk_ref *trunk_ref;
6857 station_name =
strsep(&trunk_name,
"_");
6863 if (!strcasecmp(trunk_name, trunk_ref->
trunk->
name)) {
6872 ast_log(
LOG_ERROR,
"Could not determine state for trunk %s on station %s!\n",
6873 trunk_name, station_name);
6881 struct sla_trunk *trunk = obj;
6882 struct sla_station_ref *station_ref;
6894 struct sla_trunk_ref *trunk_ref;
6907 ast_debug(1,
"sla_station destructor for '%s'\n", station->name);
6910 struct sla_trunk_ref *trunk_ref;
6915 snprintf(exten,
sizeof(exten),
"%s_%s", station->name, trunk_ref->
trunk->
name);
6916 snprintf(hint,
sizeof(hint),
"SLA:%s", exten);
6931 const struct sla_trunk *trunk = obj;
6938 struct sla_trunk *trunk = obj, *trunk2 = arg;
6952 struct sla_station *station = obj, *station2 = arg;
6964 pthread_join(
sla.thread, NULL);
6985 char *tech, *tech_data;
6988 tech =
strsep(&tech_data,
"/");
6998 struct sla_trunk *trunk = obj;
7000 ast_debug(1,
"sla_trunk destructor for '%s'\n", trunk->
name);
7013 RAII_VAR(
struct sla_trunk *, trunk, NULL, unref_obj);
7016 int existing_trunk = 0;
7046 if (!strcasecmp(var->
name,
"autocontext"))
7048 else if (!strcasecmp(var->
name,
"ringtimeout")) {
7054 }
else if (!strcasecmp(var->
name,
"barge"))
7056 else if (!strcasecmp(var->
name,
"hold")) {
7057 if (!strcasecmp(var->
value,
"private"))
7059 else if (!strcasecmp(var->
value,
"open"))
7065 }
else if (strcasecmp(var->
name,
"type") && strcasecmp(var->
name,
"device")) {
7084 "for trunk '%s'!\n", trunk->
name);
7089 if (!existing_trunk) {
7102 RAII_VAR(
struct sla_trunk *, trunk, NULL, unref_obj);
7103 struct sla_trunk_ref *trunk_ref = NULL;
7104 struct sla_station_ref *station_ref;
7105 char *trunk_name, *options, *cur;
7106 int existing_trunk_ref = 0;
7107 int existing_station_ref = 0;
7110 trunk_name =
strsep(&options,
",");
7119 if (trunk_ref->
trunk == trunk) {
7120 trunk_ref->
mark = 0;
7121 existing_trunk_ref = 1;
7132 while ((cur =
strsep(&options,
","))) {
7134 name =
strsep(&value,
"=");
7135 if (!strcasecmp(name,
"ringtimeout")) {
7136 if (sscanf(value,
"%30u", &trunk_ref->
ring_timeout) != 1) {
7138 "trunk '%s' on station '%s'\n", value, trunk->
name, station->name);
7141 }
else if (!strcasecmp(name,
"ringdelay")) {
7142 if (sscanf(value,
"%30u", &trunk_ref->
ring_delay) != 1) {
7144 "trunk '%s' on station '%s'\n", value, trunk->
name, station->name);
7149 "trunk '%s' on station '%s'\n", name, trunk->
name, station->name);
7154 if (station_ref->
station == station) {
7155 station_ref->
mark = 0;
7156 existing_station_ref = 1;
7162 if (!existing_trunk_ref) {
7165 trunk_ref->
mark = 1;
7170 if (!existing_station_ref) {
7177 if (!existing_trunk_ref) {
7189 int existing_station = 0;
7198 existing_station = 1;
7213 if (!strcasecmp(var->
name,
"trunk")) {
7217 }
else if (!strcasecmp(var->
name,
"autocontext")) {
7219 }
else if (!strcasecmp(var->
name,
"ringtimeout")) {
7222 var->
value, station->name);
7225 }
else if (!strcasecmp(var->
name,
"ringdelay")) {
7228 var->
value, station->name);
7231 }
else if (!strcasecmp(var->
name,
"hold")) {
7232 if (!strcasecmp(var->
value,
"private"))
7234 else if (!strcasecmp(var->
value,
"open"))
7238 var->
value, station->name);
7241 }
else if (strcasecmp(var->
name,
"type") && strcasecmp(var->
name,
"device")) {
7251 struct sla_trunk_ref *trunk_ref;
7255 "context '%s' for SLA!\n", station->autocontext);
7263 "for trunk '%s'!\n", station->name);
7269 snprintf(exten,
sizeof(exten),
"%s_%s", station->name, trunk_ref->
trunk->
name);
7270 snprintf(hint,
sizeof(hint),
"SLA:%s", exten);
7276 "for trunk '%s'!\n", station->name);
7284 "for trunk '%s'!\n", station->name);
7290 if (!existing_station) {
7299 struct sla_trunk *trunk = obj;
7300 struct sla_station_ref *station_ref;
7307 station_ref->
mark = 1;
7318 struct sla_trunk_ref *trunk_ref;
7325 trunk_ref->
mark = 1;
7335 struct sla_trunk *trunk = obj;
7343 struct sla_station_ref *station_ref;
7347 if (!station_ref->
mark) {
7367 if (station->
mark) {
7371 struct sla_trunk_ref *trunk_ref;
7375 if (!trunk_ref->
mark) {
7398 const char *cat = NULL;
7428 if (!strcasecmp(cat,
"general"))
7435 if (!strcasecmp(type,
"trunk"))
7437 else if (!strcasecmp(type,
"station"))
7462 if (!strcasecmp(
"lock", keyword)) {
7464 }
else if (!strcasecmp(
"parties", keyword)) {
7466 }
else if (!strcasecmp(
"activity", keyword)) {
7469 return (now - conf->
start);
7470 }
else if (!strcasecmp(
"dynamic", keyword)) {
7480 struct ast_conference *conf;
7502 ast_log(
LOG_ERROR,
"Syntax: MEETME_INFO() requires a conference number\n");
7516 snprintf(buf, len,
"%d", result);
7517 }
else if (result == -1) {
7519 snprintf(buf, len,
"0");
7520 }
else if (result == -2) {
7522 snprintf(buf, len,
"0");
7530 .
name =
"MEETME_INFO",
7541 #define MEETME_DATA_EXPORT(MEMBER) \
7542 MEMBER(ast_conference, confno, AST_DATA_STRING) \
7543 MEMBER(ast_conference, dahdiconf, AST_DATA_INTEGER) \
7544 MEMBER(ast_conference, users, AST_DATA_INTEGER) \
7545 MEMBER(ast_conference, markedusers, AST_DATA_INTEGER) \
7546 MEMBER(ast_conference, maxusers, AST_DATA_INTEGER) \
7547 MEMBER(ast_conference, isdynamic, AST_DATA_BOOLEAN) \
7548 MEMBER(ast_conference, locked, AST_DATA_BOOLEAN) \
7549 MEMBER(ast_conference, recordingfilename, AST_DATA_STRING) \
7550 MEMBER(ast_conference, recordingformat, AST_DATA_STRING) \
7551 MEMBER(ast_conference, pin, AST_DATA_PASSWORD) \
7552 MEMBER(ast_conference, pinadmin, AST_DATA_PASSWORD) \
7553 MEMBER(ast_conference, start, AST_DATA_TIMESTAMP) \
7554 MEMBER(ast_conference, endtime, AST_DATA_TIMESTAMP)
7558 #define MEETME_USER_DATA_EXPORT(MEMBER) \
7559 MEMBER(ast_conf_user, user_no, AST_DATA_INTEGER) \
7560 MEMBER(ast_conf_user, talking, AST_DATA_BOOLEAN) \
7561 MEMBER(ast_conf_user, dahdichannel, AST_DATA_BOOLEAN) \
7562 MEMBER(ast_conf_user, jointime, AST_DATA_TIMESTAMP) \
7563 MEMBER(ast_conf_user, kicktime, AST_DATA_TIMESTAMP) \
7564 MEMBER(ast_conf_user, timelimit, AST_DATA_MILLISECONDS) \
7565 MEMBER(ast_conf_user, play_warning, AST_DATA_MILLISECONDS) \
7566 MEMBER(ast_conf_user, warning_freq, AST_DATA_MILLISECONDS)
7573 struct ast_data *data_meetme_user_channel;
7574 struct ast_data *data_meetme_user_volume;
7577 struct ast_data *data_meetme_users = arg;
7580 if (!data_meetme_user) {
7588 if (!data_meetme_user_channel) {
7596 if (!data_meetme_user_volume) {
7603 if (!data_meetme_user_volume) {
7619 struct ast_conference *cnf;
7620 struct ast_data *data_meetme, *data_meetme_users;
7633 if (!data_meetme_users) {
7656 AST_DATA_ENTRY(
"asterisk/application/meetme/list", &meetme_data_provider),
7659 #ifdef TEST_FRAMEWORK
7663 struct ast_conference *cnf;
7666 .
path =
"/asterisk/application/meetme/list",
7667 .search =
"list/meetme/confno=9898"
7672 info->name =
"meetme_get_data_test";
7673 info->category =
"/main/data/app_meetme/list/";
7674 info->summary =
"Meetme data provider unit test";
7676 "Tests whether the Meetme data provider implementation works as expected.";
7688 cnf =
build_conf(
"9898",
"",
"1234", 1, 1, 1, chan, test);
7734 #ifdef TEST_FRAMEWORK
7767 #ifdef TEST_FRAMEWORK
const ast_string_field name
unsigned int active_stations
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...
static char musicclass[MAX_MUSICCLASS]
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
union ast_frame_subclass subclass
static int conf_free(struct ast_conference *conf)
Remove the conference from the list and free it.
int ast_hangup(struct ast_channel *chan)
Hang up a channel.
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 int meetme_data_provider_get(const struct ast_data_search *search, struct ast_data *data_root)
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.
char * str
Subscriber phone number (Malloced)
int ast_dial_destroy(struct ast_dial *dial)
Destroys a dialing structure.
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
struct ast_party_connected_line connected
Channel Connected Line ID information.
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 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)
void astman_append(struct mansession *s, const char *fmt,...)
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_link(arg1, arg2)
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.
const char * ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable)
Gets a variable.
static void tweak_talk_volume(struct ast_conf_user *user, enum volume_action action)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
struct ast_channel * chan
The data tree to be returned by the callbacks and managed by functions local to this file...
#define ast_copy_flags64(dest, src, flagz)
void ast_data_free(struct ast_data *root)
Release the allocated memory of a tree.
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_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.
struct ast_frame ast_null_frame
struct ast_party_caller caller
Channel Caller ID information.
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
char * strsep(char **str, const char *delims)
static struct _map_x_s dtmfstr[]
mapping between dtmf flags and strings
struct ast_app * pbx_findapp(const char *app)
Look up an application.
unsigned int ring_timeout
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)
const ast_string_field uniqueid
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)
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)
static void sla_ringing_station_destroy(struct sla_ringing_station *ringing_station)
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.
struct sla_station * station
Support for translation of data formats. translate.c.
int ast_unload_realtime(const char *family)
Release any resources cached for a realtime family.
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
struct ast_party_name name
Subscriber name.
struct ast_frame * origframe
struct ast_conference::@32 list
void ast_dsp_free(struct ast_dsp *dsp)
struct announce_listitem::@31 entry
static void * recordthread(void *args)
static int action_meetmeunmute(struct mansession *s, const struct message *m)
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
static const char * istalking(int x)
Convenient Signal Processing routines.
char context[AST_MAX_CONTEXT]
#define MEETME_DELAYDETECTENDTALK
sla_event_type
Event types that can be queued up for the SLA thread.
#define ao2_iterator_next(arg1)
static int conf_exec(struct ast_channel *chan, const char *data)
The meetme() application.
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)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category)
Goes through variables.
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)
int ast_add_extension2(struct ast_context *con, 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 an extension to an extension context, this time with an ast_context *.
#define ao2_callback(c, flags, cb_fn, arg)
int ast_dial_append(struct ast_dial *dial, const char *tech, const char *device)
Append a channel.
void ast_verbose(const char *fmt,...)
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.
struct ast_dsp * ast_dsp_new(void)
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 AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
struct @28::@44 ringing_stations
This entries are for multiple registers.
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.
struct ast_conference::@33 announcelist
static int load_module(void)
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 AST_TEST_REGISTER(cb)
int ast_devstate_prov_del(const char *label)
Remove device state provider.
A station that is ringing.
static int sla_calc_station_delays(unsigned int *timeout)
Calculate the ring delay for a station.
Configuration File Parser.
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
struct ast_variable * ast_load_realtime(const char *family,...) attribute_sentinel
Retrieve realtime configuration.
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)
struct ast_data * ast_data_get(const struct ast_data_query *query)
Retrieve a subtree from the asterisk data API.
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.
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.
struct ast_str * ast_str_create(size_t init_len)
Create a malloc'ed dynamic length string.
#define ast_set_flag64(p, flag)
#define AST_OPTION_TONE_VERIFY
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.
struct sla_trunk::@36 stations
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags)
Create an iterator for a container.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
static void answer_trunk_chan(struct ast_channel *chan)
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
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)
const ast_string_field device
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.
#define AST_DATA_ENTRY(__path, __handler)
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.
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)
#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)
#define ast_verb(level,...)
void ast_config_destroy(struct ast_config *config)
Destroys a config.
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return * the previous value of *p. This can be used to handle reference co...
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
struct ast_channel * ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const char *linkedid, const int amaflag, const char *name_fmt,...)
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)
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.
struct ast_conf_user::@34 list
const char * astman_get_header(const struct message *m, char *var)
Get header from mananger transaction.
#define CONFFLAG_INTROMSG
pthread_cond_t ast_cond_t
enum sla_trunk_state state
#define ast_manager_event(chan, category, event, contents,...)
static int user_listen_voldown_cb(void *obj, void *unused, int flags)
static struct ast_data_entry meetme_data_providers[]
#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)
struct ast_trans_pvt * ast_translator_build_path(format_t dest, format_t source)
Builds a translator path Build a path (possibly NULL) from source to dest.
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.
int ast_set_write_format(struct ast_channel *chan, format_t format)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
int ast_update_realtime(const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel
Update realtime configuration.
static int user_no_cmp(void *obj, void *arg, int flags)
int ast_set_read_format(struct ast_channel *chan, format_t format)
Sets read format on channel chan Set read format for channel to whichever component of "format" is be...
static char exitcontext[AST_MAX_CONTEXT]
#define ast_debug(level,...)
Log a DEBUG message.
int ast_channel_data_add_structure(struct ast_data *tree, struct ast_channel *chan, int add_bridged)
Insert into an astdata tree, the channel structure.
u-Law to Signed linear conversion
#define AST_DATA_HANDLER_VERSION
The Data API structures version.
static void sla_station_destructor(void *obj)
struct sla_station * station
ast_dial_result
List of return codes for dial run API calls.
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 struct ast_app_option sla_trunk_opts[128]
static int can_write(struct ast_channel *chan, struct ast_flags64 *confflags)
General Asterisk PBX channel definitions.
struct @28::@45 failed_stations
static void * run_station(void *data)
#define MEETME_DATA_EXPORT(MEMBER)
static int unload_module(void)
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
Asterisk file paths, configured in asterisk.conf.
struct timeval ring_begin
enum ast_dial_result ast_dial_join(struct ast_dial *dial)
Cancel async thread.
#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.
static struct ast_app_option meetme_opts[128]
#define ast_config_load(filename, flags)
Load a config file.
#define ast_manager_register_xml(a, b, c)
Register a manager callback using XML documentation to describe the manager.
#define AST_PTHREADT_NULL
char * ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload)
Match modules names for the Asterisk cli.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
static int sla_calc_station_timeouts(unsigned int *timeout)
Process station ring timeouts.
struct ast_audiohook_list * audiohooks
Data structure associated with a custom dialplan function.
struct ast_data * ast_data_add_node(struct ast_data *root, const char *childname)
Add a container child.
#define AST_MAX_EXTENSION
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_data_unregister(path)
Caller Party information.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
char * ast_category_browse(struct ast_config *config, const char *prev)
Goes through categories.
#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)
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
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. Useful e.g. to check if a refcount h...
static enum ast_device_state meetmestate(const char *data)
Callback for devicestate providers.
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)
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)
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)
#define ast_data_register_multiple(data_entries, entries)
struct timeval ring_begin
ast_mutex_t announcelistlock
static void tweak_volume(struct volume *vol, enum volume_action action)
static int sla_station_hash(const void *obj, const int flags)
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_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.
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 ast_data_add_structure(structure_name, root, structure)
static int set_talk_volume(struct ast_conf_user *user, int volume)
The list of nodes with their search requirement.
#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,...)
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)
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
static int sla_in_use(void)
struct sla_trunk_ref * trunk_ref
#define ast_strdupa(s)
duplicate a string in memory from the stack
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)
static int acf_meetme_info_eval(const char *keyword, const struct ast_conference *conf)
char * path
Path to the node to retrieve.
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 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...
struct ast_channel * chan
void ast_data_remove_node(struct ast_data *root, struct ast_data *child)
Remove a node that was added using ast_data_add_.
#define AST_TEST_UNREGISTER(cb)
static unsigned int monitor
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)
enum ast_channel_state _state
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
const ast_string_field name
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)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
#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 ast_channel * ast_dial_answered(struct ast_dial *dial)
Return channel that answered.
#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 ao2_find(arg1, arg2, arg3)
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
static const char * trunkstate2str(enum sla_trunk_state state)
static int sla_check_device(const char *device)
unsigned int ring_timeout
char namerecloc[PATH_MAX]
#define ast_pthread_create(a, b, c, d)
struct ast_dial * ast_dial_create(void)
New dialing structure.
char macrocontext[AST_MAX_CONTEXT]
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)
#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...
unsigned int hold_stations
struct ao2_container * usercontainer
static int sla_trunk_is_marked(void *obj, void *arg, int flags)
structure to hold users read from users.conf
void ao2_iterator_destroy(struct ao2_iterator *i)
Destroy a container iterator.
Structure used to handle boolean flags.
static int sla_station_release_refs(void *obj, void *arg, int flags)
#define ast_clear_flag64(p, flag)
int ast_realtime_require_field(const char *family,...) attribute_sentinel
Inform realtime what fields that may be stored.
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
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...
static void * dial_trunk(void *data)
#define EVENT_FLAG_REPORTING
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_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
Return non-zero if this is silence. Updates "totalsilence" with the total number of seconds of silenc...
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.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
#define AST_FORMAT_SLINEAR
struct sla_station * station
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
static int sla_trunk_hash(const void *obj, const int flags)
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.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define ao2_container_alloc(arg1, arg2, arg3)
#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
static int audio_buffers
The number of audio buffers to be allocated on pseudo channels when in a conference.
static int user_add_provider_cb(void *obj, void *arg, int flags)
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"...
static void load_config_meetme(void)
int ast_cli_register_multiple(struct ast_cli_entry *e, int len)
Register multiple commands.
A station that failed to be dialed.
#define AST_OPTION_RXGAIN
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)
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]
#define MEETME_USER_DATA_EXPORT(MEMBER)
int ast_answer(struct ast_channel *chan)
Answer a channel.
ast_cond_t announcelist_addition
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
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)
const ast_string_field musicclass
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.
Data structure associated with a single frame of data.
#define AST_DATA_STRUCTURE(__struct, __name)
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)
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)
#define AST_TEST_DEFINE(hdr)
static void sla_failed_station_destroy(struct sla_failed_station *failed_station)
static const char sla_registrar[]
struct @28::@43 ringing_trunks
static int admin_exec(struct ast_channel *chan, const char *data)
The MeetMeadmin application.
static unsigned int conf_map[1024]
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
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_APP_ARG(name)
Define an application argument.
#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
struct ast_variable * next
#define ast_mutex_init(pmutex)
A station's reference to a trunk.
unsigned char valid
TRUE if the name information is valid/present.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static struct ao2_container * sla_trunks
unsigned int ring_timeout
#define CONFIG_STATUS_FILEINVALID
static char context[AST_MAX_CONTEXT]
struct ast_channel_monitor * monitor
#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.
A query to the data API is specified in this structure.
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.
static void sla_handle_dial_state_event(void)
static void sla_station_ref_destructor(void *obj)
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.
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
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.
struct sla_ringing_trunk::@40 timed_out_stations
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.
static struct ao2_container * sla_stations
char * strcasestr(const char *, const char *)
static struct ast_data_handler meetme_data_provider
unsigned int attempt_callerid
struct ast_channel * ast_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *status)
Requests a channel.
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)
union ast_frame::@172 data
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
struct ast_channel_tech * tech
struct ast_data * ast_data_add_int(struct ast_data *root, const char *childname, int value)
Add an integer node type.
#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.
ast_context: An extension context
unsigned char valid
TRUE if the number information is valid/present.
#define ao2_unlink(arg1, arg2)
struct ast_channel * chan
#define ast_cond_timedwait(cond, mutex, time)
int ast_data_search_match(const struct ast_data_search *search, struct ast_data *data)
Check the current generated node to know if it matches the search condition.
#define ast_custom_function_register(acf)
Register a custom function.
static void sla_handle_hold_event(struct sla_event *event)
const ast_string_field language
uint32_t version
Structure version.
static struct @28 sla
A structure for data used by the sla thread.
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.
struct ast_frame * ast_frdup(const struct ast_frame *fr)
Copies a frame.
static int user_talk_voldown_cb(void *obj, void *unused, int flags)
Structure for mutex and tracking information.
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
The structure of the node handler.
static int user_set_muted_cb(void *obj, void *check_admin_arg, int flags)
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
int ast_manager_unregister(char *action)
Unregister a registered manager command.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
#define AST_OPTION_TXGAIN
struct ast_config * ast_load_realtime_multientry(const char *family,...) attribute_sentinel
Retrieve realtime configuration.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define CONFIG_STATUS_FILEUNCHANGED
#define ast_mutex_unlock(a)
ast_mutex_t recordthreadlock
static char * complete_confno(const char *word, int state)
#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 list transaction.
ast_mutex_t announcethreadlock
struct ast_party_number number
Subscriber phone number.
#define ast_test_flag64(p, flag)
static const char * ast_data_retrieve_string(struct ast_data *tree, const char *path)
Retrieve the string value of a node.