mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-18 18:46:16 +00:00
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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user