48#include <dahdi/user.h>
655#define CONFIG_FILE_NAME "meetme.conf"
656#define STR_CONCISE "concise"
659#define DEFAULT_AUDIO_BUFFERS 32
662#define DATE_FORMAT "%Y-%m-%d %H:%M:%S"
673#define MEETME_DELAYDETECTTALK 300
674#define MEETME_DELAYDETECTENDTALK 1000
676#define AST_FRAME_BITS 32
757#define CONFFLAG_NO_AUDIO_UNTIL_UP (1ULL << 31)
758#define CONFFLAG_INTROMSG (1ULL << 32)
759#define CONFFLAG_INTROUSER_VMREC (1ULL << 33)
761#define CONFFLAG_KILL_LAST_MAN_STANDING (1ULL << 34)
763#define CONFFLAG_DONT_DENOISE (1ULL << 35)
812static const char *
const app =
"MeetMe";
813static const char *
const app2 =
"MeetMeCount";
814static const char *
const app3 =
"MeetMeAdmin";
815static const char *
const app4 =
"MeetMeChannelAdmin";
827#define MAX_CONFNUM 80
829#define OPTIONS_LEN 100
832#define MAX_SETTINGS (MAX_CONFNUM + MAX_PIN + MAX_PIN + 3)
1006 meetme_leave_type(),
1030 meetme_talking_type(),
1038 meetme_talk_request_type(),
1054 const char *conference_num;
1060 if (!channel_blob) {
1067 if (!message_type) {
1072 if (message_type == meetme_join_type()) {
1073 event =
"MeetmeJoin";
1074 }
else if (message_type == meetme_leave_type()) {
1075 event =
"MeetmeLeave";
1076 }
else if (message_type == meetme_end_type()) {
1077 event =
"MeetmeEnd";
1078 }
else if (message_type == meetme_mute_type()) {
1079 event =
"MeetmeMute";
1080 }
else if (message_type == meetme_talking_type()) {
1081 event =
"MeetmeTalking";
1082 }
else if (message_type == meetme_talk_request_type()) {
1083 event =
"MeetmeTalkRequest";
1095 if (!conference_num) {
1112 if (!user_prop_str) {
1116 ast_str_set(&user_prop_str, 0,
"%d", user_number);
1149 "status", on ?
"on" :
"off");
1172 "Meetme", meetme_conference->
confno);
1184 long duration = (long)(now.tv_sec -
user->jointime);
1186 struct ast_json *json_user_duration;
1195 if (!json_user_duration
1225 return "(unmonitored)";
1227 return "(not talking)";
1237 x = DAHDI_IOMUX_WRITE | DAHDI_IOMUX_SIGEVENT;
1238 res = ioctl(fd, DAHDI_IOMUX, &x);
1242 res = write(fd, data,
len);
1244 if (
errno != EAGAIN) {
1323 user->talk.actual = 0;
1325 user->talk.actual =
user->talk.desired;
1335 user->listen.actual = 0;
1337 user->listen.actual =
user->listen.desired;
1342 signed char zero_volume = 0;
1350 unsigned char *data;
1355 "Conference: %s\r\n"
1406 if (
user->user_no > *max_no) {
1407 *max_no =
user->user_no;
1433 struct dahdi_confinfo dahdic = { 0, };
1440 if (!strcmp(confno, cnf->
confno))
1444 if (cnf || (!make && !dynamic) || !cap_slin)
1473 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1474 cnf->
fd = open(
"/dev/dahdi/pseudo", O_RDWR);
1475 if (cnf->
fd < 0 || ioctl(cnf->
fd, DAHDI_SETCONF, &dahdic)) {
1505 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
1534 if ((sscanf(cnf->
confno,
"%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
1577 snprintf(usrno,
sizeof(usrno),
"%d", usr->
user_no);
1601 if (!strncasecmp(
word,
"all",
len)) {
1610 strtok_r(myline,
" ", &saved);
1611 strtok_r(
NULL,
" ", &saved);
1651 if (pos == 3 &&
state == 0) {
1658 strtok_r(myline,
" ", &saved);
1659 strtok_r(
NULL,
" ", &saved);
1683#define MC_HEADER_FORMAT "%-14s %-14s %-10s %-8s %-8s %-6s\n"
1684#define MC_DATA_FORMAT "%-12.12s %4.4d %4.4s %02d:%02d:%02d %-8s %-6s\n"
1690 "Usage: meetme list [<confno>] [" STR_CONCISE "]\n"
1691 " List all conferences or a specific conference.\n";
1697 if (
a->argc == 2 || (
a->argc == 3 && !strcasecmp(
a->argv[2],
STR_CONCISE))) {
1699 int concise = (
a->argc == 3);
1710 ast_cli(
a->fd,
"No active MeetMe conferences.\n");
1720 hr = (now - cnf->
start) / 3600;
1721 min = ((now - cnf->
start) % 3600) / 60;
1722 sec = (now - cnf->
start) % 60;
1733 ast_cli(
a->fd,
"%s!%d!%d!%02d:%02d:%02d!%d!%d\n",
1746 ast_cli(
a->fd,
"* Total number of MeetMe users: %d\n",
total);
1751 if (
a->argc == 3 || (
a->argc == 4 && !strcasecmp(
a->argv[3],
STR_CONCISE))) {
1753 int concise = (
a->argc == 4);
1758 ast_cli(
a->fd,
"No active MeetMe conferences.\n");
1765 if (strcmp(cnf->
confno,
a->argv[2]) == 0) {
1771 ast_cli(
a->fd,
"No such conference: %s.\n",
a->argv[2]);
1779 hr = (now -
user->jointime) / 3600;
1780 min = ((now -
user->jointime) % 3600) / 60;
1781 sec = (now -
user->jointime) % 60;
1783 ast_cli(
a->fd,
"User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
1794 ast_cli(
a->fd,
"%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
1809 ast_cli(
a->fd,
"%d users in that conference.\n", cnf->
users);
1829 if (strcasecmp(
a->argv[1],
"lock") == 0) {
1837 if (strcasecmp(
a->argv[1],
"mute") == 0) {
1839 if (strcasecmp(
a->argv[3],
"all") == 0) {
1846 if (strcasecmp(
a->argv[3],
"all") == 0) {
1852 }
else if (strcasecmp(
a->argv[1],
"kick") == 0) {
1853 if (strcasecmp(
a->argv[3],
"all") == 0) {
1881 e->
command =
"meetme {lock|unlock}";
1883 "Usage: meetme lock|unlock <confno>\n"
1884 " Lock or unlock a conference to new users.\n";
1903 "Usage: meetme kick <confno> all|<userno>\n"
1904 " Kick a conference or a user in a conference.\n";
1921 e->
command =
"meetme {mute|unmute}";
1923 "Usage: meetme mute|unmute <confno> all|<userno>\n"
1924 " Mute or unmute a conference or a user in a conference.\n";
1967 x = DAHDI_FLUSH_ALL;
1968 if (ioctl(fd, DAHDI_FLUSH, &x))
1998 if (
conf->transframe[x])
2000 if (
conf->transpath[x])
2005 conf->announcethread_stop = 1;
2009 pthread_join(
conf->announcethread,
NULL);
2021 if (
conf->origframe)
2027 if (
conf->recordingfilename) {
2030 if (
conf->usercontainer) {
2033 if (
conf->recordingformat) {
2053 if (
user == sender) {
2073 if ((sscanf(
conf->confno,
"%4d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) {
2086 char currenttime[32];
2103 confno,
"startTime<= ", currenttime,
2104 "endtime>= ", currenttime,
NULL);
2110 if (!strcasecmp(
var->name,
"bookid")) {
2113 if (!strcasecmp(
var->name,
"endtime")) {
2128 strcat(currenttime,
"0");
2131 confno,
"startTime<= ", currenttime,
2132 "endtime>= ", currenttime,
NULL);
2136 ast_debug(3,
"Trying to update the endtime of Conference %s to %s\n", confno, currenttime);
2152 ast_channel_musicclass_set(chan, musicclass);
2158 ast_channel_musicclass_set(chan, original_moh);
2166 return "conf-hasleft";
2169 return "conf-hasjoin";
2185 while (!
conf->announcethread_stop) {
2187 if (
conf->announcethread_stop) {
2198 if (
conf->announcethread_stop) {
2250 int last_talking =
user->talking;
2251 if (last_talking == talking)
2254 user->talking = talking;
2258 int was_talking = (last_talking > 0);
2259 int now_talking = (talking > 0);
2260 if (was_talking != now_talking) {
2543 if (
conf->users == 1) {
2551 }
else if (
conf->users == 2) {
2609 if (
conf->users == 1) {
2641 if (!
conf->recordingfilename) {
2651 if (!
conf->recordingfilename) {
2655 if (!
conf->recordingformat) {
2658 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
2659 conf->confno,
conf->recordingfilename,
conf->recordingformat);
2664 struct dahdi_confinfo dahdic;
2669 dahdic.confno =
conf->dahdiconf;
2670 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
2721 switch (*menu_mode) {
2735 recordingtmp, recordingtmp_size, cap_slin);
2744 struct dahdi_confinfo dahdic, dahdic_empty;
2754 int musiconhold = 0, mohtempstopped = 0;
2757 int currentmarked = 0;
2761 int talkreq_manager = 0;
2762 int using_pseudo = 0;
2766 int announcement_played = 0;
2771 const char *agifiledefault =
"conf-background.agi", *tmpvar;
2772 char meetmesecs[30] =
"";
2775 char members[10] =
"";
2776 int dtmf = 0, opt_waitmarked_timeout = 0;
2778 struct dahdi_bufferinfo bi;
2781 char *exitkeys =
NULL;
2782 unsigned int calldurationlimit = 0;
2784 long play_warning = 0;
2785 long warning_freq = 0;
2786 const char *warning_sound =
NULL;
2787 const char *end_sound =
NULL;
2789 long time_left_ms = 0;
2790 struct timeval nexteventts = { 0, };
2792 int setusercount = 0;
2793 int confsilence = 0, totalsilence = 0;
2798 goto conf_run_cleanup;
2803 goto conf_run_cleanup;
2810 (opt_waitmarked_timeout > 0)) {
2811 timeout = time(
NULL) + opt_waitmarked_timeout;
2816 ast_verb(3,
"Setting call duration limit to %u seconds.\n", calldurationlimit);
2820 char *limit_str, *warning_str, *warnfreq_str;
2824 limit_str =
strsep(&parse,
":");
2825 warning_str =
strsep(&parse,
":");
2826 warnfreq_str = parse;
2828 timelimit = atol(limit_str);
2830 play_warning = atol(warning_str);
2832 warning_freq = atol(warnfreq_str);
2835 timelimit = play_warning = warning_freq = 0;
2836 warning_sound =
NULL;
2837 }
else if (play_warning > timelimit) {
2838 if (!warning_freq) {
2841 while (play_warning > timelimit)
2842 play_warning -= warning_freq;
2843 if (play_warning < 1)
2844 play_warning = warning_freq = 0;
2848 ast_verb(3,
"Setting conference duration limit to: %ldms.\n", timelimit);
2850 ast_verb(3,
"Setting warning time to %ldms from the conference duration limit.\n", play_warning);
2853 ast_verb(3,
"Setting warning frequency to %ldms.\n", warning_freq);
2862 warning_sound =
var ?
var :
"timeleft";
2873 calldurationlimit = 0;
2875 if (!play_warning && !end_sound && timelimit) {
2876 calldurationlimit = timelimit / 1000;
2877 timelimit = play_warning = warning_freq = 0;
2879 ast_debug(2,
"Limit Data for this call:\n");
2880 ast_debug(2,
"- timelimit = %ld\n", timelimit);
2881 ast_debug(2,
"- play_warning = %ld\n", play_warning);
2882 ast_debug(2,
"- warning_freq = %ld\n", warning_freq);
2883 ast_debug(2,
"- warning_sound = %s\n", warning_sound ? warning_sound :
"UNDEF");
2884 ast_debug(2,
"- end_sound = %s\n", end_sound ? end_sound :
"UNDEF");
2897 if (!
conf->recordingfilename) {
2907 if (!
conf->recordingfilename) {
2911 if (!
conf->recordingformat) {
2914 ast_verb(4,
"Starting recording of MeetMe Conference %s into file %s.%s.\n",
2915 conf->confno,
conf->recordingfilename,
conf->recordingformat);
2925 dahdic.confno =
conf->dahdiconf;
2926 dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
2946 time(&
user->jointime);
2948 user->timelimit = timelimit;
2949 user->play_warning = play_warning;
2950 user->warning_freq = warning_freq;
2951 user->warning_sound = warning_sound;
2952 user->end_sound = end_sound;
2954 if (calldurationlimit > 0) {
2955 time(&
user->kicktime);
2956 user->kicktime =
user->kicktime + calldurationlimit;
2961 time_left_ms =
user->timelimit;
2963 if (
user->timelimit) {
2978 if (
conf->users >=
conf->maxusers) {
2994 user->userflags = *confflags;
3026 snprintf(
user->namerecloc,
sizeof(
user->namerecloc),
3031 snprintf(
user->namerecloc,
sizeof(
user->namerecloc),
3032 "%s/meetme-username-%s-%d", destdir,
3038 snprintf(
user->namerecloc,
sizeof(
user->namerecloc),
3039 "%s/meetme-username-%s-%d", destdir,
3056 conf->markedusers++;
3060 snprintf(members,
sizeof(members),
"%d",
conf->users);
3070 if (
conf->users == 1)
3106 int keepplaying = 1;
3108 if (
conf->users == 2) {
3165 user->dahdichannel = !retrydahdi;
3171 fd = open(
"/dev/dahdi/pseudo", O_RDWR | O_NONBLOCK);
3178 memset(&bi, 0,
sizeof(bi));
3180 bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
3181 bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
3183 if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
3189 if (ioctl(fd, DAHDI_SETLINEAR, &x)) {
3200 memset(&dahdic, 0,
sizeof(dahdic));
3201 memset(&dahdic_empty, 0,
sizeof(dahdic_empty));
3204 if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
3209 if (dahdic.confmode) {
3212 ast_debug(1,
"DAHDI channel is in a conference already, retrying with pseudo\n");
3217 memset(&dahdic, 0,
sizeof(dahdic));
3220 dahdic.confno =
conf->dahdiconf;
3248 dahdic.confmode = DAHDI_CONF_CONF;
3250 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3252 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3254 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3256 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3273 (
conf->markedusers >= 1))) {
3300 if (
user->dahdichannel) {
3308 ret =
pbx_exec(chan, agi_app, agifile);
3313 if (
user->dahdichannel) {
3319 int lastusers =
conf->users;
3327 int menu_was_active = 0;
3334 char currenttime[32];
3335 long localendtime = 0;
3341 if (now.tv_sec % 60 == 0) {
3346 conf->confno,
"starttime <=", currenttime,
3347 "endtime >=", currenttime,
NULL);
3350 if (!strcasecmp(
var->name,
"endtime")) {
3351 struct ast_tm endtime_tm;
3354 localendtime =
tmp.tv_sec;
3361 if (localendtime >
conf->endtime){
3362 conf->endtime = localendtime;
3366 if (
conf->endtime && (now.tv_sec >=
conf->endtime)) {
3371 if (!announcement_played &&
conf->endalert) {
3372 if (now.tv_sec +
conf->endalert >=
conf->endtime) {
3381 announcement_played = 1;
3386 announcement_played = 0;
3396 if (
user->kicktime && (
user->kicktime <= now.tv_sec)) {
3406 if (
user->timelimit) {
3407 int minutes = 0, seconds = 0, remain = 0;
3414 if (time_left_ms < to) {
3418 if (time_left_ms <= 0) {
3419 if (
user->end_sound) {
3432 if (time_left_ms >= 5000) {
3434 remain = (time_left_ms + 500) / 1000;
3435 if (remain / 60 >= 1) {
3436 minutes = remain / 60;
3437 seconds = remain % 60;
3443 if (
user->warning_sound &&
user->play_warning) {
3444 if (!strcmp(
user->warning_sound,
"timeleft")) {
3467 if (
user->warning_freq) {
3476 if (timeout && now.tv_sec >= timeout) {
3488 if (!menu_mode && menu_was_active &&
user->listen.desired && !
user->listen.actual) {
3492 menu_was_active = menu_mode;
3494 currentmarked =
conf->markedusers;
3499 if (currentmarked == 1 &&
conf->users > 1) {
3501 if (
conf->users - 1 == 1) {
3519 user->userflags = *confflags;
3522 if (currentmarked == 0) {
3523 if (lastmarked != 0) {
3535 dahdic.confmode = DAHDI_CONF_CONF;
3536 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3547 }
else if (currentmarked >= 1 && lastmarked == 0) {
3551 dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
3553 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
3555 dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
3557 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3578 if (
conf->users == 1) {
3602 if (
conf->users != lastusers) {
3603 if (
conf->users < lastusers) {
3606 lastusers =
conf->users;
3614 dahdic.confmode ^= DAHDI_CONF_TALKER;
3615 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3631 dahdic.confmode |= DAHDI_CONF_TALKER;
3632 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3644 talkreq_manager = 1;
3651 talkreq_manager = 0;
3680 char dtmfstr[2] =
"";
3688 ast_debug(1,
"Ooh, something swapped out under us, starting over\n");
3690 user->dahdichannel = !retrydahdi;
3707 if (
user->talk.actual) {
3712 if (
user->talking == -1) {
3747 if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
3757 if (!menu_mode &&
user->talk.desired && !
user->talk.actual) {
3763 }
else if (!menu_mode) {
3767 menu_to_play =
"conf-adminmenu-18";
3770 menu_to_play =
"conf-usermenu-162";
3785 chan,
user, recordingtmp,
sizeof(recordingtmp), cap_slin);
3788 if (musiconhold && !menu_mode) {
3793 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3816 ast_debug(2,
"Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", dtmfstr,
exitcontext);
3842 "Got ignored control frame on channel %s, f->frametype=%u,f->subclass=%d\n",
3847 "Got unrecognized frame on channel %s, f->frametype=%u,f->subclass=%d\n",
3851 }
else if (outfd > -1) {
3854 memset(&fr, 0,
sizeof(fr));
3861 if (!
user->listen.actual &&
3873 goto bailoutandtrynormal;
3876 if (!
conf->transframe[idx]) {
3877 if (
conf->origframe) {
3885 if (!
conf->transpath[idx]) {
3888 if (
conf->transpath[idx]) {
3890 if (!
conf->transframe[idx]) {
3896 if (
conf->transframe[idx]) {
3916 goto bailoutandtrynormal;
3928 if (
user->listen.actual) {
3943 lastmarked = currentmarked;
3957 dahdic.confmode = 0;
3958 if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
3998 if (
user->user_no) {
4010 snprintf(members,
sizeof(members),
"%d",
conf->users);
4018 conf->markedusers--;
4035 snprintf(meetmesecs,
sizeof(meetmesecs),
"%d", (
int) (time(
NULL) -
user->jointime));
4054 char *dynamic_pin,
size_t pin_buf_len,
int refcount,
struct ast_flags64 *confflags,
int *too_early,
char **optargs)
4077 char recordingfilename[256] =
"";
4078 char recordingformat[11] =
"";
4079 char currenttime[32] =
"";
4080 char eatime[32] =
"";
4081 char bookid[51] =
"";
4086 struct timeval endtime = { .tv_sec = 0 };
4095 ast_debug(1,
"Looking for conference %s that starts after %s\n", confno, currenttime);
4098 confno,
"starttime <= ", currenttime,
"endtime >= ",
4108 confno,
"starttime <= ", currenttime,
"endtime >= ",
4118 confno,
"starttime <= ", eatime,
"endtime >= ",
4143 if (!strcasecmp(
var->name,
"pin")) {
4145 }
else if (!strcasecmp(
var->name,
"adminpin")) {
4147 }
else if (!strcasecmp(
var->name,
"bookId")) {
4149 }
else if (!strcasecmp(
var->name,
"opts")) {
4151 }
else if (!strcasecmp(
var->name,
"maxusers")) {
4152 maxusers = atoi(
var->value);
4153 }
else if (!strcasecmp(
var->name,
"adminopts")) {
4155 }
else if (!strcasecmp(
var->name,
"recordingfilename")) {
4157 }
else if (!strcasecmp(
var->name,
"recordingformat")) {
4159 }
else if (!strcasecmp(
var->name,
"endtime")) {
4160 struct ast_tm endtime_tm;
4168 cnf =
build_conf(confno, pin ? pin :
"", pinadmin ? pinadmin :
"", make, dynamic, refcount, chan,
NULL);
4175 cnf->
endtime = endtime.tv_sec;
4226 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4230 if (confflags && !cnf->
chan &&
4232 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4272 if (dynamic_pin[0] ==
'q') {
4295 if (strcasecmp(
var->name,
"conf"))
4316 }
else if (dynamic_pin) {
4320 if (dynamic_pin[0] ==
'q') {
4321 dynamic_pin[0] =
'\0';
4326 if (confflags && !cnf->
chan &&
4329 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
4333 if (confflags && !cnf->
chan &&
4335 ast_log(
LOG_WARNING,
"No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
4368 count =
conf->users;
4376 snprintf(
val,
sizeof(
val),
"%d", count);
4399 int empty = 0, empty_no_pin = 0;
4400 int always_prompt = 0;
4401 const char *notdata;
4438 strcpy(the_pin,
"q");
4455 if ((empty_no_pin) || (!dynamic)) {
4460 char parse[
MAX_SETTINGS], *stringp = parse, *confno_tmp;
4461 if (!strcasecmp(
var->name,
"conf")) {
4464 confno_tmp =
strsep(&stringp,
"|,");
4469 if (!strcmp(confno_tmp, cnf->
confno)) {
4508 if (!strcmp(confno_tmp, cnf->
confno)) {
4537 snprintf(confno,
sizeof(confno),
"%d", i);
4552 if (sscanf(confno,
"%30d", &confno_int) == 1) {
4568 res =
ast_app_getdata(chan,
"conf-getconfno", confno,
sizeof(confno) - 1, 0);
4578 cnf =
find_conf(chan, confno, 1, dynamic, the_pin,
4579 sizeof(the_pin), 1, &confflags);
4584 the_pin,
sizeof(the_pin), 1, &confflags, &too_early, optargs);
4618 if (req_pin && not_exempt) {
4623 for (j = 0; j < 3; j++) {
4624 if (*the_pin && (always_prompt == 0)) {
4632 res =
ast_app_getdata(chan,
"conf-getpin", pin + strlen(pin),
sizeof(pin) - 1 - strlen(pin), 0);
4635 if ((!strcasecmp(pin, cnf->
pin) &&
4639 !strcasecmp(pin, cnf->
pinadmin))) {
4655 res =
conf_run(chan, cnf, &confflags, optargs);
4683 if (*the_pin && (always_prompt == 0)) {
4700 res =
conf_run(chan, cnf, &confflags, optargs);
4706 }
while (allowretry);
4719 if (
conf && callerident && sscanf(callerident,
"%30d", &cid) == 1) {
4765 const char *channel =
args;
4799 if (!
args.command) {
4833 switch (*
args.command) {
4850 switch (*
args.command) {
4967 if (!
args.channel) {
4972 if (!
args.command) {
4991 switch (*
args.command) {
4996 user->adminflags &= ~ADMINFLAG_MUTED;
5029 userno = strtoul(userid, &userid, 10);
5039 if (!strcmp(confid,
conf->confno))
5085 char idText[80] =
"";
5092 snprintf(idText,
sizeof(idText),
"ActionID: %s\r\n", actionid);
5113 "Event: MeetmeList\r\n"
5115 "Conference: %s\r\n"
5116 "UserNumber: %d\r\n"
5117 "CallerIDNum: %s\r\n"
5118 "CallerIDName: %s\r\n"
5119 "ConnectedLineNum: %s\r\n"
5120 "ConnectedLineName: %s\r\n"
5124 "MarkedUser: %s\r\n"
5140 user->talking > 0 ?
"Yes" :
user->talking == 0 ?
"No" :
"Not monitored");
5156 char idText[80] =
"";
5164 snprintf(idText,
sizeof(idText),
"ActionID: %s\r\n", actionid);
5186 hr = (now - cnf->
start) / 3600;
5187 min = ((now - cnf->
start) % 3600) / 60;
5188 sec = (now - cnf->
start) % 60;
5191 "Event: MeetmeListRooms\r\n"
5193 "Conference: %s\r\n"
5196 "Activity: %2.2d:%2.2d:%2.2d\r\n"
5206 cnf->
locked ?
"Yes" :
"No");
5227 }
else if (filename[0] !=
'/') {
5234 if ((slash = strrchr(slash,
'/'))) {
5249 const char *oldrecordingfilename =
NULL;
5252 if (!cnf || !cnf->
lchan) {
5256 filename_buffer[0] =
'\0';
5260 flags = O_CREAT | O_TRUNC | O_WRONLY;
5270 if (!s && !(
ast_strlen_zero(filename_buffer)) && (filename_buffer != oldrecordingfilename)) {
5272 oldrecordingfilename = filename_buffer;
5317 if (!strcmp(data,
conf->confno))
5375 DAHDI_DEFAULT_NUM_BUFS, DAHDI_MAX_NUM_BUFS);
5416 if (!strcasecmp(
"lock", keyword)) {
5417 return conf->locked;
5418 }
else if (!strcasecmp(
"parties", keyword)) {
5420 }
else if (!strcasecmp(
"activity", keyword)) {
5423 return (now -
conf->start);
5424 }
else if (!strcasecmp(
"dynamic", keyword)) {
5425 return conf->isdynamic;
5456 ast_log(
LOG_ERROR,
"Syntax: MEETME_INFO() requires a conference number\n");
5462 if (!strcmp(
args.confno,
conf->confno)) {
5471 }
else if (
result == -1) {
5474 }
else if (
result == -2) {
5483 .
name =
"MEETME_INFO",
5565 .optional_modules =
"func_speex",
static int action_meetmeunmute(struct mansession *s, const struct message *m)
@ CONFFLAG_INTROUSERNOREVIEW
@ CONFFLAG_OPTIMIZETALKER
@ CONFFLAG_ANNOUNCEUSERCOUNT
@ CONFFLAG_DURATION_LIMIT
static void meetme_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int user_no_cmp(void *obj, void *arg, int flags)
@ MEETME_RECORD_TERMINATE
static struct ast_custom_function meetme_info_acf
static const char * get_announce_filename(enum announcetypes type)
static void tweak_listen_volume(struct ast_conf_user *user, enum volume_action action)
static int rt_log_members
static int user_set_kickme_cb(void *obj, void *check_admin_arg, int flags)
static void meetme_menu_normal(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
static int dispose_conf(struct ast_conference *conf)
Decrement reference counts, as incremented by find_conf()
static const struct ast_app_option meetme_opts[128]
static char * meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int careful_write(int fd, unsigned char *data, int len, int block)
static unsigned int conf_map[1024]
static int user_max_cmp(void *obj, void *arg, int flags)
static int count_exec(struct ast_channel *chan, const char *data)
The MeetmeCount application.
static int conf_free(struct ast_conference *conf)
Remove the conference from the list and free it.
#define CONFFLAG_DONT_DENOISE
static int rt_extend_conf(const char *confno)
static struct ast_cli_entry cli_meetme[]
static void * recordthread(void *args)
#define MEETME_DELAYDETECTENDTALK
static int user_reset_vol_cb(void *obj, void *unused, int flags)
static const char *const app
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 void conf_flush(int fd, struct ast_channel *chan)
static int can_write(struct ast_channel *chan, struct ast_flags64 *confflags)
static void tweak_volume(struct volume *vol, enum volume_action action)
@ OPT_ARG_INTROUSER_VMREC
static int set_talk_volume(struct ast_conf_user *user, int volume)
static char * meetme_cmd_helper(struct ast_cli_args *a)
static int user_chan_cb(void *obj, void *args, int flags)
static void meetme_stasis_generate_msg(struct ast_conference *meetme_conference, struct ast_channel *chan, struct ast_conf_user *user, struct stasis_message_type *message_type, struct ast_json *extras)
static const char *const app4
static const char *const app2
static void reset_volumes(struct ast_conf_user *user)
static void meetme_set_defaults(void)
static void conf_start_moh(struct ast_channel *chan, const char *musicclass)
static void meetme_menu_admin(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
static const char * istalking(int x)
static void conf_play(struct ast_channel *chan, struct ast_conference *conf, enum entrance_sound sound)
static const char gain_map[]
Map 'volume' levels from -5 through +5 into decibel (dB) settings for channel drivers.
static int meetmemute(struct mansession *s, const struct message *m, int mute)
static char * meetme_mute_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int acf_meetme_info_eval(const char *keyword, const struct ast_conference *conf)
static void filename_parse(char *filename, char *buffer)
static void meetme_stasis_cleanup(void)
static char * complete_meetmecmd_list(const char *line, const char *word, int pos, int state)
static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
static struct ast_conf_user * find_user(struct ast_conference *conf, const char *callerident)
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 int user_set_muted_cb(void *obj, void *check_admin_arg, int flags)
static void * announce_thread(void *data)
static int set_listen_volume(struct ast_conf_user *user, int volume)
static int channel_admin_exec(struct ast_channel *chan, const char *data)
The MeetMeChannelAdmin application MeetMeChannelAdmin(channel, command)
static void tweak_talk_volume(struct ast_conf_user *user, enum volume_action action)
static const char *const app3
static enum ast_device_state meetmestate(const char *data)
Callback for devicestate providers.
static char * complete_meetmecmd_lock(const char *word, int pos, int state)
static int action_meetmelist(struct mansession *s, const struct message *m)
static int admin_exec(struct ast_channel *chan, const char *data)
The MeetMeAdmin application.
static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struct ast_flags64 *confflags, char *optargs[])
#define CONFFLAG_KILL_LAST_MAN_STANDING
static int action_meetmemute(struct mansession *s, const struct message *m)
static int user_set_unmuted_cb(void *obj, void *check_admin_arg, int flags)
static struct stasis_message_router * meetme_event_message_router
static char * complete_confno(const char *word, int state)
static int user_set_hangup_cb(void *obj, void *check_admin_arg, int flags)
static int user_talk_voldown_cb(void *obj, void *unused, int flags)
static char * complete_meetmecmd_mute_kick(const char *line, const char *word, int pos, int state)
STASIS_MESSAGE_TYPE_DEFN_LOCAL(meetme_join_type)
static int meetme_stasis_init(void)
#define CONFFLAG_INTROUSER_VMREC
static int load_module(void)
Load the module.
static int user_listen_volup_cb(void *obj, void *unused, int flags)
#define CONFFLAG_INTROMSG
#define MEETME_DELAYDETECTTALK
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.
static void load_config_meetme(int reload)
static int conf_exec(struct ast_channel *chan, const char *data)
The meetme() application.
#define CONFFLAG_NO_AUDIO_UNTIL_UP
static char * meetme_lock_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int audio_buffers
The number of audio buffers to be allocated on pseudo channels when in a conference.
static int unload_module(void)
static int load_config(int reload)
static char * meetme_kick_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
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 void conf_queue_dtmf(const struct ast_conference *conf, const struct ast_conf_user *sender, struct ast_frame *f)
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct ast_format_cap *cap_slin)
static int user_listen_voldown_cb(void *obj, void *unused, int flags)
static int action_meetmelistrooms(struct mansession *s, const struct message *m)
static int acf_meetme_info(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static char * complete_userno(struct ast_conference *cnf, const char *word, int state)
static int user_talk_volup_cb(void *obj, void *unused, int flags)
#define DEFAULT_AUDIO_BUFFERS
static struct ast_json * status_to_json(int on)
static char exitcontext[AST_MAX_CONTEXT]
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn)
Allocate and initialize a list container.
#define ao2_alloc(data_size, destructor_fn)
Internal Asterisk hangup causes.
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
struct ast_channel * ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds, int *exception, int *outfd, int *ms)
Waits for activity on a group of channels.
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
const char * ast_channel_musicclass(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.
#define ast_channel_lock(chan)
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
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.
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int ast_channel_fd(const struct ast_channel *chan, int which)
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
struct ast_audiohook_list * ast_channel_audiohooks(const struct ast_channel *chan)
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
struct ast_frame * ast_read_noaudio(struct ast_channel *chan)
Reads a frame, returning AST_FRAME_NULL frame if audio.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
@ AST_SOFTHANGUP_EXPLICIT
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
const char * ast_channel_language(const struct ast_channel *chan)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block)
Sets an option on a channel.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
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.
#define ast_channel_unlock(chan)
#define AST_MAX_EXTENSION
ast_channel_state
ast_channel states
Standard Command Line Interface.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define AST_CLI_DEFINE(fn, txt,...)
void ast_cli(int fd, const char *fmt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
int ast_devstate_prov_del(const char *label)
Remove device state provider.
@ AST_DEVSTATE_NOT_CACHABLE
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.
int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
Add device state provider.
ast_device_state
Device States.
Convenient Signal Processing routines.
void ast_dsp_free(struct ast_dsp *dsp)
int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
Process the audio frame for silence.
int ast_dsp_get_threshold_from_settings(enum threshold which)
Get silence threshold from dsp.conf.
struct ast_dsp * ast_dsp_new(void)
Allocates a new dsp, assumes 8khz for internal sample rate.
static unsigned char enter[]
void ast_verbose(const char *fmt,...)
Generic File Format Support. Should be included by clients of the file handling routines....
int ast_stopstream(struct ast_channel *c)
Stops a stream.
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
Writes a frame to a stream.
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
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_closestream(struct ast_filestream *f)
Closes a stream.
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
int ast_filedelete(const char *filename, const char *fmt)
Deletes a file.
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag)
Send ack in manager transaction to begin a list.
void astman_send_error(struct mansession *s, const struct message *m, char *error)
Send error in manager transaction.
void astman_send_list_complete_start(struct mansession *s, const struct message *m, const char *event_name, int count)
Start the list complete event.
void astman_send_ack(struct mansession *s, const struct message *m, char *msg)
Send ack in manager transaction.
const char * astman_get_header(const struct message *m, char *var)
Get header from manager transaction.
void astman_send_list_complete_end(struct mansession *s)
End the list complete event.
void astman_append(struct mansession *s, const char *fmt,...)
int ast_manager_unregister(const char *action)
Unregister a registered manager command.
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
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.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
enum ast_getdata_result 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.
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...
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
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.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
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.
char * strsep(char **str, const char *delims)
char * strcasestr(const char *, const char *)
Configuration File Parser.
#define ast_config_load(filename, flags)
Load a config file.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
int ast_realtime_require_field(const char *family,...) attribute_sentinel
Inform realtime what fields that may be stored.
struct ast_config * ast_load_realtime_multientry(const char *family,...) attribute_sentinel
Retrieve realtime configuration.
int ast_unload_realtime(const char *family)
Release any resources cached for a realtime family.
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
int ast_update_realtime(const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel
Update realtime configuration.
struct ast_variable * ast_load_realtime(const char *family,...) attribute_sentinel
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
#define AST_OPTION_TONE_VERIFY
#define AST_OPTION_RXGAIN
#define ast_frdup(fr)
Copies a frame.
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
#define AST_OPTION_TXGAIN
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
struct ast_frame ast_null_frame
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_verb(level,...)
Asterisk JSON abstraction layer.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
static unsigned char leave[]
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
#define AST_LIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_LOCK(head)
Locks a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given 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).
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...
struct timeval ast_mktime(struct ast_tm *const tmp, const char *zone)
Timezone-independent version of mktime(3).
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....
Asterisk locking-related definitions:
#define ast_cond_wait(cond, mutex)
#define AST_PTHREADT_NULL
#define ast_mutex_init(pmutex)
#define ast_mutex_unlock(a)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
pthread_cond_t ast_cond_t
#define ast_mutex_destroy(a)
#define ast_mutex_lock(a)
int ast_atomic_dec_and_test(volatile int *p)
decrement *p by 1 and return true if the variable has reached 0.
#define ast_cond_signal(cond)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define EVENT_FLAG_REPORTING
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
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
#define ast_manager_register_xml(action, authority, func)
Register a manager callback using XML documentation to describe the manager.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_DEVSTATE_PROVIDER
@ AST_MODULE_SUPPORT_DEPRECATED
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Asterisk file paths, configured in asterisk.conf.
const char * ast_config_AST_SPOOL_DIR
Core PBX routines and definitions.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
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.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
struct ast_app * pbx_findapp(const char *app)
Look up an application.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
struct stasis_forward * sub
Say numbers and dates (maybe words one day too)
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
#define stasis_message_router_create(topic)
Create a new message router object.
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
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.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char namerecloc[PATH_MAX]
enum announcetypes announcetype
struct ast_channel * confchan
char language[MAX_LANGUAGE]
struct announce_listitem::@33 entry
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
ast_app: A registered application
Blob of data associated with a channel.
struct ast_channel_snapshot * snapshot
Main Channel structure associated with a channel.
descriptor for a cli entry.
char namerecloc[PATH_MAX]
const char * warning_sound
struct ast_flags64 userflags
struct ast_channel * chan
struct timeval start_time
struct ast_conf_user::@36 list
The MeetMe Conference object.
struct ast_frame * transframe[32]
struct ast_trans_pvt * transpath[32]
struct ao2_container * usercontainer
ast_mutex_t announcethreadlock
ast_mutex_t recordthreadlock
ast_mutex_t announcelistlock
struct ast_channel * chan
struct ast_channel * lchan
ast_cond_t announcelist_addition
struct ast_conference::@35 announcelist
struct ast_conference::@34 list
unsigned int announcethread_stop
struct ast_frame * origframe
enum recording_state recording
Data structure associated with a custom dialplan function.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Structure used to handle a large number of boolean flags == used only in app_dial?
Structure used to handle boolean flags.
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
Abstract JSON element (object, array, string, int, ...).
Structure for mutex and tracking information.
struct ast_party_id id
Caller party ID.
struct ast_party_id id
Connected party ID.
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
unsigned char valid
TRUE if the name information is valid/present.
char * str
Subscriber name (Malloced)
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
Support for dynamic strings.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
Structure for variables, used for configurations and for channel variables.
All configuration options for http media cache.
In case you didn't read that giant block of text above the mansession_session struct,...
structure to hold users read from users.conf
#define ast_test_status_update(a, b, c...)
#define ast_test_suite_event_notify(s, f,...)
static struct aco_type item
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 ...
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
struct timeval ast_tvsub(struct timeval a, struct timeval b)
Returns the difference of two timevals a - b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Support for translation of data formats. translate.c.
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...
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
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.
u-Law to Signed linear conversion
#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_flag64(p, flag)
#define ast_clear_flag64(p, flag)
#define ast_pthread_create_background(a, b, c, d)
int ast_mkdir(const char *path, int mode)
Recursively create directory path.
#define ast_pthread_create_detached_background(a, b, c, d)
#define ast_copy_flags64(dest, src, flagz)
#define ast_set_flag64(p, flag)