[Asterisk-cvs] asterisk/channels chan_iax2.c, 1.307, 1.308 iax2-parser.c, 1.46, 1.47

markster at lists.digium.com markster at lists.digium.com
Mon Jun 13 04:46:36 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv743/channels

Modified Files:
	chan_iax2.c iax2-parser.c 
Log Message:
Various IAX2 fixes


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.307
retrieving revision 1.308
diff -u -d -r1.307 -r1.308
--- chan_iax2.c	9 Jun 2005 21:11:30 -0000	1.307
+++ chan_iax2.c	13 Jun 2005 08:48:17 -0000	1.308
@@ -94,10 +94,11 @@
 /*
  * Uncomment to try experimental IAX bridge optimization,
  * designed to reduce latency when IAX calls cannot
- * be trasnferred
+ * be trasnferred -- obsolete
  */
 
-#define BRIDGE_OPTIMIZATION 
+/* #define BRIDGE_OPTIMIZATION  */
+
 
 #define PTR_TO_CALLNO(a) ((unsigned short)(unsigned long)(a))
 #define CALLNO_TO_PTR(a) ((void *)(unsigned long)(a))
@@ -2319,7 +2320,7 @@
 
 	if(fr->af.frametype == AST_FRAME_VOICE) {
 		type = JB_TYPE_VOICE;
-                len = ast_codec_get_samples(&fr->af) / 8;
+		len = ast_codec_get_samples(&fr->af) / 8;
 	} else if(fr->af.frametype == AST_FRAME_CNG) {
 		type = JB_TYPE_SILENCE;
 	}
@@ -2347,9 +2348,9 @@
 
 		iaxs[fr->callno]->jbid = -1;
 
-                /* deliver this frame now */
-                __do_deliver(fr);
-                return 0;
+		/* deliver this frame now */
+		__do_deliver(fr);
+		return 0;
 
 	}
 
@@ -6249,13 +6250,17 @@
 										forward_delivery(&fr);
 									} else {
 										duped_fr = iaxfrdup2(&fr);
-										schedule_delivery(duped_fr, 1, updatehistory, 1);
-										fr.ts = duped_fr->ts;
+										if (duped_fr) {
+											schedule_delivery(duped_fr, 1, updatehistory, 1);
+											fr.ts = duped_fr->ts;
+										}
 									}
 #else
 									duped_fr = iaxfrdup2(&fr);
-									schedule_delivery(duped_fr, 1, updatehistory, 1);
-									fr.ts = duped_fr->ts;
+									if (duped_fr) {
+										schedule_delivery(duped_fr, 1, updatehistory, 1);
+										fr.ts = duped_fr->ts;
+									}
 #endif
 									if (iaxs[fr.callno]->last < fr.ts) {
 										iaxs[fr.callno]->last = fr.ts;
@@ -7413,13 +7418,17 @@
 		forward_delivery(&fr);
 	} else {
 		duped_fr = iaxfrdup2(&fr);
-		schedule_delivery(duped_fr, 1, updatehistory, 0);
-		fr.ts = duped_fr->ts;
+		if (duped_fr) {
+			schedule_delivery(duped_fr, 1, updatehistory, 0);
+			fr.ts = duped_fr->ts;
+		}
 	}
 #else
 	duped_fr = iaxfrdup2(&fr);
-	schedule_delivery(duped_fr, 1, updatehistory, 0);
-	fr.ts = duped_fr->ts;
+	if (duped_fr) {
+		schedule_delivery(duped_fr, 1, updatehistory, 0);
+		fr.ts = duped_fr->ts;
+	}
 #endif
 
 	if (iaxs[fr.callno]->last < fr.ts) {

Index: iax2-parser.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- iax2-parser.c	6 Jun 2005 22:12:19 -0000	1.46
+++ iax2-parser.c	13 Jun 2005 08:48:17 -0000	1.47
@@ -880,7 +880,7 @@
 	if (fr->af.datalen) {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 		/* We need to byte-swap slinear samples from network byte order */
-		if (fr->af.subclass == AST_FORMAT_SLINEAR) {
+		if ((fr->af.frametype == AST_FRAME_VOICE) && (fr->af.subclass == AST_FORMAT_SLINEAR)) {
 			ast_swapcopy_samples(fr->af.data, f->data, fr->af.samples);
 		} else
 #endif




More information about the svn-commits mailing list