[asterisk-commits] tilghman: branch tilghman/codec_bits3 r225762 - /team/tilghman/codec_bits3/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Oct 25 13:10:16 CDT 2009
Author: tilghman
Date: Sun Oct 25 13:10:11 2009
New Revision: 225762
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225762
Log:
More conversions
Modified:
team/tilghman/codec_bits3/apps/app_alarmreceiver.c
team/tilghman/codec_bits3/apps/app_amd.c
team/tilghman/codec_bits3/apps/app_chanspy.c
team/tilghman/codec_bits3/apps/app_dial.c
team/tilghman/codec_bits3/apps/app_dictate.c
team/tilghman/codec_bits3/apps/app_disa.c
team/tilghman/codec_bits3/apps/app_echo.c
team/tilghman/codec_bits3/apps/app_externalivr.c
team/tilghman/codec_bits3/apps/app_festival.c
team/tilghman/codec_bits3/apps/app_followme.c
team/tilghman/codec_bits3/apps/app_milliwatt.c
Modified: team/tilghman/codec_bits3/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_alarmreceiver.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_alarmreceiver.c (original)
+++ team/tilghman/codec_bits3/apps/app_alarmreceiver.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_amd.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_amd.c (original)
+++ team/tilghman/codec_bits3/apps/app_amd.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_chanspy.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_chanspy.c (original)
+++ team/tilghman/codec_bits3/apps/app_chanspy.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_dial.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_dial.c (original)
+++ team/tilghman/codec_bits3/apps/app_dial.c Sun Oct 25 13:10:11 2009
@@ -996,7 +996,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) {
@@ -1137,7 +1137,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) {
@@ -1149,7 +1149,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;
@@ -1167,7 +1167,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");
@@ -1187,11 +1187,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);
@@ -1201,7 +1201,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");
@@ -1213,7 +1213,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))) {
@@ -1221,16 +1221,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: team/tilghman/codec_bits3/apps/app_dictate.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_dictate.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_dictate.c (original)
+++ team/tilghman/codec_bits3/apps/app_dictate.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_disa.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_disa.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_disa.c (original)
+++ team/tilghman/codec_bits3/apps/app_disa.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_echo.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_echo.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_echo.c (original)
+++ team/tilghman/codec_bits3/apps/app_echo.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_externalivr.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_externalivr.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_externalivr.c (original)
+++ team/tilghman/codec_bits3/apps/app_externalivr.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_festival.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_festival.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_festival.c (original)
+++ team/tilghman/codec_bits3/apps/app_festival.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_followme.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_followme.c (original)
+++ team/tilghman/codec_bits3/apps/app_followme.c Sun Oct 25 13:10:11 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: team/tilghman/codec_bits3/apps/app_milliwatt.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/apps/app_milliwatt.c?view=diff&rev=225762&r1=225761&r2=225762
==============================================================================
--- team/tilghman/codec_bits3/apps/app_milliwatt.c (original)
+++ team/tilghman/codec_bits3/apps/app_milliwatt.c Sun Oct 25 13:10:11 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__,
};
More information about the asterisk-commits
mailing list