diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
commit | 3bacd4082e2d3a2dd5b8b13635df956aa4f415cd (patch) | |
tree | dd3bc244b8a45aacb932109dc8c12d1f21769d55 /apps | |
parent | 1d3ce2ae5f81e30ec0704efe840bc2c9a24c7e8a (diff) |
Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_alarmreceiver.c | 6 | ||||
-rw-r--r-- | apps/app_amd.c | 2 | ||||
-rw-r--r-- | apps/app_chanspy.c | 2 | ||||
-rw-r--r-- | apps/app_dahdibarge.c | 8 | ||||
-rw-r--r-- | apps/app_dial.c | 36 | ||||
-rw-r--r-- | apps/app_dictate.c | 8 | ||||
-rw-r--r-- | apps/app_disa.c | 4 | ||||
-rw-r--r-- | apps/app_echo.c | 4 | ||||
-rw-r--r-- | apps/app_externalivr.c | 4 | ||||
-rw-r--r-- | apps/app_fax.c | 20 | ||||
-rw-r--r-- | apps/app_festival.c | 6 | ||||
-rw-r--r-- | apps/app_followme.c | 8 | ||||
-rw-r--r-- | apps/app_jack.c | 10 | ||||
-rw-r--r-- | apps/app_meetme.c | 18 | ||||
-rw-r--r-- | apps/app_milliwatt.c | 2 | ||||
-rw-r--r-- | apps/app_mp3.c | 2 | ||||
-rw-r--r-- | apps/app_nbscat.c | 2 | ||||
-rw-r--r-- | apps/app_queue.c | 16 | ||||
-rw-r--r-- | apps/app_record.c | 2 | ||||
-rw-r--r-- | apps/app_sms.c | 2 | ||||
-rw-r--r-- | apps/app_speech_utils.c | 6 | ||||
-rw-r--r-- | apps/app_talkdetect.c | 6 | ||||
-rw-r--r-- | apps/app_test.c | 2 | ||||
-rw-r--r-- | apps/app_url.c | 4 | ||||
-rw-r--r-- | apps/app_waitforring.c | 4 |
25 files changed, 92 insertions, 92 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index 6589ec36d..22dd4af67 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -191,7 +191,7 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i if (f->frametype == AST_FRAME_VOICE) { wf.frametype = AST_FRAME_VOICE; - wf.subclass = AST_FORMAT_ULAW; + wf.subclass.codec = AST_FORMAT_ULAW; wf.offset = AST_FRIENDLY_OFFSET; wf.mallocd = 0; wf.data.ptr = tone_block.buf; @@ -260,7 +260,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int } /* If they hung up, leave */ - if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) { + if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) { if (f->data.uint32) { chan->hangupcause = f->data.uint32; } @@ -275,7 +275,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int continue; } - digit_string[i++] = f->subclass; /* save digit */ + digit_string[i++] = f->subclass.integer; /* save digit */ ast_frfree(f); diff --git a/apps/app_amd.c b/apps/app_amd.c index c5f08aba6..bb656cc39 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -188,7 +188,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) AST_APP_ARG(argMaximumWordLength); ); - ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat); + ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name, chan->cid.cid_ani, chan->cid.cid_rdnis, ast_getformatname(chan->readformat)); /* Lets parse the arguments. */ if (!ast_strlen_zero(parse)) { diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index ad5ed7013..3f0944fc9 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -611,7 +611,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto continue; } - res = (f->frametype == AST_FRAME_DTMF) ? f->subclass : 0; + res = (f->frametype == AST_FRAME_DTMF) ? f->subclass.integer : 0; ast_frfree(f); if (!res) continue; diff --git a/apps/app_dahdibarge.c b/apps/app_dahdibarge.c index 424ba3609..d9dd59054 100644 --- a/apps/app_dahdibarge.c +++ b/apps/app_dahdibarge.c @@ -208,17 +208,17 @@ dahdiretry: f = ast_read(c); if (!f) break; - if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) { + if ((f->frametype == AST_FRAME_DTMF) && (f->subclass.integer == '#')) { ret = 0; ast_frfree(f); break; } else if (fd != chan->fds[0]) { if (f->frametype == AST_FRAME_VOICE) { - if (f->subclass == AST_FORMAT_ULAW) { + if (f->subclass.codec == AST_FORMAT_ULAW) { /* Carefully write */ careful_write(fd, f->data.ptr, f->datalen); } else - ast_log(LOG_WARNING, "Huh? Got a non-ulaw (%d) frame in the conference\n", f->subclass); + ast_log(LOG_WARNING, "Huh? Got a non-ulaw (%s) frame in the conference\n", ast_getformatname(f->subclass.codec)); } } ast_frfree(f); @@ -227,7 +227,7 @@ dahdiretry: if (res > 0) { memset(&fr, 0, sizeof(fr)); fr.frametype = AST_FRAME_VOICE; - fr.subclass = AST_FORMAT_ULAW; + fr.subclass.codec = AST_FORMAT_ULAW; fr.datalen = res; fr.samples = res; fr.data.ptr = buf; diff --git a/apps/app_dial.c b/apps/app_dial.c index 910143d30..68a0b042c 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1004,7 +1004,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, continue; } if (f->frametype == AST_FRAME_CONTROL) { - switch(f->subclass) { + switch (f->subclass.integer) { case AST_CONTROL_ANSWER: /* This is our guy if someone answered. */ if (!peer) { @@ -1145,7 +1145,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } break; default: - ast_debug(1, "Dunno what to do with control type %d\n", f->subclass); + ast_debug(1, "Dunno what to do with control type %d\n", f->subclass.integer); } } else if (single) { switch (f->frametype) { @@ -1157,7 +1157,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } break; case AST_FRAME_HTML: - if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass, f->data.ptr, f->datalen) == -1) { + if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass.integer, f->data.ptr, f->datalen) == -1) { ast_log(LOG_WARNING, "Unable to send URL\n"); } break; @@ -1175,7 +1175,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, else if (!f || (f->frametype != AST_FRAME_VOICE)) printf("Hangup received on %s\n", in->name); #endif - if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) { + if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP))) { /* Got hung up */ *to = -1; strcpy(pa->status, "CANCEL"); @@ -1195,11 +1195,11 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, const char *context; ast_channel_lock(in); context = pbx_builtin_getvar_helper(in, "EXITCONTEXT"); - if (onedigit_goto(in, context, (char) f->subclass, 1)) { - ast_verb(3, "User hit %c to disconnect call.\n", f->subclass); + if (onedigit_goto(in, context, (char) f->subclass.integer, 1)) { + ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer); *to = 0; ast_cdr_noanswer(in->cdr); - *result = f->subclass; + *result = f->subclass.integer; strcpy(pa->status, "CANCEL"); ast_frfree(f); ast_channel_unlock(in); @@ -1209,7 +1209,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) && - detect_disconnect(in, f->subclass, featurecode)) { + detect_disconnect(in, f->subclass.integer, featurecode)) { ast_verb(3, "User requested call disconnect.\n"); *to = 0; strcpy(pa->status, "CANCEL"); @@ -1221,7 +1221,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, /* Forward HTML stuff */ if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag64(outgoing, DIAL_NOFORWARDHTML)) - if (ast_channel_sendhtml(outgoing->chan, f->subclass, f->data.ptr, f->datalen) == -1) + if (ast_channel_sendhtml(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen) == -1) ast_log(LOG_WARNING, "Unable to send URL\n"); if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF_BEGIN) || (f->frametype == AST_FRAME_DTMF_END))) { @@ -1229,16 +1229,16 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n"); } if (single && (f->frametype == AST_FRAME_CONTROL)) { - if ((f->subclass == AST_CONTROL_HOLD) || - (f->subclass == AST_CONTROL_UNHOLD) || - (f->subclass == AST_CONTROL_VIDUPDATE) || - (f->subclass == AST_CONTROL_SRCUPDATE) || - (f->subclass == AST_CONTROL_REDIRECTING)) { - ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name); - ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen); - } else if (f->subclass == AST_CONTROL_CONNECTED_LINE) { + if ((f->subclass.integer == AST_CONTROL_HOLD) || + (f->subclass.integer == AST_CONTROL_UNHOLD) || + (f->subclass.integer == AST_CONTROL_VIDUPDATE) || + (f->subclass.integer == AST_CONTROL_SRCUPDATE) || + (f->subclass.integer == AST_CONTROL_REDIRECTING)) { + ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass.integer, outgoing->chan->name); + ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen); + } else if (f->subclass.integer == AST_CONTROL_CONNECTED_LINE) { if (ast_channel_connected_line_macro(in, outgoing->chan, f, 0, 1)) { - ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen); + ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen); } } } diff --git a/apps/app_dictate.c b/apps/app_dictate.c index 816f15a14..e9e5f0d53 100644 --- a/apps/app_dictate.c +++ b/apps/app_dictate.c @@ -165,7 +165,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data) samples = 0; while (!done && ((res = ast_waitfor(chan, -1)) > -1) && fs && (f = ast_read(chan))) { if (digit) { - struct ast_frame fr = {AST_FRAME_DTMF, digit}; + struct ast_frame fr = {AST_FRAME_DTMF, { .integer = digit } }; ast_queue_frame(chan, &fr); digit = 0; } @@ -173,7 +173,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data) int got = 1; switch(mode) { case DMODE_PLAY: - switch(f->subclass) { + switch (f->subclass.integer) { case '1': ast_set_flag(&flags, DFLAG_PAUSE); mode = DMODE_RECORD; @@ -202,7 +202,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data) } break; case DMODE_RECORD: - switch(f->subclass) { + switch (f->subclass.integer) { case '1': ast_set_flag(&flags, DFLAG_PAUSE); mode = DMODE_PLAY; @@ -219,7 +219,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data) got = 0; } if (!got) { - switch(f->subclass) { + switch (f->subclass.integer) { case '#': done = 1; continue; diff --git a/apps/app_disa.c b/apps/app_disa.c index 49c7ad554..a64d05371 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -220,7 +220,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) return -1; } - if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) { + if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) { if (f->data.uint32) chan->hangupcause = f->data.uint32; ast_frfree(f); @@ -234,7 +234,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) continue; } - j = f->subclass; /* save digit */ + j = f->subclass.integer; /* save digit */ ast_frfree(f); if (!i) { diff --git a/apps/app_echo.c b/apps/app_echo.c index ac718b8b9..1c7211060 100644 --- a/apps/app_echo.c +++ b/apps/app_echo.c @@ -51,7 +51,7 @@ static const char app[] = "Echo"; static int echo_exec(struct ast_channel *chan, const char *data) { int res = -1; - int format; + format_t format; format = ast_best_codec(chan->nativeformats); ast_set_write_format(chan, format); @@ -68,7 +68,7 @@ static int echo_exec(struct ast_channel *chan, const char *data) ast_frfree(f); goto end; } - if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) { + if ((f->frametype == AST_FRAME_DTMF) && (f->subclass.integer == '#')) { res = 0; ast_frfree(f); goto end; diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 1dd1fc43e..725818175 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -627,7 +627,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, break; } if (f->frametype == AST_FRAME_DTMF) { - send_eivr_event(eivr_events, f->subclass, NULL, chan); + send_eivr_event(eivr_events, f->subclass.integer, NULL, chan); if (u->option_autoclear) { if (!u->abort_current_sound && !u->playing_silence) send_eivr_event(eivr_events, 'T', NULL, chan); @@ -640,7 +640,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, u->abort_current_sound = 1; AST_LIST_UNLOCK(&u->playlist); } - } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) { + } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) { ast_chan_log(LOG_NOTICE, chan, "Got AST_CONTROL_HANGUP\n"); send_eivr_event(eivr_events, 'H', NULL, chan); if (f->data.uint32) { diff --git a/apps/app_fax.c b/apps/app_fax.c index 39e00641a..6f6111639 100644 --- a/apps/app_fax.c +++ b/apps/app_fax.c @@ -180,7 +180,7 @@ static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uin struct ast_frame outf = { .frametype = AST_FRAME_MODEM, - .subclass = AST_MODEM_T38, + .subclass.integer = AST_MODEM_T38, .src = __FUNCTION__, }; @@ -327,7 +327,7 @@ static int fax_generator_generate(struct ast_channel *chan, void *data, int len, struct ast_frame outf = { .frametype = AST_FRAME_VOICE, - .subclass = AST_FORMAT_SLINEAR, + .subclass.codec = AST_FORMAT_SLINEAR, .src = __FUNCTION__, }; @@ -413,7 +413,7 @@ static int transmit_audio(fax_session *s) return -1; } if ((inf->frametype == AST_FRAME_CONTROL) && - (inf->subclass == AST_CONTROL_T38_PARAMETERS) && + (inf->subclass.integer == AST_CONTROL_T38_PARAMETERS) && (inf->datalen == sizeof(t38_parameters))) { struct ast_control_t38_parameters *parameters = inf->data.ptr; @@ -517,12 +517,12 @@ static int transmit_audio(fax_session *s) break; } - ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen); + ast_debug(10, "frame %d/%llu, len=%d\n", inf->frametype, (unsigned long long) inf->subclass.codec, inf->datalen); /* Check the frame type. Format also must be checked because there is a chance that a frame in old format was already queued before we set channel format to slinear so it will still be received by ast_read */ - if (inf->frametype == AST_FRAME_VOICE && inf->subclass == AST_FORMAT_SLINEAR) { + if (inf->frametype == AST_FRAME_VOICE && inf->subclass.codec == AST_FORMAT_SLINEAR) { if (fax_rx(&fax, inf->data.ptr, inf->samples) < 0) { /* I know fax_rx never returns errors. The check here is for good style only */ ast_log(LOG_WARNING, "fax_rx returned error\n"); @@ -534,7 +534,7 @@ static int transmit_audio(fax_session *s) last_state = t30state->state; } } else if ((inf->frametype == AST_FRAME_CONTROL) && - (inf->subclass == AST_CONTROL_T38_PARAMETERS)) { + (inf->subclass.integer == AST_CONTROL_T38_PARAMETERS)) { struct ast_control_t38_parameters *parameters = inf->data.ptr; if (parameters->request_response == AST_T38_NEGOTIATED) { @@ -678,15 +678,15 @@ static int transmit_t38(fax_session *s) break; } - ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen); + ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass.integer, inf->datalen); - if (inf->frametype == AST_FRAME_MODEM && inf->subclass == AST_MODEM_T38) { + if (inf->frametype == AST_FRAME_MODEM && inf->subclass.integer == AST_MODEM_T38) { t38_core_rx_ifp_packet(t38state, inf->data.ptr, inf->datalen, inf->seqno); if (last_state != t30state->state) { state_change = ast_tvnow(); last_state = t30state->state; } - } else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38_PARAMETERS) { + } else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass.integer == AST_CONTROL_T38_PARAMETERS) { struct ast_control_t38_parameters *parameters = inf->data.ptr; if (parameters->request_response == AST_T38_TERMINATED) { ast_debug(1, "T38 down, finishing\n"); @@ -733,7 +733,7 @@ disable_t38: return -1; } if ((inf->frametype == AST_FRAME_CONTROL) && - (inf->subclass == AST_CONTROL_T38_PARAMETERS) && + (inf->subclass.integer == AST_CONTROL_T38_PARAMETERS) && (inf->datalen == sizeof(t38_parameters))) { struct ast_control_t38_parameters *parameters = inf->data.ptr; diff --git a/apps/app_festival.c b/apps/app_festival.c index 0b917a725..c547cfc6b 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -211,8 +211,8 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in } if (f->frametype == AST_FRAME_DTMF) { ast_debug(1, "User pressed a key\n"); - if (intkeys && strchr(intkeys, f->subclass)) { - res = f->subclass; + if (intkeys && strchr(intkeys, f->subclass.integer)) { + res = f->subclass.integer; ast_frfree(f); break; } @@ -228,7 +228,7 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in res = read(fds[0], myf.frdata, needed); if (res > 0) { myf.f.frametype = AST_FRAME_VOICE; - myf.f.subclass = AST_FORMAT_SLINEAR; + myf.f.subclass.codec = AST_FORMAT_SLINEAR; myf.f.datalen = res; myf.f.samples = res / 2; myf.f.offset = AST_FRIENDLY_OFFSET; diff --git a/apps/app_followme.c b/apps/app_followme.c index 363abb52a..db2d984b7 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -643,7 +643,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us f = ast_read(winner); if (f) { if (f->frametype == AST_FRAME_CONTROL) { - switch(f->subclass) { + switch (f->subclass.integer) { case AST_CONTROL_HANGUP: ast_verb(3, "%s received a hangup frame.\n", winner->name); if (f->data.uint32) { @@ -718,7 +718,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us ast_verb(3, "%s stopped sounds\n", winner->name); break; default: - ast_debug(1, "Dunno what to do with control type %d\n", f->subclass); + ast_debug(1, "Dunno what to do with control type %d\n", f->subclass.integer); break; } } @@ -726,8 +726,8 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us if (winner->stream) ast_stopstream(winner); tmpuser->digts = 0; - ast_debug(1, "DTMF received: %c\n",(char) f->subclass); - tmpuser->yn[tmpuser->ynidx] = (char) f->subclass; + ast_debug(1, "DTMF received: %c\n", (char) f->subclass.integer); + tmpuser->yn[tmpuser->ynidx] = (char) f->subclass.integer; tmpuser->ynidx++; ast_debug(1, "DTMF string: %s\n", tmpuser->yn); if (tmpuser->ynidx >= ynlongest) { diff --git a/apps/app_jack.c b/apps/app_jack.c index 8d8c1f8cc..e8f717b3f 100644 --- a/apps/app_jack.c +++ b/apps/app_jack.c @@ -604,7 +604,7 @@ static void handle_jack_audio(struct ast_channel *chan, struct jack_data *jack_d short buf[160]; struct ast_frame f = { .frametype = AST_FRAME_VOICE, - .subclass = AST_FORMAT_SLINEAR, + .subclass.codec = AST_FORMAT_SLINEAR, .src = "JACK", .data.ptr = buf, .datalen = sizeof(buf), @@ -781,7 +781,7 @@ static int jack_exec(struct ast_channel *chan, const char *data) switch (f->frametype) { case AST_FRAME_CONTROL: - if (f->subclass == AST_CONTROL_HANGUP) + if (f->subclass.integer == AST_CONTROL_HANGUP) jack_data->stop = 1; break; case AST_FRAME_VOICE: @@ -827,9 +827,9 @@ static int jack_hook_callback(struct ast_audiohook *audiohook, struct ast_channe if (frame->frametype != AST_FRAME_VOICE) return 0; - if (frame->subclass != AST_FORMAT_SLINEAR) { - ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %d\n", - frame->subclass); + if (frame->subclass.codec != AST_FORMAT_SLINEAR) { + ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %s\n", + ast_getformatname(frame->subclass.codec)); return 0; } diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 7636836f9..dedb7d14b 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -2931,11 +2931,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c break; } if (f->frametype == AST_FRAME_DTMF) { - dtmfstr[0] = f->subclass; + dtmfstr[0] = f->subclass.integer; dtmfstr[1] = '\0'; } - if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) { + if ((f->frametype == AST_FRAME_VOICE) && (f->subclass.codec == AST_FORMAT_SLINEAR)) { if (user->talk.actual) { ast_frame_adjust_volume(f, user->talk.actual); } @@ -2987,7 +2987,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c careful_write(fd, f->data.ptr, f->datalen, 0); } } - } else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) { + } else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass.integer == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) { if (confflags & CONFFLAG_PASS_DTMF) { conf_queue_dtmf(conf, user, f); } @@ -3020,7 +3020,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c dtmf = 0; } } else { - dtmf = f->subclass; + dtmf = f->subclass.integer; } if (dtmf) { switch(dtmf) { @@ -3121,7 +3121,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c dtmf = 0; } } else { - dtmf = f->subclass; + dtmf = f->subclass.integer; } if (dtmf) { switch (dtmf) { @@ -3211,7 +3211,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c } else { ast_debug(2, "Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", dtmfstr, exitcontext); } - } else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_KEYEXIT) && (strchr(exitkeys, f->subclass))) { + } else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_KEYEXIT) && (strchr(exitkeys, f->subclass.integer))) { pbx_builtin_setvar_helper(chan, "MEETME_EXIT_KEY", dtmfstr); if (confflags & CONFFLAG_PASS_DTMF) { @@ -3224,7 +3224,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c && confflags & CONFFLAG_PASS_DTMF) { conf_queue_dtmf(conf, user, f); } else if ((confflags & CONFFLAG_SLA_STATION) && f->frametype == AST_FRAME_CONTROL) { - switch (f->subclass) { + switch (f->subclass.integer) { case AST_CONTROL_HOLD: sla_queue_event_conf(SLA_EVENT_HOLD, chan, conf); break; @@ -3236,7 +3236,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c } else { ast_debug(1, "Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n", - chan->name, f->frametype, f->subclass); + chan->name, f->frametype, f->subclass.integer); } ast_frfree(f); } else if (outfd > -1) { @@ -3244,7 +3244,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c if (res > 0) { memset(&fr, 0, sizeof(fr)); fr.frametype = AST_FRAME_VOICE; - fr.subclass = AST_FORMAT_SLINEAR; + fr.subclass.codec = AST_FORMAT_SLINEAR; fr.datalen = res; fr.samples = res / 2; fr.data.ptr = buf; diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c index b6d940384..24137606d 100644 --- a/apps/app_milliwatt.c +++ b/apps/app_milliwatt.c @@ -78,7 +78,7 @@ static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int int i, *indexp = (int *) data; struct ast_frame wf = { .frametype = AST_FRAME_VOICE, - .subclass = AST_FORMAT_ULAW, + .subclass.codec = AST_FORMAT_ULAW, .offset = AST_FRIENDLY_OFFSET, .src = __FUNCTION__, }; diff --git a/apps/app_mp3.c b/apps/app_mp3.c index 1cea8e329..b177fb027 100644 --- a/apps/app_mp3.c +++ b/apps/app_mp3.c @@ -169,7 +169,7 @@ static int mp3_exec(struct ast_channel *chan, const char *data) res = timed_read(fds[0], myf.frdata, sizeof(myf.frdata), timeout); if (res > 0) { myf.f.frametype = AST_FRAME_VOICE; - myf.f.subclass = AST_FORMAT_SLINEAR; + myf.f.subclass.codec = AST_FORMAT_SLINEAR; myf.f.datalen = res; myf.f.samples = res / 2; myf.f.mallocd = 0; diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c index ec9347803..dd7637a83 100644 --- a/apps/app_nbscat.c +++ b/apps/app_nbscat.c @@ -148,7 +148,7 @@ static int NBScat_exec(struct ast_channel *chan, const char *data) res = timed_read(fds[0], myf.frdata, sizeof(myf.frdata)); if (res > 0) { myf.f.frametype = AST_FRAME_VOICE; - myf.f.subclass = AST_FORMAT_SLINEAR; + myf.f.subclass.codec = AST_FORMAT_SLINEAR; myf.f.datalen = res; myf.f.samples = res / 2; myf.f.mallocd = 0; diff --git a/apps/app_queue.c b/apps/app_queue.c index 883b3d660..bdbb91560 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3299,7 +3299,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte f = ast_read(winner); if (f) { if (f->frametype == AST_FRAME_CONTROL) { - switch (f->subclass) { + switch (f->subclass.integer) { case AST_CONTROL_ANSWER: /* This is our guy if someone answered. */ if (!peer) { @@ -3389,7 +3389,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte } break; default: - ast_debug(1, "Dunno what to do with control type %d\n", f->subclass); + ast_debug(1, "Dunno what to do with control type %d\n", f->subclass.integer); break; } } @@ -3413,7 +3413,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte /* If we received an event from the caller, deal with it. */ if (winner == in) { f = ast_read(in); - if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) { + if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP))) { /* Got hung up */ *to = -1; if (f) { @@ -3424,16 +3424,16 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte } return NULL; } - if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) { - ast_verb(3, "User hit %c to disconnect call.\n", f->subclass); + if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass.integer == '*')) { + ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer); *to = 0; ast_frfree(f); return NULL; } - if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass)) { - ast_verb(3, "User pressed digit: %c\n", f->subclass); + if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass.integer)) { + ast_verb(3, "User pressed digit: %c\n", f->subclass.integer); *to = 0; - *digit = f->subclass; + *digit = f->subclass.integer; ast_frfree(f); return NULL; } diff --git a/apps/app_record.c b/apps/app_record.c index f6e067c84..ce4181d6a 100644 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -372,7 +372,7 @@ static int record_exec(struct ast_channel *chan, const char *data) break; } } else if ((f->frametype == AST_FRAME_DTMF) && - (f->subclass == terminator)) { + (f->subclass.integer == terminator)) { ast_frfree(f); pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "DTMF"); break; diff --git a/apps/app_sms.c b/apps/app_sms.c index bed9f5c7e..6a2b0c03f 100644 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -1603,7 +1603,7 @@ static int sms_generate(struct ast_channel *chan, void *data, int len, int sampl buf = alloca(len); f.frametype = AST_FRAME_VOICE; - f.subclass = __OUT_FMT; + f.subclass.codec = __OUT_FMT; f.datalen = samples * sizeof(*buf); f.offset = AST_FRIENDLY_OFFSET; f.mallocd = 0; diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index cd1c4d106..28c37a31d 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -824,7 +824,7 @@ static int speech_background(struct ast_channel *chan, const char *data) /* Free the frame we received */ switch (f->frametype) { case AST_FRAME_DTMF: - if (dtmf_terminator != '\0' && f->subclass == dtmf_terminator) { + if (dtmf_terminator != '\0' && f->subclass.integer == dtmf_terminator) { done = 1; } else { if (chan->stream != NULL) { @@ -836,7 +836,7 @@ static int speech_background(struct ast_channel *chan, const char *data) started = 1; } start = ast_tvnow(); - snprintf(tmp, sizeof(tmp), "%c", f->subclass); + snprintf(tmp, sizeof(tmp), "%c", f->subclass.integer); strncat(dtmf, tmp, sizeof(dtmf) - strlen(dtmf) - 1); /* If the maximum length of the DTMF has been reached, stop now */ if (max_dtmf_len && strlen(dtmf) == max_dtmf_len) @@ -844,7 +844,7 @@ static int speech_background(struct ast_channel *chan, const char *data) } break; case AST_FRAME_CONTROL: - switch (f->subclass) { + switch (f->subclass.integer) { case AST_CONTROL_HANGUP: /* Since they hung up we should destroy the speech structure */ done = 3; diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 83b8886cf..0db0012bc 100644 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -173,15 +173,15 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) break; } else if (fr->frametype == AST_FRAME_DTMF) { char t[2]; - t[0] = fr->subclass; + t[0] = fr->subclass.integer; t[1] = '\0'; if (ast_canmatch_extension(chan, chan->context, t, 1, chan->cid.cid_num)) { /* They entered a valid extension, or might be anyhow */ - res = fr->subclass; + res = fr->subclass.integer; ast_frfree(fr); break; } - } else if ((fr->frametype == AST_FRAME_VOICE) && (fr->subclass == AST_FORMAT_SLINEAR) && continue_analysis) { + } else if ((fr->frametype == AST_FRAME_VOICE) && (fr->subclass.codec == AST_FORMAT_SLINEAR) && continue_analysis) { int totalsilence; int ms; res = ast_dsp_silence(dsp, fr, &totalsilence); diff --git a/apps/app_test.c b/apps/app_test.c index 64ce7b43f..a7aa7b657 100644 --- a/apps/app_test.c +++ b/apps/app_test.c @@ -106,7 +106,7 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who) res = -1; break; } - if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) { + if ((f->frametype == AST_FRAME_VOICE) && (f->subclass.codec == AST_FORMAT_SLINEAR)) { foo = (short *)f->data.ptr; for (x=0;x<f->samples;x++) { noise += abs(foo[x]); diff --git a/apps/app_url.c b/apps/app_url.c index a36daa26b..533c11212 100644 --- a/apps/app_url.c +++ b/apps/app_url.c @@ -139,7 +139,7 @@ static int sendurl_exec(struct ast_channel *chan, const char *data) break; } if (f->frametype == AST_FRAME_HTML) { - switch(f->subclass) { + switch (f->subclass.integer) { case AST_HTML_LDCOMPLETE: res = 0; ast_frfree(f); @@ -154,7 +154,7 @@ static int sendurl_exec(struct ast_channel *chan, const char *data) goto out; break; default: - ast_log(LOG_WARNING, "Don't know what to do with HTML subclass %d\n", f->subclass); + ast_log(LOG_WARNING, "Don't know what to do with HTML subclass %d\n", f->subclass.integer); }; } ast_frfree(f); diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c index dfe33db51..1df60795f 100644 --- a/apps/app_waitforring.c +++ b/apps/app_waitforring.c @@ -78,7 +78,7 @@ static int waitforring_exec(struct ast_channel *chan, const char *data) res = -1; break; } - if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) { + if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_RING)) { ast_verb(3, "Got a ring but still waiting for timeout\n"); } ast_frfree(f); @@ -99,7 +99,7 @@ static int waitforring_exec(struct ast_channel *chan, const char *data) res = -1; break; } - if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) { + if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_RING)) { ast_verb(3, "Got a ring after the timeout\n"); ast_frfree(f); break; |