ast_channel opaquification of pointers and integral types

Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2012-02-20 23:43:27 +00:00
parent 25e5eb3b96
commit 57f42bd74f
123 changed files with 2902 additions and 2423 deletions

View File

@@ -491,7 +491,7 @@ static int speech_create(struct ast_channel *chan, const char *data)
struct ast_datastore *datastore = NULL;
/* Request a speech object */
speech = ast_speech_new(data, chan->nativeformats);
speech = ast_speech_new(data, ast_channel_nativeformats(chan));
if (speech == NULL) {
/* Not available */
pbx_builtin_setvar_helper(chan, "ERROR", "1");
@@ -672,7 +672,7 @@ static int speech_background(struct ast_channel *chan, const char *data)
}
/* If channel is not already answered, then answer it */
if (chan->_state != AST_STATE_UP && !ast_test_flag(&options, SB_OPT_NOANSWER)
if (ast_channel_state(chan) != AST_STATE_UP && !ast_test_flag(&options, SB_OPT_NOANSWER)
&& ast_answer(chan)) {
return -1;
}
@@ -721,7 +721,7 @@ static int speech_background(struct ast_channel *chan, const char *data)
/* Okay it's streaming so go into a loop grabbing frames! */
while (done == 0) {
/* If the filename is null and stream is not running, start up a new sound file */
if (!quieted && (chan->streamid == -1 && chan->timingfunc == NULL) && (filename = strsep(&filename_tmp, "&"))) {
if (!quieted && (ast_channel_streamid(chan) == -1 && chan->timingfunc == NULL) && (filename = strsep(&filename_tmp, "&"))) {
/* Discard old stream information */
ast_stopstream(chan);
/* Start new stream */
@@ -729,10 +729,10 @@ static int speech_background(struct ast_channel *chan, const char *data)
}
/* Run scheduled stuff */
ast_sched_runq(chan->sched);
ast_sched_runq(ast_channel_sched(chan));
/* Yay scheduling */
res = ast_sched_wait(chan->sched);
res = ast_sched_wait(ast_channel_sched(chan));
if (res < 0)
res = 1000;
@@ -760,7 +760,7 @@ static int speech_background(struct ast_channel *chan, const char *data)
/* Do checks on speech structure to see if it's changed */
ast_mutex_lock(&speech->lock);
if (ast_test_flag(speech, AST_SPEECH_QUIET)) {
if (chan->stream)
if (ast_channel_stream(chan))
ast_stopstream(chan);
ast_clear_flag(speech, AST_SPEECH_QUIET);
quieted = 1;
@@ -769,9 +769,9 @@ static int speech_background(struct ast_channel *chan, const char *data)
switch (speech->state) {
case AST_SPEECH_STATE_READY:
/* If audio playback has stopped do a check for timeout purposes */
if (chan->streamid == -1 && chan->timingfunc == NULL)
if (ast_channel_streamid(chan) == -1 && chan->timingfunc == NULL)
ast_stopstream(chan);
if (!quieted && chan->stream == NULL && timeout && started == 0 && !filename_tmp) {
if (!quieted && ast_channel_stream(chan) == NULL && timeout && started == 0 && !filename_tmp) {
if (timeout == -1) {
done = 1;
if (f)
@@ -789,13 +789,13 @@ static int speech_background(struct ast_channel *chan, const char *data)
case AST_SPEECH_STATE_WAIT:
/* Cue up waiting sound if not already playing */
if (!strlen(dtmf)) {
if (chan->stream == NULL) {
if (ast_channel_stream(chan) == NULL) {
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
speech_streamfile(chan, speech->processing_sound, ast_channel_language(chan));
}
}
} else if (chan->streamid == -1 && chan->timingfunc == NULL) {
} else if (ast_channel_streamid(chan) == -1 && chan->timingfunc == NULL) {
ast_stopstream(chan);
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
@@ -814,7 +814,7 @@ static int speech_background(struct ast_channel *chan, const char *data)
/* Break out of our background too */
done = 1;
/* Stop audio playback */
if (chan->stream != NULL) {
if (ast_channel_stream(chan) != NULL) {
ast_stopstream(chan);
}
}
@@ -833,12 +833,12 @@ static int speech_background(struct ast_channel *chan, const char *data)
done = 1;
} else {
quieted = 1;
if (chan->stream != NULL) {
if (ast_channel_stream(chan) != NULL) {
ast_stopstream(chan);
}
if (!started) {
/* Change timeout to be 5 seconds for DTMF input */
timeout = (chan->pbx && chan->pbx->dtimeoutms) ? chan->pbx->dtimeoutms : 5000;
timeout = (ast_channel_pbx(chan) && ast_channel_pbx(chan)->dtimeoutms) ? ast_channel_pbx(chan)->dtimeoutms : 5000;
started = 1;
}
start = ast_tvnow();