00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include "asterisk.h"
00041
00042 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
00043
00044 #include "asterisk/paths.h"
00045 #include "asterisk/file.h"
00046 #include "asterisk/audiohook.h"
00047 #include "asterisk/pbx.h"
00048 #include "asterisk/module.h"
00049 #include "asterisk/cli.h"
00050 #include "asterisk/app.h"
00051 #include "asterisk/channel.h"
00052 #include "asterisk/autochan.h"
00053 #include "asterisk/manager.h"
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
00156
00157 static const char * const app = "MixMonitor";
00158
00159 static const char * const stop_app = "StopMixMonitor";
00160
00161 static const char * const mixmonitor_spy_type = "MixMonitor";
00162
00163 struct mixmonitor {
00164 struct ast_audiohook audiohook;
00165 char *filename;
00166 char *post_process;
00167 char *name;
00168 unsigned int flags;
00169 struct ast_autochan *autochan;
00170 struct mixmonitor_ds *mixmonitor_ds;
00171 };
00172
00173 enum mixmonitor_flags {
00174 MUXFLAG_APPEND = (1 << 1),
00175 MUXFLAG_BRIDGED = (1 << 2),
00176 MUXFLAG_VOLUME = (1 << 3),
00177 MUXFLAG_READVOLUME = (1 << 4),
00178 MUXFLAG_WRITEVOLUME = (1 << 5),
00179 };
00180
00181 enum mixmonitor_args {
00182 OPT_ARG_READVOLUME = 0,
00183 OPT_ARG_WRITEVOLUME,
00184 OPT_ARG_VOLUME,
00185 OPT_ARG_ARRAY_SIZE,
00186 };
00187
00188 AST_APP_OPTIONS(mixmonitor_opts, {
00189 AST_APP_OPTION('a', MUXFLAG_APPEND),
00190 AST_APP_OPTION('b', MUXFLAG_BRIDGED),
00191 AST_APP_OPTION_ARG('v', MUXFLAG_READVOLUME, OPT_ARG_READVOLUME),
00192 AST_APP_OPTION_ARG('V', MUXFLAG_WRITEVOLUME, OPT_ARG_WRITEVOLUME),
00193 AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
00194 });
00195
00196 struct mixmonitor_ds {
00197 unsigned int destruction_ok;
00198 ast_cond_t destruction_condition;
00199 ast_mutex_t lock;
00200
00201
00202
00203 int fs_quit;
00204 struct ast_filestream *fs;
00205 struct ast_audiohook *audiohook;
00206 };
00207
00208
00209
00210
00211
00212 static void mixmonitor_ds_close_fs(struct mixmonitor_ds *mixmonitor_ds)
00213 {
00214 if (mixmonitor_ds->fs) {
00215 ast_closestream(mixmonitor_ds->fs);
00216 mixmonitor_ds->fs = NULL;
00217 mixmonitor_ds->fs_quit = 1;
00218 ast_verb(2, "MixMonitor close filestream\n");
00219 }
00220 }
00221
00222 static void mixmonitor_ds_destroy(void *data)
00223 {
00224 struct mixmonitor_ds *mixmonitor_ds = data;
00225
00226 ast_mutex_lock(&mixmonitor_ds->lock);
00227 mixmonitor_ds->audiohook = NULL;
00228 mixmonitor_ds->destruction_ok = 1;
00229 ast_cond_signal(&mixmonitor_ds->destruction_condition);
00230 ast_mutex_unlock(&mixmonitor_ds->lock);
00231 }
00232
00233 static struct ast_datastore_info mixmonitor_ds_info = {
00234 .type = "mixmonitor",
00235 .destroy = mixmonitor_ds_destroy,
00236 };
00237
00238 static void destroy_monitor_audiohook(struct mixmonitor *mixmonitor)
00239 {
00240 if (mixmonitor->mixmonitor_ds) {
00241 ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
00242 mixmonitor->mixmonitor_ds->audiohook = NULL;
00243 ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
00244 }
00245
00246 ast_audiohook_lock(&mixmonitor->audiohook);
00247 ast_audiohook_detach(&mixmonitor->audiohook);
00248 ast_audiohook_unlock(&mixmonitor->audiohook);
00249 ast_audiohook_destroy(&mixmonitor->audiohook);
00250 }
00251
00252 static int startmon(struct ast_channel *chan, struct ast_audiohook *audiohook)
00253 {
00254 struct ast_channel *peer = NULL;
00255 int res = 0;
00256
00257 if (!chan)
00258 return -1;
00259
00260 ast_audiohook_attach(chan, audiohook);
00261
00262 if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
00263 ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
00264
00265 return res;
00266 }
00267
00268 #define SAMPLES_PER_FRAME 160
00269
00270 static void mixmonitor_free(struct mixmonitor *mixmonitor)
00271 {
00272 if (mixmonitor) {
00273 if (mixmonitor->mixmonitor_ds) {
00274 ast_mutex_destroy(&mixmonitor->mixmonitor_ds->lock);
00275 ast_cond_destroy(&mixmonitor->mixmonitor_ds->destruction_condition);
00276 ast_free(mixmonitor->mixmonitor_ds);
00277 }
00278 ast_free(mixmonitor);
00279 }
00280 }
00281 static void *mixmonitor_thread(void *obj)
00282 {
00283 struct mixmonitor *mixmonitor = obj;
00284 struct ast_filestream **fs = NULL;
00285 unsigned int oflags;
00286 char *ext;
00287 char *last_slash;
00288 int errflag = 0;
00289
00290 ast_verb(2, "Begin MixMonitor Recording %s\n", mixmonitor->name);
00291
00292 fs = &mixmonitor->mixmonitor_ds->fs;
00293
00294
00295 ast_audiohook_lock(&mixmonitor->audiohook);
00296 while (mixmonitor->audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING && !mixmonitor->mixmonitor_ds->fs_quit) {
00297 struct ast_frame *fr = NULL;
00298
00299 if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR))) {
00300 ast_audiohook_trigger_wait(&mixmonitor->audiohook);
00301
00302 if (mixmonitor->audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING) {
00303 break;
00304 }
00305 continue;
00306 }
00307
00308
00309
00310 ast_audiohook_unlock(&mixmonitor->audiohook);
00311
00312 if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) || (mixmonitor->autochan->chan && ast_bridged_channel(mixmonitor->autochan->chan))) {
00313 ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
00314
00315 if (!*fs && !errflag && !mixmonitor->mixmonitor_ds->fs_quit) {
00316 oflags = O_CREAT | O_WRONLY;
00317 oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
00318
00319 last_slash = strrchr(mixmonitor->filename, '/');
00320 if ((ext = strrchr(mixmonitor->filename, '.')) && (ext > last_slash))
00321 *(ext++) = '\0';
00322 else
00323 ext = "raw";
00324
00325 if (!(*fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0666))) {
00326 ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
00327 errflag = 1;
00328 }
00329 }
00330
00331
00332 if (*fs) {
00333 struct ast_frame *cur;
00334
00335 for (cur = fr; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
00336 ast_writestream(*fs, cur);
00337 }
00338 }
00339 ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
00340 }
00341
00342 ast_frame_free(fr, 0);
00343
00344 ast_audiohook_lock(&mixmonitor->audiohook);
00345 }
00346 ast_audiohook_unlock(&mixmonitor->audiohook);
00347
00348 ast_autochan_destroy(mixmonitor->autochan);
00349
00350
00351 ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
00352 mixmonitor_ds_close_fs(mixmonitor->mixmonitor_ds);
00353 if (!mixmonitor->mixmonitor_ds->destruction_ok) {
00354 ast_cond_wait(&mixmonitor->mixmonitor_ds->destruction_condition, &mixmonitor->mixmonitor_ds->lock);
00355 }
00356 ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
00357
00358
00359 destroy_monitor_audiohook(mixmonitor);
00360
00361 if (mixmonitor->post_process) {
00362 ast_verb(2, "Executing [%s]\n", mixmonitor->post_process);
00363 ast_safe_system(mixmonitor->post_process);
00364 }
00365
00366 ast_verb(2, "End MixMonitor Recording %s\n", mixmonitor->name);
00367 mixmonitor_free(mixmonitor);
00368 return NULL;
00369 }
00370
00371 static int setup_mixmonitor_ds(struct mixmonitor *mixmonitor, struct ast_channel *chan)
00372 {
00373 struct ast_datastore *datastore = NULL;
00374 struct mixmonitor_ds *mixmonitor_ds;
00375
00376 if (!(mixmonitor_ds = ast_calloc(1, sizeof(*mixmonitor_ds)))) {
00377 return -1;
00378 }
00379
00380 ast_mutex_init(&mixmonitor_ds->lock);
00381 ast_cond_init(&mixmonitor_ds->destruction_condition, NULL);
00382
00383 if (!(datastore = ast_datastore_alloc(&mixmonitor_ds_info, NULL))) {
00384 ast_mutex_destroy(&mixmonitor_ds->lock);
00385 ast_cond_destroy(&mixmonitor_ds->destruction_condition);
00386 ast_free(mixmonitor_ds);
00387 return -1;
00388 }
00389
00390 mixmonitor_ds->audiohook = &mixmonitor->audiohook;
00391 datastore->data = mixmonitor_ds;
00392
00393 ast_channel_lock(chan);
00394 ast_channel_datastore_add(chan, datastore);
00395 ast_channel_unlock(chan);
00396
00397 mixmonitor->mixmonitor_ds = mixmonitor_ds;
00398 return 0;
00399 }
00400
00401 static void launch_monitor_thread(struct ast_channel *chan, const char *filename, unsigned int flags,
00402 int readvol, int writevol, const char *post_process)
00403 {
00404 pthread_t thread;
00405 struct mixmonitor *mixmonitor;
00406 char postprocess2[1024] = "";
00407 size_t len;
00408
00409 len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
00410
00411 postprocess2[0] = 0;
00412
00413 if (!ast_strlen_zero(post_process)) {
00414 char *p1, *p2;
00415
00416 p1 = ast_strdupa(post_process);
00417 for (p2 = p1; *p2 ; p2++) {
00418 if (*p2 == '^' && *(p2+1) == '{') {
00419 *p2 = '$';
00420 }
00421 }
00422 pbx_substitute_variables_helper(chan, p1, postprocess2, sizeof(postprocess2) - 1);
00423 if (!ast_strlen_zero(postprocess2))
00424 len += strlen(postprocess2) + 1;
00425 }
00426
00427
00428 if (!(mixmonitor = ast_calloc(1, len))) {
00429 return;
00430 }
00431
00432
00433 if (ast_audiohook_init(&mixmonitor->audiohook, AST_AUDIOHOOK_TYPE_SPY, mixmonitor_spy_type)) {
00434 mixmonitor_free(mixmonitor);
00435 return;
00436 }
00437
00438
00439 mixmonitor->flags = flags;
00440 if (!(mixmonitor->autochan = ast_autochan_setup(chan))) {
00441 mixmonitor_free(mixmonitor);
00442 return;
00443 }
00444
00445 if (setup_mixmonitor_ds(mixmonitor, chan)) {
00446 ast_autochan_destroy(mixmonitor->autochan);
00447 mixmonitor_free(mixmonitor);
00448 return;
00449 }
00450 mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
00451 strcpy(mixmonitor->name, chan->name);
00452 if (!ast_strlen_zero(postprocess2)) {
00453 mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + strlen(filename) + 2;
00454 strcpy(mixmonitor->post_process, postprocess2);
00455 }
00456
00457 mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor) + strlen(chan->name) + 1;
00458 strcpy(mixmonitor->filename, filename);
00459
00460 ast_set_flag(&mixmonitor->audiohook, AST_AUDIOHOOK_TRIGGER_SYNC);
00461
00462 if (readvol)
00463 mixmonitor->audiohook.options.read_volume = readvol;
00464 if (writevol)
00465 mixmonitor->audiohook.options.write_volume = writevol;
00466
00467 if (startmon(chan, &mixmonitor->audiohook)) {
00468 ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
00469 mixmonitor_spy_type, chan->name);
00470 ast_audiohook_destroy(&mixmonitor->audiohook);
00471 mixmonitor_free(mixmonitor);
00472 return;
00473 }
00474
00475 ast_pthread_create_detached_background(&thread, NULL, mixmonitor_thread, mixmonitor);
00476 }
00477
00478 static int mixmonitor_exec(struct ast_channel *chan, const char *data)
00479 {
00480 int x, readvol = 0, writevol = 0;
00481 struct ast_flags flags = {0};
00482 char *parse, *tmp, *slash;
00483 AST_DECLARE_APP_ARGS(args,
00484 AST_APP_ARG(filename);
00485 AST_APP_ARG(options);
00486 AST_APP_ARG(post_process);
00487 );
00488
00489 if (ast_strlen_zero(data)) {
00490 ast_log(LOG_WARNING, "MixMonitor requires an argument (filename)\n");
00491 return -1;
00492 }
00493
00494 parse = ast_strdupa(data);
00495
00496 AST_STANDARD_APP_ARGS(args, parse);
00497
00498 if (ast_strlen_zero(args.filename)) {
00499 ast_log(LOG_WARNING, "MixMonitor requires an argument (filename)\n");
00500 return -1;
00501 }
00502
00503 if (args.options) {
00504 char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
00505
00506 ast_app_parse_options(mixmonitor_opts, &flags, opts, args.options);
00507
00508 if (ast_test_flag(&flags, MUXFLAG_READVOLUME)) {
00509 if (ast_strlen_zero(opts[OPT_ARG_READVOLUME])) {
00510 ast_log(LOG_WARNING, "No volume level was provided for the heard volume ('v') option.\n");
00511 } else if ((sscanf(opts[OPT_ARG_READVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
00512 ast_log(LOG_NOTICE, "Heard volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_READVOLUME]);
00513 } else {
00514 readvol = get_volfactor(x);
00515 }
00516 }
00517
00518 if (ast_test_flag(&flags, MUXFLAG_WRITEVOLUME)) {
00519 if (ast_strlen_zero(opts[OPT_ARG_WRITEVOLUME])) {
00520 ast_log(LOG_WARNING, "No volume level was provided for the spoken volume ('V') option.\n");
00521 } else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
00522 ast_log(LOG_NOTICE, "Spoken volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_WRITEVOLUME]);
00523 } else {
00524 writevol = get_volfactor(x);
00525 }
00526 }
00527
00528 if (ast_test_flag(&flags, MUXFLAG_VOLUME)) {
00529 if (ast_strlen_zero(opts[OPT_ARG_VOLUME])) {
00530 ast_log(LOG_WARNING, "No volume level was provided for the combined volume ('W') option.\n");
00531 } else if ((sscanf(opts[OPT_ARG_VOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
00532 ast_log(LOG_NOTICE, "Combined volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_VOLUME]);
00533 } else {
00534 readvol = writevol = get_volfactor(x);
00535 }
00536 }
00537 }
00538
00539
00540 if (args.filename[0] != '/') {
00541 char *build;
00542
00543 build = alloca(strlen(ast_config_AST_MONITOR_DIR) + strlen(args.filename) + 3);
00544 sprintf(build, "%s/%s", ast_config_AST_MONITOR_DIR, args.filename);
00545 args.filename = build;
00546 }
00547
00548 tmp = ast_strdupa(args.filename);
00549 if ((slash = strrchr(tmp, '/')))
00550 *slash = '\0';
00551 ast_mkdir(tmp, 0777);
00552
00553 pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
00554 launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
00555
00556 return 0;
00557 }
00558
00559 static int stop_mixmonitor_exec(struct ast_channel *chan, const char *data)
00560 {
00561 struct ast_datastore *datastore = NULL;
00562
00563 ast_channel_lock(chan);
00564 ast_audiohook_detach_source(chan, mixmonitor_spy_type);
00565 if ((datastore = ast_channel_datastore_find(chan, &mixmonitor_ds_info, NULL))) {
00566 struct mixmonitor_ds *mixmonitor_ds = datastore->data;
00567
00568 ast_mutex_lock(&mixmonitor_ds->lock);
00569
00570
00571
00572 mixmonitor_ds_close_fs(mixmonitor_ds);
00573
00574
00575
00576
00577 if (mixmonitor_ds->audiohook) {
00578 ast_audiohook_lock(mixmonitor_ds->audiohook);
00579 ast_cond_signal(&mixmonitor_ds->audiohook->trigger);
00580 ast_audiohook_unlock(mixmonitor_ds->audiohook);
00581 mixmonitor_ds->audiohook = NULL;
00582 }
00583
00584 ast_mutex_unlock(&mixmonitor_ds->lock);
00585
00586
00587 if (!ast_channel_datastore_remove(chan, datastore)) {
00588 ast_datastore_free(datastore);
00589 }
00590 }
00591 ast_channel_unlock(chan);
00592
00593 return 0;
00594 }
00595
00596 static char *handle_cli_mixmonitor(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
00597 {
00598 struct ast_channel *chan;
00599
00600 switch (cmd) {
00601 case CLI_INIT:
00602 e->command = "mixmonitor {start|stop}";
00603 e->usage =
00604 "Usage: mixmonitor <start|stop> <chan_name> [args]\n"
00605 " The optional arguments are passed to the MixMonitor\n"
00606 " application when the 'start' command is used.\n";
00607 return NULL;
00608 case CLI_GENERATE:
00609 return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
00610 }
00611
00612 if (a->argc < 3)
00613 return CLI_SHOWUSAGE;
00614
00615 if (!(chan = ast_channel_get_by_name_prefix(a->argv[2], strlen(a->argv[2])))) {
00616 ast_cli(a->fd, "No channel matching '%s' found.\n", a->argv[2]);
00617
00618 return CLI_SUCCESS;
00619 }
00620
00621 ast_channel_lock(chan);
00622
00623 if (!strcasecmp(a->argv[1], "start")) {
00624 mixmonitor_exec(chan, a->argv[3]);
00625 ast_channel_unlock(chan);
00626 } else {
00627 ast_channel_unlock(chan);
00628 ast_audiohook_detach_source(chan, mixmonitor_spy_type);
00629 }
00630
00631 chan = ast_channel_unref(chan);
00632
00633 return CLI_SUCCESS;
00634 }
00635
00636
00637 static int manager_mute_mixmonitor(struct mansession *s, const struct message *m)
00638 {
00639 struct ast_channel *c = NULL;
00640
00641 const char *name = astman_get_header(m, "Channel");
00642 const char *id = astman_get_header(m, "ActionID");
00643 const char *state = astman_get_header(m, "State");
00644 const char *direction = astman_get_header(m,"Direction");
00645
00646 int clearmute = 1;
00647
00648 enum ast_audiohook_flags flag;
00649
00650 if (ast_strlen_zero(direction)) {
00651 astman_send_error(s, m, "No direction specified. Must be read, write or both");
00652 return AMI_SUCCESS;
00653 }
00654
00655 if (!strcasecmp(direction, "read")) {
00656 flag = AST_AUDIOHOOK_MUTE_READ;
00657 } else if (!strcasecmp(direction, "write")) {
00658 flag = AST_AUDIOHOOK_MUTE_WRITE;
00659 } else if (!strcasecmp(direction, "both")) {
00660 flag = AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE;
00661 } else {
00662 astman_send_error(s, m, "Invalid direction specified. Must be read, write or both");
00663 return AMI_SUCCESS;
00664 }
00665
00666 if (ast_strlen_zero(name)) {
00667 astman_send_error(s, m, "No channel specified");
00668 return AMI_SUCCESS;
00669 }
00670
00671 if (ast_strlen_zero(state)) {
00672 astman_send_error(s, m, "No state specified");
00673 return AMI_SUCCESS;
00674 }
00675
00676 clearmute = ast_false(state);
00677 c = ast_channel_get_by_name(name);
00678
00679 if (!c) {
00680 astman_send_error(s, m, "No such channel");
00681 return AMI_SUCCESS;
00682 }
00683
00684 if (ast_audiohook_set_mute(c, mixmonitor_spy_type, flag, clearmute)) {
00685 c = ast_channel_unref(c);
00686 astman_send_error(s, m, "Cannot set mute flag");
00687 return AMI_SUCCESS;
00688 }
00689
00690 astman_append(s, "Response: Success\r\n");
00691
00692 if (!ast_strlen_zero(id)) {
00693 astman_append(s, "ActionID: %s\r\n", id);
00694 }
00695
00696 astman_append(s, "\r\n");
00697
00698 c = ast_channel_unref(c);
00699
00700 return AMI_SUCCESS;
00701 }
00702
00703 static struct ast_cli_entry cli_mixmonitor[] = {
00704 AST_CLI_DEFINE(handle_cli_mixmonitor, "Execute a MixMonitor command")
00705 };
00706
00707 static int unload_module(void)
00708 {
00709 int res;
00710
00711 ast_cli_unregister_multiple(cli_mixmonitor, ARRAY_LEN(cli_mixmonitor));
00712 res = ast_unregister_application(stop_app);
00713 res |= ast_unregister_application(app);
00714 res |= ast_manager_unregister("MixMonitorMute");
00715
00716 return res;
00717 }
00718
00719 static int load_module(void)
00720 {
00721 int res;
00722
00723 ast_cli_register_multiple(cli_mixmonitor, ARRAY_LEN(cli_mixmonitor));
00724 res = ast_register_application_xml(app, mixmonitor_exec);
00725 res |= ast_register_application_xml(stop_app, stop_mixmonitor_exec);
00726 res |= ast_manager_register_xml("MixMonitorMute", 0, manager_mute_mixmonitor);
00727
00728 return res;
00729 }
00730
00731 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mixed Audio Monitoring Application");