diff --git a/apps/app_queue.c b/apps/app_queue.c index 1efc3531cb2d31e50544b44a694c13b5994ab044..f348dd4d73a2ee6976de553842e51817e72630d4 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2649,13 +2649,13 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce else which = peer; if (monitorfilename) - ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 ); + ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT); else if (qe->chan->cdr) - ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 ); + ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT); else { /* Last ditch effort -- no CDR, make up something */ snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random()); - ast_monitor_start(which, qe->parent->monfmt, tmpid, 1 ); + ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT); } if (qe->parent->monjoin) ast_monitor_setjoinfiles(which, 1); diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 128cd53a40c66833329b75d843c21c92bcf2ed05..2bf18417c3df469307793dacc2b2c90c344b7c03 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -391,7 +391,7 @@ static int __agent_start_monitoring(struct ast_channel *ast, struct agent_pvt *p if ((pointer = strchr(filename, '.'))) *pointer = '-'; snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename); - ast_monitor_start(ast, recordformat, tmp, needlock); + ast_monitor_start(ast, recordformat, tmp, needlock, X_REC_IN | X_REC_OUT); ast_monitor_setjoinfiles(ast, 1); snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix ? urlprefix : "", filename, recordformatext); #if 0 diff --git a/include/asterisk/monitor.h b/include/asterisk/monitor.h index cefb89180d16d0dd95706514f598a109231c4467..7f32b699413a270c052402df90761a3facdcdb9d 100644 --- a/include/asterisk/monitor.h +++ b/include/asterisk/monitor.h @@ -30,6 +30,11 @@ enum AST_MONITORING_STATE { AST_MONITOR_PAUSED }; +/* Streams recording control */ +#define X_REC_IN 1 +#define X_REC_OUT 2 +#define X_JOIN 4 + /*! Responsible for channel monitoring data */ struct ast_channel_monitor { struct ast_filestream *read_stream; diff --git a/res/res_monitor.c b/res/res_monitor.c index 38d465b274b00c34fd5a3cc2d1d627d5599c5f51..cc4701049b6639deddd254b2551ffc0d8895b23d 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -61,11 +61,6 @@ AST_MUTEX_DEFINE_STATIC(monitorlock); ast_channel_unlock(lock); \ } while (0) -/* Streams recording control */ -#define X_REC_IN 1 -#define X_REC_OUT 2 -#define X_JOIN 4 - static unsigned long seq = 0; static char *monitor_synopsis = "Monitor a channel"; @@ -132,7 +127,14 @@ static int ast_monitor_set_state(struct ast_channel *chan, int state) return 0; } -/* Start monitoring a channel */ +/*! \brief Start monitoring a channel + * \param chan ast_channel struct to record + * \param format_spec file format to use for recording + * \param fname_base filename base to record to + * \param need_lock whether to lock the channel mutex + * \param stream_action whether to record the input and/or output streams. X_REC_IN | X_REC_OUT is most often used + * \returns 0 on success, -1 on failure + */ int ast_monitor_start( struct ast_channel *chan, const char *format_spec, const char *fname_base, int need_lock, int stream_action) {