summaryrefslogtreecommitdiff
path: root/apps/app_speech_utils.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2012-02-20 23:43:27 +0000
committerTerry Wilson <twilson@digium.com>2012-02-20 23:43:27 +0000
commit57f42bd74f78d5022631b2ba2269892f8a3a384a (patch)
tree3283ec4ac88c5b3c267f4490b410e5331911f2bb /apps/app_speech_utils.c
parent25e5eb3b96e6d9bcbb2fc02fbd879ae21104c1f5 (diff)
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
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r--apps/app_speech_utils.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 078fcf2e9..8e6113be8 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -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();