[svn-commits] tilghman: trunk r227580 - in /trunk: ./ apps/ bridges/ channels/ channels/h32...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Nov 4 08:05:27 CST 2009
Author: tilghman
Date: Wed Nov 4 08:05:12 2009
New Revision: 227580
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227580
Log:
Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/
Added:
trunk/doc/codec-64bit.txt (with props)
trunk/include/asterisk/frame_defs.h (with props)
Modified:
trunk/apps/app_alarmreceiver.c
trunk/apps/app_amd.c
trunk/apps/app_chanspy.c
trunk/apps/app_dahdibarge.c
trunk/apps/app_dial.c
trunk/apps/app_dictate.c
trunk/apps/app_disa.c
trunk/apps/app_echo.c
trunk/apps/app_externalivr.c
trunk/apps/app_fax.c
trunk/apps/app_festival.c
trunk/apps/app_followme.c
trunk/apps/app_jack.c
trunk/apps/app_meetme.c
trunk/apps/app_milliwatt.c
trunk/apps/app_mp3.c
trunk/apps/app_nbscat.c
trunk/apps/app_queue.c
trunk/apps/app_record.c
trunk/apps/app_sms.c
trunk/apps/app_speech_utils.c
trunk/apps/app_talkdetect.c
trunk/apps/app_test.c
trunk/apps/app_url.c
trunk/apps/app_waitforring.c
trunk/bridges/bridge_softmix.c
trunk/channels/chan_agent.c
trunk/channels/chan_alsa.c
trunk/channels/chan_bridge.c
trunk/channels/chan_console.c
trunk/channels/chan_dahdi.c
trunk/channels/chan_gtalk.c
trunk/channels/chan_h323.c
trunk/channels/chan_iax2.c
trunk/channels/chan_jingle.c
trunk/channels/chan_local.c
trunk/channels/chan_mgcp.c
trunk/channels/chan_misdn.c
trunk/channels/chan_multicast_rtp.c
trunk/channels/chan_oss.c
trunk/channels/chan_phone.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_unistim.c
trunk/channels/chan_vpb.cc
trunk/channels/h323/chan_h323.h
trunk/channels/iax2-parser.c
trunk/channels/iax2-parser.h
trunk/channels/iax2.h
trunk/channels/sig_analog.c
trunk/channels/sig_pri.c
trunk/codecs/codec_dahdi.c
trunk/codecs/codec_ulaw.c
trunk/codecs/ex_adpcm.h
trunk/codecs/ex_alaw.h
trunk/codecs/ex_g722.h
trunk/codecs/ex_g726.h
trunk/codecs/ex_gsm.h
trunk/codecs/ex_ilbc.h
trunk/codecs/ex_lpc10.h
trunk/codecs/ex_speex.h
trunk/codecs/ex_ulaw.h
trunk/configure
trunk/configure.ac
trunk/formats/format_g723.c
trunk/formats/format_g726.c
trunk/formats/format_g729.c
trunk/formats/format_gsm.c
trunk/formats/format_h263.c
trunk/formats/format_h264.c
trunk/formats/format_ilbc.c
trunk/formats/format_jpeg.c
trunk/formats/format_ogg_vorbis.c
trunk/formats/format_pcm.c
trunk/formats/format_siren14.c
trunk/formats/format_siren7.c
trunk/formats/format_sln.c
trunk/formats/format_sln16.c
trunk/formats/format_vox.c
trunk/formats/format_wav.c
trunk/formats/format_wav_gsm.c
trunk/funcs/func_volume.c
trunk/include/asterisk/abstract_jb.h
trunk/include/asterisk/audiohook.h
trunk/include/asterisk/autoconfig.h.in
trunk/include/asterisk/bridging.h
trunk/include/asterisk/bridging_technology.h
trunk/include/asterisk/channel.h
trunk/include/asterisk/compat.h
trunk/include/asterisk/frame.h
trunk/include/asterisk/pbx.h
trunk/include/asterisk/rtp_engine.h
trunk/include/asterisk/slin.h
trunk/include/asterisk/slinfactory.h
trunk/include/asterisk/translate.h
trunk/include/asterisk/unaligned.h
trunk/main/abstract_jb.c
trunk/main/app.c
trunk/main/asterisk.exports
trunk/main/audiohook.c
trunk/main/autoservice.c
trunk/main/bridging.c
trunk/main/channel.c
trunk/main/dial.c
trunk/main/dsp.c
trunk/main/features.c
trunk/main/file.c
trunk/main/frame.c
trunk/main/indications.c
trunk/main/manager.c
trunk/main/pbx.c
trunk/main/rtp_engine.c
trunk/main/slinfactory.c
trunk/main/strcompat.c
trunk/main/translate.c
trunk/main/udptl.c
trunk/pbx/pbx_spool.c
trunk/res/res_adsi.c
trunk/res/res_agi.c
trunk/res/res_musiconhold.c
trunk/res/res_rtp_asterisk.c
trunk/res/res_rtp_multicast.c
Modified: trunk/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Wed Nov 4 08:05:12 2009
@@ -191,7 +191,7 @@
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 @@
}
/* 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 @@
continue;
}
- digit_string[i++] = f->subclass; /* save digit */
+ digit_string[i++] = f->subclass.integer; /* save digit */
ast_frfree(f);
Modified: trunk/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_amd.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Wed Nov 4 08:05:12 2009
@@ -188,7 +188,7 @@
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)) {
Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Wed Nov 4 08:05:12 2009
@@ -611,7 +611,7 @@
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;
Modified: trunk/apps/app_dahdibarge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dahdibarge.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_dahdibarge.c (original)
+++ trunk/apps/app_dahdibarge.c Wed Nov 4 08:05:12 2009
@@ -208,17 +208,17 @@
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 @@
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;
Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Nov 4 08:05:12 2009
@@ -1004,7 +1004,7 @@
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 @@
}
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 @@
}
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 @@
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 @@
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 @@
}
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 @@
/* 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 @@
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);
}
}
}
Modified: trunk/apps/app_dictate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dictate.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_dictate.c (original)
+++ trunk/apps/app_dictate.c Wed Nov 4 08:05:12 2009
@@ -165,7 +165,7 @@
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 @@
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 @@
}
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 @@
got = 0;
}
if (!got) {
- switch(f->subclass) {
+ switch (f->subclass.integer) {
case '#':
done = 1;
continue;
Modified: trunk/apps/app_disa.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_disa.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Wed Nov 4 08:05:12 2009
@@ -220,7 +220,7 @@
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 @@
continue;
}
- j = f->subclass; /* save digit */
+ j = f->subclass.integer; /* save digit */
ast_frfree(f);
if (!i) {
Modified: trunk/apps/app_echo.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_echo.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_echo.c (original)
+++ trunk/apps/app_echo.c Wed Nov 4 08:05:12 2009
@@ -51,7 +51,7 @@
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 @@
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;
Modified: trunk/apps/app_externalivr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_externalivr.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_externalivr.c (original)
+++ trunk/apps/app_externalivr.c Wed Nov 4 08:05:12 2009
@@ -627,7 +627,7 @@
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 @@
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) {
Modified: trunk/apps/app_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_fax.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Wed Nov 4 08:05:12 2009
@@ -180,7 +180,7 @@
struct ast_frame outf = {
.frametype = AST_FRAME_MODEM,
- .subclass = AST_MODEM_T38,
+ .subclass.integer = AST_MODEM_T38,
.src = __FUNCTION__,
};
@@ -327,7 +327,7 @@
struct ast_frame outf = {
.frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
+ .subclass.codec = AST_FORMAT_SLINEAR,
.src = __FUNCTION__,
};
@@ -413,7 +413,7 @@
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 @@
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 @@
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 @@
break;
}
- ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen);
-
- if (inf->frametype == AST_FRAME_MODEM && inf->subclass == AST_MODEM_T38) {
+ ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass.integer, inf->datalen);
+
+ 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 @@
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;
Modified: trunk/apps/app_festival.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_festival.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_festival.c (original)
+++ trunk/apps/app_festival.c Wed Nov 4 08:05:12 2009
@@ -211,8 +211,8 @@
}
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 @@
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;
Modified: trunk/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_followme.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Wed Nov 4 08:05:12 2009
@@ -643,7 +643,7 @@
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 @@
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 @@
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) {
Modified: trunk/apps/app_jack.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_jack.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_jack.c (original)
+++ trunk/apps/app_jack.c Wed Nov 4 08:05:12 2009
@@ -604,7 +604,7 @@
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 @@
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 @@
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;
}
Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Nov 4 08:05:12 2009
@@ -2931,11 +2931,11 @@
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 @@
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 @@
dtmf = 0;
}
} else {
- dtmf = f->subclass;
+ dtmf = f->subclass.integer;
}
if (dtmf) {
switch(dtmf) {
@@ -3121,7 +3121,7 @@
dtmf = 0;
}
} else {
- dtmf = f->subclass;
+ dtmf = f->subclass.integer;
}
if (dtmf) {
switch (dtmf) {
@@ -3211,7 +3211,7 @@
} 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 @@
&& 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 @@
} 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 @@
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;
Modified: trunk/apps/app_milliwatt.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_milliwatt.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_milliwatt.c (original)
+++ trunk/apps/app_milliwatt.c Wed Nov 4 08:05:12 2009
@@ -78,7 +78,7 @@
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__,
};
Modified: trunk/apps/app_mp3.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_mp3.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_mp3.c (original)
+++ trunk/apps/app_mp3.c Wed Nov 4 08:05:12 2009
@@ -169,7 +169,7 @@
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;
Modified: trunk/apps/app_nbscat.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_nbscat.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_nbscat.c (original)
+++ trunk/apps/app_nbscat.c Wed Nov 4 08:05:12 2009
@@ -148,7 +148,7 @@
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;
Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Nov 4 08:05:12 2009
@@ -3299,7 +3299,7 @@
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 @@
}
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 @@
/* 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 @@
}
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;
}
Modified: trunk/apps/app_record.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_record.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_record.c (original)
+++ trunk/apps/app_record.c Wed Nov 4 08:05:12 2009
@@ -372,7 +372,7 @@
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;
Modified: trunk/apps/app_sms.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_sms.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_sms.c (original)
+++ trunk/apps/app_sms.c Wed Nov 4 08:05:12 2009
@@ -1603,7 +1603,7 @@
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;
Modified: trunk/apps/app_speech_utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Wed Nov 4 08:05:12 2009
@@ -824,7 +824,7 @@
/* 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 @@
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 @@
}
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;
Modified: trunk/apps/app_talkdetect.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_talkdetect.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_talkdetect.c (original)
+++ trunk/apps/app_talkdetect.c Wed Nov 4 08:05:12 2009
@@ -173,15 +173,15 @@
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);
Modified: trunk/apps/app_test.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_test.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_test.c (original)
+++ trunk/apps/app_test.c Wed Nov 4 08:05:12 2009
@@ -106,7 +106,7 @@
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]);
Modified: trunk/apps/app_url.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_url.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_url.c (original)
+++ trunk/apps/app_url.c Wed Nov 4 08:05:12 2009
@@ -139,7 +139,7 @@
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 @@
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);
Modified: trunk/apps/app_waitforring.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_waitforring.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/apps/app_waitforring.c (original)
+++ trunk/apps/app_waitforring.c Wed Nov 4 08:05:12 2009
@@ -78,7 +78,7 @@
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 @@
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;
Modified: trunk/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_softmix.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/bridges/bridge_softmix.c (original)
+++ trunk/bridges/bridge_softmix.c Wed Nov 4 08:05:12 2009
@@ -123,9 +123,9 @@
/* Setup frame parameters */
sc->frame.frametype = AST_FRAME_VOICE;
#ifdef SOFTMIX_16_SUPPORT
- sc->frame.subclass = AST_FORMAT_SLINEAR16;
+ sc->frame.subclass.codec = AST_FORMAT_SLINEAR16;
#else
- sc->frame.subclass = AST_FORMAT_SLINEAR;
+ sc->frame.subclass.codec = AST_FORMAT_SLINEAR;
#endif
sc->frame.data.ptr = sc->final_buf;
sc->frame.datalen = SOFTMIX_DATALEN;
@@ -168,9 +168,9 @@
/* If a frame was provided add it to the smoother */
#ifdef SOFTMIX_16_SUPPORT
- if (frame->frametype == AST_FRAME_VOICE && frame->subclass == AST_FORMAT_SLINEAR16) {
+ if (frame->frametype == AST_FRAME_VOICE && frame->subclass.codec == AST_FORMAT_SLINEAR16) {
#else
- if (frame->frametype == AST_FRAME_VOICE && frame->subclass == AST_FORMAT_SLINEAR) {
+ if (frame->frametype == AST_FRAME_VOICE && frame->subclass.codec == AST_FORMAT_SLINEAR) {
#endif
ast_slinfactory_feed(&sc->factory, frame);
}
Modified: trunk/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_agent.c?view=diff&rev=227580&r1=227579&r2=227580
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Wed Nov 4 08:05:12 2009
@@ -280,10 +280,11 @@
#define CHECK_FORMATS(ast, p) do { \
if (p->chan) {\
if (ast->nativeformats != p->chan->nativeformats) { \
- ast_debug(1, "Native formats changing from %d to %d\n", ast->nativeformats, p->chan->nativeformats); \
+ char tmp1[256], tmp2[256]; \
+ ast_debug(1, "Native formats changing from '%s' to '%s'\n", ast_getformatname_multiple(tmp1, sizeof(tmp1), ast->nativeformats), ast_getformatname_multiple(tmp2, sizeof(tmp2), p->chan->nativeformats)); \
/* Native formats changed, reset things */ \
ast->nativeformats = p->chan->nativeformats; \
- ast_debug(1, "Resetting read to %d and write to %d\n", ast->readformat, ast->writeformat);\
+ ast_debug(1, "Resetting read to '%s' and write to '%s'\n", ast_getformatname_multiple(tmp1, sizeof(tmp1), ast->readformat), ast_getformatname_multiple(tmp2, sizeof(tmp2), ast->writeformat));\
ast_set_read_format(ast, ast->readformat); \
ast_set_write_format(ast, ast->writeformat); \
} \
@@ -310,7 +311,7 @@
} while(0)
/*--- Forward declarations */
-static struct ast_channel *agent_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *agent_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause);
static int agent_devicestate(void *data);
static int agent_digit_begin(struct ast_channel *ast, char digit);
static int agent_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
@@ -529,7 +530,7 @@
{
struct agent_pvt *p = ast->tech_pvt;
struct ast_frame *f = NULL;
- static struct ast_frame answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
+ static struct ast_frame answer_frame = { AST_FRAME_CONTROL, { AST_CONTROL_ANSWER } };
int cur_time = time(NULL);
ast_mutex_lock(&p->lock);
CHECK_FORMATS(ast, p);
@@ -566,7 +567,7 @@
}
switch (f->frametype) {
case AST_FRAME_CONTROL:
- if (f->subclass == AST_CONTROL_ANSWER) {
[... 9480 lines stripped ...]
More information about the svn-commits
mailing list