This patch created automatically --- include/asterisk/channel.h (svn) +++ include/asterisk/channel.h (working copy) @@ -804,6 +804,18 @@ */ int ast_set_read_format(struct ast_channel *chan, int format); +/*! Gets read format from channel chan */ +/*! + * \param chan channel to get info + * Get read format for channel + * Returns read format + */ +static inline int ast_get_read_format(struct ast_channel *chan) +{ + return chan->readformat; +} + + /*! Sets write format on channel chan */ /*! * \param chan channel to change --- apps/app_amd.c (svn) +++ apps/app_amd.c (working copy) @@ -133,7 +133,7 @@ AST_APP_ARG(argSilenceThreshold); ); - ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat); + ast_verbose(VERBOSE_PREFIX_3 "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, ast_get_read_format(chan)); /* Lets parse the arguments. */ if (ast_strlen_zero(data)) { @@ -182,7 +182,7 @@ initialSilence, greeting, afterGreetingSilence, totalAnalysisTime, minimumWordLength, betweenWordsSilence, maximumNumberOfWords, silenceThreshold ); - readFormat = chan->readformat; + readFormat = ast_get_read_format(chan); res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); if (res < 0 ) { ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", chan->name ); --- apps/app_dumpchan.c (svn) +++ apps/app_dumpchan.c (working copy) @@ -114,7 +114,7 @@ c->rings, c->nativeformats, c->writeformat, - c->readformat, + ast_get_read_format(c), c->fds[0], c->fin & 0x7fffffff, (c->fin & 0x80000000) ? " (DEBUGGED)" : "", c->fout & 0x7fffffff, (c->fout & 0x80000000) ? " (DEBUGGED)" : "", (long)c->whentohangup, hour, --- apps/app_test.c (svn) +++ apps/app_test.c (working copy) @@ -76,7 +76,7 @@ struct timeval start; struct ast_frame *f; int rformat; - rformat = chan->readformat; + rformat = ast_get_read_format(chan); if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) { ast_log(LOG_NOTICE, "Unable to set to linear mode!\n"); return -1; --- apps/app_record.c (svn) +++ apps/app_record.c (working copy) @@ -222,7 +222,7 @@ /* The end of beep code. Now the recording starts */ if (silence > 0) { - rfmt = chan->readformat; + rfmt = ast_get_read_format(chan); res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n"); --- apps/app_ices.c (svn) +++ apps/app_ices.c (working copy) @@ -131,7 +131,7 @@ return -1; } - oreadformat = chan->readformat; + oreadformat = ast_get_read_format(chan); res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { close(fds[0]); --- apps/app_talkdetect.c (svn) +++ apps/app_talkdetect.c (working copy) @@ -115,7 +115,7 @@ res = ast_answer(chan); } if (!res) { - origrformat = chan->readformat; + origrformat = ast_get_read_format(chan); if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR))) ast_log(LOG_WARNING, "Unable to set read format to linear!\n"); } --- apps/app_chanspy.c (svn) +++ apps/app_chanspy.c (working copy) @@ -387,7 +387,7 @@ LOCAL_USER_ADD(u); - oldrf = chan->readformat; + oldrf = ast_get_read_format(chan); oldwf = chan->writeformat; if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_ERROR, "Could Not Set Read Format.\n"); --- apps/app_dictate.c (svn) +++ apps/app_dictate.c (working copy) @@ -122,7 +122,7 @@ if (args.argc > 1 && args.filename) { filename = args.filename; } - oldr = chan->readformat; + oldr = ast_get_read_format(chan); if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode.\n"); LOCAL_USER_REMOVE(u); --- apps/app_waitforsilence.c (svn) +++ apps/app_waitforsilence.c (working copy) @@ -76,7 +76,7 @@ time_t start, now; time(&start); - rfmt = chan->readformat; /* Set to linear mode */ + rfmt = ast_get_read_format(chan); /* Set to linear mode */ res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");