[asterisk-commits] tilghman: branch tilghman/codec_bits3 r225760 - in /team/tilghman/codec_bits3...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 24 15:44:08 CDT 2009


Author: tilghman
Date: Sat Oct 24 15:44:01 2009
New Revision: 225760

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225760
Log:
Switch subclass to a union

Modified:
    team/tilghman/codec_bits3/channels/chan_agent.c
    team/tilghman/codec_bits3/channels/chan_h323.c
    team/tilghman/codec_bits3/channels/chan_iax2.c
    team/tilghman/codec_bits3/channels/chan_local.c
    team/tilghman/codec_bits3/channels/chan_mgcp.c
    team/tilghman/codec_bits3/channels/chan_oss.c
    team/tilghman/codec_bits3/channels/chan_phone.c
    team/tilghman/codec_bits3/channels/chan_sip.c
    team/tilghman/codec_bits3/channels/iax2-parser.c
    team/tilghman/codec_bits3/include/asterisk/frame.h

Modified: team/tilghman/codec_bits3/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_agent.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_agent.c (original)
+++ team/tilghman/codec_bits3/channels/chan_agent.c Sat Oct 24 15:44:01 2009
@@ -530,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);
@@ -567,7 +567,7 @@
 		}
 		switch (f->frametype) {
 		case AST_FRAME_CONTROL:
-			if (f->subclass == AST_CONTROL_ANSWER) {
+			if (f->subclass.integer == AST_CONTROL_ANSWER) {
 				if (p->ackcall) {
 					ast_verb(3, "%s answered, waiting for '%c' to acknowledge\n", p->chan->name, p->acceptdtmf);
 					/* Don't pass answer along */
@@ -584,18 +584,18 @@
 			break;
 		case AST_FRAME_DTMF_BEGIN:
 			/*ignore DTMF begin's as it can cause issues with queue announce files*/
-			if((!p->acknowledged && f->subclass == p->acceptdtmf) || (f->subclass == p->enddtmf && endcall)){
+			if((!p->acknowledged && f->subclass.integer == p->acceptdtmf) || (f->subclass.integer == p->enddtmf && endcall)){
 				ast_frfree(f);
 				f = &ast_null_frame;
 			}
 			break;
 		case AST_FRAME_DTMF_END:
-			if (!p->acknowledged && (f->subclass == p->acceptdtmf)) {
+			if (!p->acknowledged && (f->subclass.integer == p->acceptdtmf)) {
 				ast_verb(3, "%s acknowledged\n", p->chan->name);
 				p->acknowledged = 1;
 				ast_frfree(f);
 				f = &answer_frame;
-			} else if (f->subclass == p->enddtmf && endcall) {
+			} else if (f->subclass.integer == p->enddtmf && endcall) {
 				/* terminates call */
 				ast_frfree(f);
 				f = NULL;
@@ -661,7 +661,7 @@
 	else {
 		if ((f->frametype != AST_FRAME_VOICE) ||
 		    (f->frametype != AST_FRAME_VIDEO) ||
-		    (f->subclass == p->chan->writeformat)) {
+		    (f->subclass.codec == p->chan->writeformat)) {
 			res = ast_write(p->chan, f);
 		} else {
 			ast_debug(1, "Dropping one incompatible %s frame on '%s' to '%s'\n", 
@@ -952,7 +952,7 @@
 		if (!f) 
 			return -1;
 		if (f->frametype == AST_FRAME_DTMF)
-			res = f->subclass;
+			res = f->subclass.integer;
 		else
 			res = 0;
 		ast_frfree(f);

Modified: team/tilghman/codec_bits3/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_h323.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_h323.c (original)
+++ team/tilghman/codec_bits3/channels/chan_h323.c Sat Oct 24 15:44:01 2009
@@ -312,7 +312,7 @@
 		if (pvt->owner) {
 			struct ast_frame f = {
 				.frametype = AST_FRAME_DTMF_END,
-				.subclass = pvt->curDTMF,
+				.subclass.integer = pvt->curDTMF,
 				.samples = 0,
 				.src = "SIMULATE_DTMF_END",
 			};
@@ -357,13 +357,13 @@
 	if (pvt->newdigit >= 0) {
 		struct ast_frame f = {
 			.frametype = AST_FRAME_DTMF_END,
-			.subclass = pvt->newdigit,
+			.subclass.integer = pvt->newdigit,
 			.samples = pvt->newduration * 8,
 			.len = pvt->newduration,
 			.src = "UPDATE_INFO",
 		};
 		if (pvt->newdigit == ' ') {		/* signalUpdate message */
-			f.subclass = pvt->curDTMF;
+			f.subclass.integer = pvt->curDTMF;
 			if (pvt->DTMFsched >= 0) {
 				AST_SCHED_DEL(sched, pvt->DTMFsched);
 			}
@@ -761,16 +761,16 @@
 	if (pvt->owner) {
 		/* We already hold the channel lock */
 		if (f->frametype == AST_FRAME_VOICE) {
-			if (f->subclass != pvt->owner->nativeformats) {
+			if (f->subclass.codec != pvt->owner->nativeformats) {
 				/* Try to avoid deadlock */
 				if (ast_channel_trylock(pvt->owner)) {
 					ast_log(LOG_NOTICE, "Format changed but channel is locked. Ignoring frame...\n");
 					return &ast_null_frame;
 				}
 				if (h323debug)
-					ast_debug(1, "Oooh, format changed to '%s'\n", ast_getformatname(f->subclass));
-				pvt->owner->nativeformats = f->subclass;
-				pvt->nativeformats = f->subclass;
+					ast_debug(1, "Oooh, format changed to '%s'\n", ast_getformatname(f->subclass.codec));
+				pvt->owner->nativeformats = f->subclass.codec;
+				pvt->nativeformats = f->subclass.codec;
 				ast_set_read_format(pvt->owner, pvt->owner->readformat);
 				ast_set_write_format(pvt->owner, pvt->owner->writeformat);
 				ast_channel_unlock(pvt->owner);
@@ -785,12 +785,12 @@
 					else
 						ast_log(LOG_NOTICE, "Unable to process inband DTMF while channel is locked\n");
 				} else if (pvt->nativeformats && !pvt->noInbandDtmf) {
-					ast_log(LOG_NOTICE, "Inband DTMF is not supported on codec %s. Use RFC2833\n", ast_getformatname(f->subclass));
+					ast_log(LOG_NOTICE, "Inband DTMF is not supported on codec %s. Use RFC2833\n", ast_getformatname(f->subclass.codec));
 					pvt->noInbandDtmf = 1;
 				}
 				if (f &&(f->frametype == AST_FRAME_DTMF)) {
 					if (h323debug)
-						ast_log(LOG_DTMF, "Received in-band digit %c.\n", (char) f->subclass);
+						ast_log(LOG_DTMF, "Received in-band digit %c.\n", f->subclass.integer);
 				}
 			}
 		}
@@ -835,10 +835,10 @@
 			return 0;
 		}
 	} else {
-		if (!(frame->subclass & c->nativeformats)) {
+		if (!(frame->subclass.codec & c->nativeformats)) {
 			char tmp[256];
 			ast_log(LOG_WARNING, "Asked to transmit frame type '%s', while native formats is '%s' (read/write = %s/%s)\n",
-				ast_getformatname(frame->subclass), ast_getformatname_multiple(tmp, sizeof(tmp), c->nativeformats), ast_getformatname(c->readformat), ast_getformatname(c->writeformat));
+				ast_getformatname(frame->subclass.codec), ast_getformatname_multiple(tmp, sizeof(tmp), c->nativeformats), ast_getformatname(c->readformat), ast_getformatname(c->writeformat));
 			return 0;
 		}
 	}
@@ -1842,23 +1842,23 @@
 		else {
 			struct ast_frame f = {
 				.frametype = AST_FRAME_DTMF_END,
-				.subclass = digit,
+				.subclass.integer = digit,
 				.samples = duration * 8,
 				.len = duration,
 				.src = "SEND_DIGIT",
 			};
 			if (digit == ' ') {		/* signalUpdate message */
-				f.subclass = pvt->curDTMF;
+				f.subclass.integer = pvt->curDTMF;
 				AST_SCHED_DEL(sched, pvt->DTMFsched);
 			} else {				/* Regular input or signal message */
 				if (pvt->DTMFsched >= 0) {
 					/* We still don't send DTMF END from previous event, send it now */
 					AST_SCHED_DEL(sched, pvt->DTMFsched);
-					f.subclass = pvt->curDTMF;
+					f.subclass.integer = pvt->curDTMF;
 					f.samples = f.len = 0;
 					ast_queue_frame(pvt->owner, &f);
 					/* Restore values */
-					f.subclass = digit;
+					f.subclass.integer = digit;
 					f.samples = duration * 8;
 					f.len = duration;
 				}

Modified: team/tilghman/codec_bits3/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_iax2.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_iax2.c (original)
+++ team/tilghman/codec_bits3/channels/chan_iax2.c Sat Oct 24 15:44:01 2009
@@ -1508,6 +1508,7 @@
 
 static unsigned char compress_subclass(int subclass)
 {
+	/* XXX FIXME XXX */
 	int x;
 	int power=-1;
 	/* If it's 128 or smaller, just return it */
@@ -1515,7 +1516,7 @@
 		return subclass;
 	/* Otherwise find its power */
 	for (x = 0; x < IAX_MAX_SHIFT; x++) {
-		if (subclass & (1 << x)) {
+		if (subclass & (1LL << x)) {
 			if (power > -1) {
 				ast_log(LOG_WARNING, "Can't compress subclass %d\n", subclass);
 				return 0;
@@ -3370,10 +3371,10 @@
 						iax2_destroy(callno);
 					} else {
 						if (iaxs[callno]->owner)
-							ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %llu, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, (unsigned long long) f->af.subclass, f->ts, f->oseqno);
+							ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, f->af.subclass.integer, f->ts, f->oseqno);
 						iaxs[callno]->error = ETIMEDOUT;
 						if (iaxs[callno]->owner) {
-							struct ast_frame fr = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
+							struct ast_frame fr = { AST_FRAME_CONTROL, { AST_CONTROL_HANGUP }, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
 							/* Hangup the fd */
 							iax2_queue_frame(callno, &fr); /* XXX */
 							/* Remember, owner could disappear */
@@ -3965,7 +3966,7 @@
 			
 			/* create an interpolation frame */
 			af.frametype = AST_FRAME_VOICE;
-			af.subclass = pvt->voiceformat;
+			af.subclass.codec = pvt->voiceformat;
 			af.samples  = frame.ms * (ast_format_rate(pvt->voiceformat) / 1000);
 			af.src  = "IAX2 JB interpolation";
 			af.delivery = ast_tvadd(pvt->rxcore, ast_samp2tv(next, 1000));
@@ -4038,7 +4039,7 @@
 
 	if(fr->af.frametype == AST_FRAME_VOICE) {
 		type = JB_TYPE_VOICE;
-		len = ast_codec_get_samples(&fr->af) / (ast_format_rate(fr->af.subclass) / 1000);
+		len = ast_codec_get_samples(&fr->af) / (ast_format_rate(fr->af.subclass.codec) / 1000);
 	} else if(fr->af.frametype == AST_FRAME_CNG) {
 		type = JB_TYPE_SILENCE;
 	}
@@ -4149,7 +4150,7 @@
 
 static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img)
 {
-	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data.ptr, img->datalen, -1);
+	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass.integer, 0, img->data.ptr, img->datalen, -1);
 }
 
 static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen)
@@ -4498,7 +4499,7 @@
 static void __auto_congest(const void *nothing)
 {
 	int callno = PTR_TO_CALLNO(nothing);
-	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_CONGESTION };
+	struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_CONGESTION } };
 	ast_mutex_lock(&iaxsl[callno]);
 	if (iaxs[callno]) {
 		iaxs[callno]->initid = -1;
@@ -4583,7 +4584,7 @@
 {
 	struct chan_iax2_pvt *pvt = iaxs[callno];
 	int frametype = f->af.frametype;
-	int subclass = f->af.subclass;
+	int subclass = f->af.subclass.integer;
 	struct {
 		struct ast_iax2_full_hdr fh;
 		struct iax_ie_data ied;
@@ -5354,7 +5355,7 @@
 			res = AST_BRIDGE_COMPLETE;
 			break;
 		}
-		if ((f->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS) && (f->subclass != AST_CONTROL_SRCUPDATE)) {
+		if ((f->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS) && (f->subclass.integer != AST_CONTROL_SRCUPDATE)) {
 			*fo = f;
 			*rc = who;
 			res =  AST_BRIDGE_COMPLETE;
@@ -5660,7 +5661,7 @@
 	int voice = 0;
 	int genuine = 0;
 	int adjust;
-	int rate = ast_format_rate(f->subclass) / 1000;
+	int rate = ast_format_rate(f->subclass.codec) / 1000;
 	struct timeval *delivery = NULL;
 
 
@@ -6033,9 +6034,9 @@
 		memcpy(efh->encdata, workspace + padding, *datalen - sizeof(struct ast_iax2_full_enc_hdr));
 		f->frametype = fh->type;
 		if (f->frametype == AST_FRAME_VIDEO) {
-			f->subclass = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
+			f->subclass.codec = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
 		} else {
-			f->subclass = uncompress_subclass(fh->csub);
+			f->subclass.codec = uncompress_subclass(fh->csub);
 		}
 	} else {
 		struct ast_iax2_mini_enc_hdr *efh = (struct ast_iax2_mini_enc_hdr *)fh;
@@ -6176,7 +6177,7 @@
 		/* High two bytes are the same on timestamp, or sending on a trunk */ &&
 	    (f->frametype == AST_FRAME_VOICE) 
 		/* is a voice frame */ &&
-		(f->subclass == pvt->svoiceformat) 
+		(f->subclass.codec == pvt->svoiceformat) 
 		/* is the same type */ ) {
 			/* Force immediate rather than delayed transmission */
 			now = 1;
@@ -6190,7 +6191,7 @@
 		 * Otherwise send a mini video frame
 		 */
 		if (((fts & 0xFFFF8000L) == (pvt->lastvsent & 0xFFFF8000L)) &&
-		    ((f->subclass & ~0x1) == pvt->svideoformat)
+		    ((f->subclass.codec & ~0x1LL) == pvt->svideoformat)
 		   ) {
 			now = 1;
 			sendmini = 1;
@@ -6202,7 +6203,7 @@
 	}
 	if (f->frametype == AST_FRAME_IAX) {
 		/* 0x8000 marks this message as TX:, this bit will be stripped later */
-		pvt->last_iax_message = f->subclass | MARK_IAX_SUBCLASS_TX;
+		pvt->last_iax_message = f->subclass.integer | MARK_IAX_SUBCLASS_TX;
 		if (!pvt->first_iax_message) {
 			pvt->first_iax_message = pvt->last_iax_message;
 		}
@@ -6244,9 +6245,9 @@
 			pvt->aseqno = fr->iseqno;
 		fh->type = fr->af.frametype & 0xFF;
 		if (fr->af.frametype == AST_FRAME_VIDEO)
-			fh->csub = compress_subclass(fr->af.subclass & ~0x1) | ((fr->af.subclass & 0x1) << 6);
+			fh->csub = compress_subclass(fr->af.subclass.codec & ~0x1LL) | ((fr->af.subclass.codec & 0x1LL) << 6);
 		else
-			fh->csub = compress_subclass(fr->af.subclass);
+			fh->csub = compress_subclass(fr->af.subclass.codec);
 		if (transfer) {
 			fr->dcallno = pvt->transfercallno;
 		} else
@@ -6262,12 +6263,12 @@
 		if (fr->retrytime > MAX_RETRY_TIME)
 			fr->retrytime = MAX_RETRY_TIME;
 		/* Acks' don't get retried */
-		if ((f->frametype == AST_FRAME_IAX) && (f->subclass == IAX_COMMAND_ACK))
+		if ((f->frametype == AST_FRAME_IAX) && (f->subclass.integer == IAX_COMMAND_ACK))
 			fr->retries = -1;
 		else if (f->frametype == AST_FRAME_VOICE)
-			pvt->svoiceformat = f->subclass;
+			pvt->svoiceformat = f->subclass.codec;
 		else if (f->frametype == AST_FRAME_VIDEO)
-			pvt->svideoformat = f->subclass & ~0x1;
+			pvt->svideoformat = f->subclass.codec & ~0x1LL;
 		if (ast_test_flag64(pvt, IAX_ENCRYPTED)) {
 			if (ast_test_flag64(pvt, IAX_KEYPOPULATED)) {
 				if (fr->transfer)
@@ -6298,11 +6299,11 @@
 			vh = (struct ast_iax2_video_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_video_hdr));
 			vh->zeros = 0;
 			vh->callno = htons(0x8000 | fr->callno);
-			vh->ts = htons((fr->ts & 0x7FFF) | (fr->af.subclass & 0x1 ? 0x8000 : 0));
+			vh->ts = htons((fr->ts & 0x7FFF) | (fr->af.subclass.codec & 0x1LL ? 0x8000 : 0));
 			fr->datalen = fr->af.datalen + sizeof(struct ast_iax2_video_hdr);
 			fr->data = vh;
 			fr->retries = -1;
-			res = send_packet(fr);			
+			res = send_packet(fr);
 		} else {
 			/* Mini-frames have no sequence number */
 			fr->oseqno = -1;
@@ -7213,7 +7214,7 @@
 	int res = 0;
 
 	f.frametype = type;
-	f.subclass = command;
+	f.subclass.integer = command;
 	f.datalen = datalen;
 	f.src = __FUNCTION__;
 	f.data.ptr = (void *) data;
@@ -9407,7 +9408,7 @@
 			ast_log(LOG_WARNING, "Received trunked frame before first full voice frame\n");
 			iax2_vnak(fr->callno);
 		} else {
-			f.subclass = iaxs[fr->callno]->voiceformat;
+			f.subclass.codec = iaxs[fr->callno]->voiceformat;
 			f.datalen = len;
 			if (f.datalen >= 0) {
 				if (f.datalen)
@@ -9639,17 +9640,17 @@
 		/* Retrieve the type and subclass */
 		f.frametype = fh->type;
 		if (f.frametype == AST_FRAME_VIDEO) {
-			f.subclass = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
+			f.subclass.codec = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub >> 6) & 0x1);
 		} else {
-			f.subclass = uncompress_subclass(fh->csub);
+			f.subclass.codec = uncompress_subclass(fh->csub);
 		}
 
 		/* Deal with POKE/PONG without allocating a callno */
-		if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_POKE) {
+		if (f.frametype == AST_FRAME_IAX && f.subclass.integer == IAX_COMMAND_POKE) {
 			/* Reply back with a PONG, but don't care about the result. */
 			send_apathetic_reply(1, ntohs(fh->scallno), &sin, IAX_COMMAND_PONG, ntohl(fh->ts), fh->iseqno + 1, fd, NULL);
 			return 1;
-		} else if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_ACK && dcallno == 1) {
+		} else if (f.frametype == AST_FRAME_IAX && f.subclass.integer == IAX_COMMAND_ACK && dcallno == 1) {
 			/* Ignore */
 			return 1;
 		}
@@ -9675,7 +9676,7 @@
 			memset(&ies, 0, sizeof(ies));
 		}
 
-		if (!dcallno && iax2_allow_new(f.frametype, f.subclass, 1)) {
+		if (!dcallno && iax2_allow_new(f.frametype, f.subclass.integer, 1)) {
 			/* only set NEW_ALLOW if calltoken checks out */
 			if (handle_call_token(fh, &ies, &sin, fd)) {
 				return 1;
@@ -9694,7 +9695,7 @@
 	} else {
 		/* Don't know anything about it yet */
 		f.frametype = AST_FRAME_NULL;
-		f.subclass = 0;
+		f.subclass.integer = 0;
 	}
 
 	if (!fr->callno) {
@@ -9708,14 +9709,14 @@
 		 *    http://lists.digium.com/pipermail/asterisk-dev/2008-May/033217.html 
 		 */
 
-		if ((ntohs(mh->callno) & IAX_FLAG_FULL) && ((f.frametype == AST_FRAME_IAX) && (f.subclass == IAX_COMMAND_ACK))) {
+		if ((ntohs(mh->callno) & IAX_FLAG_FULL) && ((f.frametype == AST_FRAME_IAX) && (f.subclass.integer == IAX_COMMAND_ACK))) {
 			check_dcallno = 1;
 		}
 
 		if (!(fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, check_dcallno))) {
-			if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_NEW) {
+			if (f.frametype == AST_FRAME_IAX && f.subclass.integer == IAX_COMMAND_NEW) {
 				send_apathetic_reply(1, ntohs(fh->scallno), &sin, IAX_COMMAND_REJECT, ntohl(fh->ts), fh->iseqno + 1, fd, NULL);
-			} else if (f.frametype == AST_FRAME_IAX && (f.subclass == IAX_COMMAND_REGREQ || f.subclass == IAX_COMMAND_REGREL)) {
+			} else if (f.frametype == AST_FRAME_IAX && (f.subclass.integer == IAX_COMMAND_REGREQ || f.subclass.integer == IAX_COMMAND_REGREL)) {
 				send_apathetic_reply(1, ntohs(fh->scallno), &sin, IAX_COMMAND_REGREJ, ntohl(fh->ts), fh->iseqno + 1, fd, NULL);
 			}
 			return 1;
@@ -9730,10 +9731,10 @@
 		   frame, reply with an inval */
 		if (ntohs(mh->callno) & IAX_FLAG_FULL) {
 			/* We can only raw hangup control frames */
-			if (((f.subclass != IAX_COMMAND_INVAL) &&
-				 (f.subclass != IAX_COMMAND_TXCNT) &&
-				 (f.subclass != IAX_COMMAND_TXACC) &&
-				 (f.subclass != IAX_COMMAND_FWDOWNL))||
+			if (((f.subclass.integer != IAX_COMMAND_INVAL) &&
+				 (f.subclass.integer != IAX_COMMAND_TXCNT) &&
+				 (f.subclass.integer != IAX_COMMAND_TXACC) &&
+				 (f.subclass.integer != IAX_COMMAND_FWDOWNL))||
 			    (f.frametype != AST_FRAME_IAX))
 				raw_hangup(&sin, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, ntohs(mh->callno) & ~IAX_FLAG_FULL,
 				fd);
@@ -9762,8 +9763,8 @@
 	iaxs[fr->callno]->frames_received++;
 
 	if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) && !minivid &&
-		f.subclass != IAX_COMMAND_TXCNT &&		/* for attended transfer */
-		f.subclass != IAX_COMMAND_TXACC) {		/* for attended transfer */
+		f.subclass.integer != IAX_COMMAND_TXCNT &&		/* for attended transfer */
+		f.subclass.integer != IAX_COMMAND_TXACC) {		/* for attended transfer */
 		unsigned short new_peercallno;
 		
 		new_peercallno = (unsigned short) (ntohs(mh->callno) & ~IAX_FLAG_FULL);
@@ -9777,7 +9778,7 @@
 	}
 	if (ntohs(mh->callno) & IAX_FLAG_FULL) {
 		if (iaxdebug)
-			ast_debug(1, "Received packet %d, (%d, %llu)\n", fh->oseqno, f.frametype, (unsigned long long) f.subclass);
+			ast_debug(1, "Received packet %d, (%d, %u)\n", fh->oseqno, f.frametype, f.subclass.integer);
 		/* Check if it's out of order (and not an ACK or INVAL) */
 		fr->oseqno = fh->oseqno;
 		fr->iseqno = fh->iseqno;
@@ -9800,31 +9801,31 @@
 			updatehistory = 0;
 		if ((iaxs[fr->callno]->iseqno != fr->oseqno) &&
 			(iaxs[fr->callno]->iseqno ||
-				((f.subclass != IAX_COMMAND_TXCNT) &&
-				(f.subclass != IAX_COMMAND_TXREADY) &&		/* for attended transfer */
-				(f.subclass != IAX_COMMAND_TXREL) &&		/* for attended transfer */
-				(f.subclass != IAX_COMMAND_UNQUELCH ) &&	/* for attended transfer */
-				(f.subclass != IAX_COMMAND_TXACC)) ||
+				((f.subclass.integer != IAX_COMMAND_TXCNT) &&
+				(f.subclass.integer != IAX_COMMAND_TXREADY) &&		/* for attended transfer */
+				(f.subclass.integer != IAX_COMMAND_TXREL) &&		/* for attended transfer */
+				(f.subclass.integer != IAX_COMMAND_UNQUELCH ) &&	/* for attended transfer */
+				(f.subclass.integer != IAX_COMMAND_TXACC)) ||
 				(f.frametype != AST_FRAME_IAX))) {
 			if (
-			 ((f.subclass != IAX_COMMAND_ACK) &&
-			  (f.subclass != IAX_COMMAND_INVAL) &&
-			  (f.subclass != IAX_COMMAND_TXCNT) &&
-			  (f.subclass != IAX_COMMAND_TXREADY) &&		/* for attended transfer */
-			  (f.subclass != IAX_COMMAND_TXREL) &&		/* for attended transfer */
-			  (f.subclass != IAX_COMMAND_UNQUELCH ) &&	/* for attended transfer */
-			  (f.subclass != IAX_COMMAND_TXACC) &&
-			  (f.subclass != IAX_COMMAND_VNAK)) ||
+			 ((f.subclass.integer != IAX_COMMAND_ACK) &&
+			  (f.subclass.integer != IAX_COMMAND_INVAL) &&
+			  (f.subclass.integer != IAX_COMMAND_TXCNT) &&
+			  (f.subclass.integer != IAX_COMMAND_TXREADY) &&		/* for attended transfer */
+			  (f.subclass.integer != IAX_COMMAND_TXREL) &&		/* for attended transfer */
+			  (f.subclass.integer != IAX_COMMAND_UNQUELCH ) &&	/* for attended transfer */
+			  (f.subclass.integer != IAX_COMMAND_TXACC) &&
+			  (f.subclass.integer != IAX_COMMAND_VNAK)) ||
 			  (f.frametype != AST_FRAME_IAX)) {
 			 	/* If it's not an ACK packet, it's out of order. */
-				ast_debug(1, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %llu)\n", 
-					iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, (unsigned long long) f.subclass);
+				ast_debug(1, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n", 
+					iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, f.subclass.integer);
 				/* Check to see if we need to request retransmission,
 				 * and take sequence number wraparound into account */
 				if ((unsigned char) (iaxs[fr->callno]->iseqno - fr->oseqno) < 128) {
 					/* If we've already seen it, ack it XXX There's a border condition here XXX */
 					if ((f.frametype != AST_FRAME_IAX) || 
-							((f.subclass != IAX_COMMAND_ACK) && (f.subclass != IAX_COMMAND_INVAL))) {
+							((f.subclass.integer != IAX_COMMAND_ACK) && (f.subclass.integer != IAX_COMMAND_INVAL))) {
 						ast_debug(1, "Acking anyway\n");
 						/* XXX Maybe we should handle its ack to us, but then again, it's probably outdated anyway, and if
 						   we have anything to send, we'll retransmit and get an ACK back anyway XXX */
@@ -9839,11 +9840,11 @@
 			}
 		} else {
 			/* Increment unless it's an ACK or VNAK */
-			if (((f.subclass != IAX_COMMAND_ACK) &&
-			    (f.subclass != IAX_COMMAND_INVAL) &&
-			    (f.subclass != IAX_COMMAND_TXCNT) &&
-			    (f.subclass != IAX_COMMAND_TXACC) &&
-				(f.subclass != IAX_COMMAND_VNAK)) ||
+			if (((f.subclass.integer != IAX_COMMAND_ACK) &&
+			    (f.subclass.integer != IAX_COMMAND_INVAL) &&
+			    (f.subclass.integer != IAX_COMMAND_TXCNT) &&
+			    (f.subclass.integer != IAX_COMMAND_TXACC) &&
+				(f.subclass.integer != IAX_COMMAND_VNAK)) ||
 			    (f.frametype != AST_FRAME_IAX))
 				iaxs[fr->callno]->iseqno++;
 		}
@@ -9858,7 +9859,7 @@
 		/* Handle implicit ACKing unless this is an INVAL, and only if this is 
 		   from the real peer, not the transfer peer */
 		if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) && 
-		    ((f.subclass != IAX_COMMAND_INVAL) ||
+		    ((f.subclass.integer != IAX_COMMAND_INVAL) ||
 		     (f.frametype != AST_FRAME_IAX))) {
 			unsigned char x;
 			int call_to_destroy;
@@ -9906,8 +9907,8 @@
 		}
 		if (inaddrcmp(&sin, &iaxs[fr->callno]->addr) && 
 			((f.frametype != AST_FRAME_IAX) || 
-			 ((f.subclass != IAX_COMMAND_TXACC) &&
-			  (f.subclass != IAX_COMMAND_TXCNT)))) {
+			 ((f.subclass.integer != IAX_COMMAND_TXACC) &&
+			  (f.subclass.integer != IAX_COMMAND_TXCNT)))) {
 			/* Only messages we accept from a transfer host are TXACC and TXCNT */
 			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
@@ -9987,14 +9988,14 @@
 
 		/* once we receive our first IAX Full Frame that is not CallToken related, send all
 		 * queued signaling frames that were being held. */
-		if ((f.frametype == AST_FRAME_IAX) && (f.subclass != IAX_COMMAND_CALLTOKEN) && iaxs[fr->callno]->hold_signaling) {
+		if ((f.frametype == AST_FRAME_IAX) && (f.subclass.integer != IAX_COMMAND_CALLTOKEN) && iaxs[fr->callno]->hold_signaling) {
 			send_signaling(iaxs[fr->callno]);
 		}
 
 		if (f.frametype == AST_FRAME_VOICE) {
-			if (f.subclass != iaxs[fr->callno]->voiceformat) {
-					iaxs[fr->callno]->voiceformat = f.subclass;
-					ast_debug(1, "Ooh, voice format changed to '%s'\n", ast_getformatname(f.subclass));
+			if (f.subclass.codec != iaxs[fr->callno]->voiceformat) {
+					iaxs[fr->callno]->voiceformat = f.subclass.codec;
+					ast_debug(1, "Ooh, voice format changed to '%s'\n", ast_getformatname(f.subclass.codec));
 					if (iaxs[fr->callno]->owner) {
 						int orignative;
 retryowner:
@@ -10005,7 +10006,7 @@
 						if (iaxs[fr->callno]) {
 							if (iaxs[fr->callno]->owner) {
 								orignative = iaxs[fr->callno]->owner->nativeformats;
-								iaxs[fr->callno]->owner->nativeformats = f.subclass;
+								iaxs[fr->callno]->owner->nativeformats = f.subclass.codec;
 								if (iaxs[fr->callno]->owner->readformat)
 									ast_set_read_format(iaxs[fr->callno]->owner, iaxs[fr->callno]->owner->readformat);
 								iaxs[fr->callno]->owner->nativeformats = orignative;
@@ -10026,15 +10027,15 @@
 			}
 		}
 		if (f.frametype == AST_FRAME_VIDEO) {
-			if (f.subclass != iaxs[fr->callno]->videoformat) {
-				ast_debug(1, "Ooh, video format changed to %llu\n", (unsigned long long) f.subclass & ~0x1);
-				iaxs[fr->callno]->videoformat = f.subclass & ~0x1;
+			if (f.subclass.codec != iaxs[fr->callno]->videoformat) {
+				ast_debug(1, "Ooh, video format changed to %s\n", ast_getformatname(f.subclass.codec & ~0x1LL));
+				iaxs[fr->callno]->videoformat = f.subclass.codec & ~0x1LL;
 			}
 		}
 		if (f.frametype == AST_FRAME_CONTROL && iaxs[fr->callno]->owner) {
-			if (f.subclass == AST_CONTROL_BUSY) {
+			if (f.subclass.integer == AST_CONTROL_BUSY) {
 				iaxs[fr->callno]->owner->hangupcause = AST_CAUSE_BUSY;
-			} else if (f.subclass == AST_CONTROL_CONGESTION) {
+			} else if (f.subclass.integer == AST_CONTROL_CONGESTION) {
 				iaxs[fr->callno]->owner->hangupcause = AST_CAUSE_CONGESTION;
 			}
 		}
@@ -10042,22 +10043,22 @@
 			ast_sched_thread_del(sched, iaxs[fr->callno]->initid);
 			/* Handle the IAX pseudo frame itself */
 			if (iaxdebug)
-				ast_debug(1, "IAX subclass %llu received\n", (unsigned long long) f.subclass);
+				ast_debug(1, "IAX subclass %d received\n", f.subclass.integer);
 
                         /* Update last ts unless the frame's timestamp originated with us. */
 			if (iaxs[fr->callno]->last < fr->ts &&
-                            f.subclass != IAX_COMMAND_ACK &&
-                            f.subclass != IAX_COMMAND_PONG &&
-                            f.subclass != IAX_COMMAND_LAGRP) {
+                            f.subclass.integer != IAX_COMMAND_ACK &&
+                            f.subclass.integer != IAX_COMMAND_PONG &&
+                            f.subclass.integer != IAX_COMMAND_LAGRP) {
 				iaxs[fr->callno]->last = fr->ts;
 				if (iaxdebug)
 					ast_debug(1, "For call=%d, set last=%d\n", fr->callno, fr->ts);
 			}
-			iaxs[fr->callno]->last_iax_message = f.subclass;
+			iaxs[fr->callno]->last_iax_message = f.subclass.integer;
 			if (!iaxs[fr->callno]->first_iax_message) {
-				iaxs[fr->callno]->first_iax_message = f.subclass;
+				iaxs[fr->callno]->first_iax_message = f.subclass.integer;
 			}
-			switch(f.subclass) {
+			switch(f.subclass.integer) {
 			case IAX_COMMAND_ACK:
 				/* Do nothing */
 				break;
@@ -10585,9 +10586,9 @@
 				f.offset = 0;
 				f.samples = 0;
 				iax_frame_wrap(fr, &f);
-				if(f.subclass == IAX_COMMAND_LAGRQ) {
+				if (f.subclass.integer == IAX_COMMAND_LAGRQ) {
 					/* Received a LAGRQ - echo back a LAGRP */
-					fr->af.subclass = IAX_COMMAND_LAGRP;
+					fr->af.subclass.integer = IAX_COMMAND_LAGRP;
 					iax2_send(iaxs[fr->callno], &fr->af, fr->ts, -1, 0, 0, 0);
 				} else {
 					/* Received LAGRP in response to our LAGRQ */
@@ -10607,7 +10608,7 @@
 				}
 				if (authenticate_reply(iaxs[fr->callno], &iaxs[fr->callno]->addr, &ies, iaxs[fr->callno]->secret, iaxs[fr->callno]->outkey)) {
 					struct ast_frame hangup_fr = { .frametype = AST_FRAME_CONTROL,
-								.subclass = AST_CONTROL_HANGUP,
+								.subclass.integer = AST_CONTROL_HANGUP,
 					};
 					ast_log(LOG_WARNING, 
 						"I don't know how to authenticate %s to %s\n", 
@@ -10937,7 +10938,7 @@
 				if ((ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) ||
 						ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED)) {
 
-					if (f.subclass == IAX_COMMAND_REGREL)
+					if (f.subclass.integer == IAX_COMMAND_REGREL)
 						memset(&sin, 0, sizeof(sin));
 					if (update_registry(&sin, fr->callno, ies.devicetype, fd, ies.refresh))
 						ast_log(LOG_WARNING, "Registry error\n");
@@ -11128,9 +11129,9 @@
 				break;
 			}
 			default:
-				ast_debug(1, "Unknown IAX command %llu on %d/%d\n", (unsigned long long) f.subclass, fr->callno, iaxs[fr->callno]->peercallno);
+				ast_debug(1, "Unknown IAX command %d on %d/%d\n", f.subclass.integer, fr->callno, iaxs[fr->callno]->peercallno);
 				memset(&ied0, 0, sizeof(ied0));
-				iax_ie_append_byte(&ied0, IAX_IE_IAX_UNKNOWN, f.subclass);
+				iax_ie_append_byte(&ied0, IAX_IE_IAX_UNKNOWN, f.subclass.integer);
 				send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_UNSUPPORT, 0, ied0.buf, ied0.pos, -1);
 			}
 			/* Free remote variables (if any) */
@@ -11141,11 +11142,11 @@
 			}
 
 			/* Don't actually pass these frames along */
-			if ((f.subclass != IAX_COMMAND_ACK) && 
-			  (f.subclass != IAX_COMMAND_TXCNT) && 
-			  (f.subclass != IAX_COMMAND_TXACC) && 
-			  (f.subclass != IAX_COMMAND_INVAL) &&
-			  (f.subclass != IAX_COMMAND_VNAK)) { 
+			if ((f.subclass.integer != IAX_COMMAND_ACK) && 
+			  (f.subclass.integer != IAX_COMMAND_TXCNT) && 
+			  (f.subclass.integer != IAX_COMMAND_TXACC) && 
+			  (f.subclass.integer != IAX_COMMAND_INVAL) &&
+			  (f.subclass.integer != IAX_COMMAND_VNAK)) { 
 			  	if (iaxs[fr->callno] && iaxs[fr->callno]->aseqno != iaxs[fr->callno]->iseqno)
 					send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
 			}
@@ -11158,7 +11159,7 @@
 	} else if (minivid) {
 		f.frametype = AST_FRAME_VIDEO;
 		if (iaxs[fr->callno]->videoformat > 0) 
-			f.subclass = iaxs[fr->callno]->videoformat | (ntohs(vh->ts) & 0x8000 ? 1 : 0);
+			f.subclass.codec = iaxs[fr->callno]->videoformat | (ntohs(vh->ts) & 0x8000LL ? 1 : 0);
 		else {
 			ast_log(LOG_WARNING, "Received mini frame before first full video frame\n");
 			iax2_vnak(fr->callno);
@@ -11180,7 +11181,7 @@
 		/* A mini frame */
 		f.frametype = AST_FRAME_VOICE;
 		if (iaxs[fr->callno]->voiceformat > 0)
-			f.subclass = iaxs[fr->callno]->voiceformat;
+			f.subclass.codec = iaxs[fr->callno]->voiceformat;
 		else {
 			ast_debug(1, "Received mini frame before first full voice frame\n");
 			iax2_vnak(fr->callno);
@@ -11211,7 +11212,7 @@
 		return 1;
 	}
 	/* Don't allow connected line updates unless we are configured to */
-	if (f.frametype == AST_FRAME_CONTROL && f.subclass == AST_CONTROL_CONNECTED_LINE) {
+	if (f.frametype == AST_FRAME_CONTROL && f.subclass.integer == AST_CONTROL_CONNECTED_LINE) {
 		struct ast_party_connected_line connected;
 
 		if (!ast_test_flag64(iaxs[fr->callno], IAX_RECVCONNECTEDLINE)) {
@@ -11243,7 +11244,7 @@
 	if (f.datalen && (f.frametype == AST_FRAME_VOICE)) {
 		f.samples = ast_codec_get_samples(&f);
 		/* We need to byteswap incoming slinear samples from network byte order */
-		if (f.subclass == AST_FORMAT_SLINEAR)
+		if (f.subclass.codec == AST_FORMAT_SLINEAR)
 			ast_frame_byteswap_be(&f);
 	} else
 		f.samples = 0;
@@ -11255,7 +11256,7 @@
 		fr->outoforder = 0;
 	} else {
 		if (iaxdebug && iaxs[fr->callno])
-			ast_debug(1, "Received out of order packet... (type=%d, subclass %llu, ts = %d, last = %d)\n", f.frametype, (unsigned long long) f.subclass, fr->ts, iaxs[fr->callno]->last);
+			ast_debug(1, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass.integer, fr->ts, iaxs[fr->callno]->last);
 		fr->outoforder = -1;
 	}
 	fr->cacheable = ((f.frametype == AST_FRAME_VOICE) || (f.frametype == AST_FRAME_VIDEO));

Modified: team/tilghman/codec_bits3/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_local.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_local.c (original)
+++ team/tilghman/codec_bits3/channels/chan_local.c Sat Oct 24 15:44:01 2009
@@ -265,7 +265,7 @@
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 		/* Pass along answer since somebody answered us */
-		struct ast_frame answer = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
+		struct ast_frame answer = { AST_FRAME_CONTROL, { AST_CONTROL_ANSWER } };
 		res = local_queue_frame(p, isoutbound, &answer, ast, 1);
 	} else
 		ast_log(LOG_WARNING, "Huh?  Local is being asked to answer?\n");
@@ -435,7 +435,7 @@
 			} else {
 				f.datalen = ast_redirecting_build_data(frame_data, sizeof(frame_data), &this_channel->redirecting);
 			}
-			f.subclass = condition;
+			f.subclass.integer = condition;
 			f.data.ptr = frame_data;
 			if (!(res = local_queue_frame(p, isoutbound, &f, ast, 1))) {
 				ast_mutex_unlock(&p->lock);
@@ -447,7 +447,7 @@
 		/* Queue up a frame representing the indication as a control frame */
 		ast_mutex_lock(&p->lock);
 		isoutbound = IS_OUTBOUND(ast, p);
-		f.subclass = condition;
+		f.subclass.integer = condition;
 		f.data.ptr = (void*)data;
 		f.datalen = datalen;
 		if (!(res = local_queue_frame(p, isoutbound, &f, ast, 1)))
@@ -469,7 +469,7 @@
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
-	f.subclass = digit;
+	f.subclass.integer = digit;
 	if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
 		ast_mutex_unlock(&p->lock);
 
@@ -488,7 +488,7 @@
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
-	f.subclass = digit;
+	f.subclass.integer = digit;
 	f.len = duration;
 	if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
 		ast_mutex_unlock(&p->lock);
@@ -527,7 +527,7 @@
 	
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
-	f.subclass = subclass;
+	f.subclass.integer = subclass;
 	f.data.ptr = (char *)data;
 	f.datalen = datalen;
 	if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
@@ -638,7 +638,7 @@
 {
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
-	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .data.uint32 = ast->hangupcause };
+	struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_HANGUP }, .data.uint32 = ast->hangupcause };
 	struct ast_channel *ochan = NULL;
 	int glaredetect = 0, res = 0;
 

Modified: team/tilghman/codec_bits3/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_mgcp.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_mgcp.c (original)
+++ team/tilghman/codec_bits3/channels/chan_mgcp.c Sat Oct 24 15:44:01 2009
@@ -626,8 +626,7 @@
 
 static void mgcp_queue_control(struct mgcp_subchannel *sub, int control)
 {
-	struct ast_frame f = { AST_FRAME_CONTROL, };
-	f.subclass = control;
+	struct ast_frame f = { AST_FRAME_CONTROL, { control } };
 	return mgcp_queue_frame(sub, &f);
 }
 
@@ -1220,9 +1219,9 @@
 	if (sub->owner) {
 		/* We already hold the channel lock */
 		if (f->frametype == AST_FRAME_VOICE) {
-			if (f->subclass != sub->owner->nativeformats) {
-				ast_debug(1, "Oooh, format changed to %s\n", ast_getformatname(f->subclass));
-				sub->owner->nativeformats = f->subclass;
+			if (f->subclass.codec != sub->owner->nativeformats) {
+				ast_debug(1, "Oooh, format changed to %s\n", ast_getformatname(f->subclass.codec));
+				sub->owner->nativeformats = f->subclass.codec;
 				ast_set_read_format(sub->owner, sub->owner->readformat);
 				ast_set_write_format(sub->owner, sub->owner->writeformat);
 			}
@@ -1263,9 +1262,9 @@
 			return 0;
 		}
 	} else {
-		if (!(frame->subclass & ast->nativeformats)) {
+		if (!(frame->subclass.codec & ast->nativeformats)) {
 			ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
-				ast_getformatname(frame->subclass),
+				ast_getformatname(frame->subclass.codec),
 				ast_getformatname_multiple(buf, sizeof(buf), ast->nativeformats),
 				ast_getformatname(ast->readformat),
 				ast_getformatname(ast->writeformat));
@@ -3263,7 +3262,7 @@
 				  (ev[0] == '*') || (ev[0] == '#'))) {
 			if (sub && sub->owner && (sub->owner->_state >=  AST_STATE_UP)) {
 				f.frametype = AST_FRAME_DTMF;
-				f.subclass = ev[0];
+				f.subclass.integer = ev[0];
 				f.src = "mgcp";
 				/* XXX MUST queue this frame to all subs in threeway call if threeway call is active */
 				mgcp_queue_frame(sub, &f);

Modified: team/tilghman/codec_bits3/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_oss.c?view=diff&rev=225760&r1=225759&r2=225760
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_oss.c (original)
+++ team/tilghman/codec_bits3/channels/chan_oss.c Sat Oct 24 15:44:01 2009
@@ -591,7 +591,7 @@
 static int oss_call(struct ast_channel *c, char *dest, int timeout)
 {
 	struct chan_oss_pvt *o = c->tech_pvt;
-	struct ast_frame f = { 0, };
+	struct ast_frame f = { AST_FRAME_CONTROL, };
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(name);
 		AST_APP_ARG(flags);
@@ -602,24 +602,20 @@
 
 	ast_verbose(" << Call to device '%s' dnid '%s' rdnis '%s' on console from '%s' <%s> >>\n", dest, c->cid.cid_dnid, c->cid.cid_rdnis, c->cid.cid_name, c->cid.cid_num);
 	if (!ast_strlen_zero(args.flags) && strcasecmp(args.flags, "answer") == 0) {
-		f.frametype = AST_FRAME_CONTROL;
-		f.subclass = AST_CONTROL_ANSWER;
+		f.subclass.integer = AST_CONTROL_ANSWER;
 		ast_queue_frame(c, &f);
 	} else if (!ast_strlen_zero(args.flags) && strcasecmp(args.flags, "noanswer") == 0) {
-		f.frametype = AST_FRAME_CONTROL;
-		f.subclass = AST_CONTROL_RINGING;
+		f.subclass.integer = AST_CONTROL_RINGING;
 		ast_queue_frame(c, &f);
 		ast_indicate(c, AST_CONTROL_RINGING);
 	} else if (o->autoanswer) {
 		ast_verbose(" << Auto-answered >> \n");
-		f.frametype = AST_FRAME_CONTROL;
-		f.subclass = AST_CONTROL_ANSWER;
+		f.subclass.integer = AST_CONTROL_ANSWER;
 		ast_queue_frame(c, &f);
 		o->hookstate = 1;
 	} else {
 		ast_verbose("<< Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
-		f.frametype = AST_FRAME_CONTROL;
-		f.subclass = AST_CONTROL_RINGING;
+		f.subclass.integer = AST_CONTROL_RINGING;
 		ast_queue_frame(c, &f);
 		ast_indicate(c, AST_CONTROL_RINGING);
 	}
@@ -717,7 +713,7 @@
 		return f;
 	/* ok we can build and deliver the frame to the caller */
 	f->frametype = AST_FRAME_VOICE;
-	f->subclass = AST_FORMAT_SLINEAR;

[... 384 lines stripped ...]



More information about the asterisk-commits mailing list