[svn-commits] jdixon: branch jdixon/chan_usbradio-1.4 r147389 - /team/jdixon/chan_usbradio-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 7 16:51:45 CDT 2008


Author: jdixon
Date: Tue Oct  7 16:51:45 2008
New Revision: 147389

URL: http://svn.digium.com/view/asterisk?view=rev&rev=147389
Log:
Temp fix for old/new compatibility and no VNAK floods or lockups

Modified:
    team/jdixon/chan_usbradio-1.4/channels/chan_iax2.c

Modified: team/jdixon/chan_usbradio-1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/channels/chan_iax2.c?view=diff&rev=147389&r1=147388&r2=147389
==============================================================================
--- team/jdixon/chan_usbradio-1.4/channels/chan_iax2.c (original)
+++ team/jdixon/chan_usbradio-1.4/channels/chan_iax2.c Tue Oct  7 16:51:45 2008
@@ -101,6 +101,8 @@
 #include "iax2-parser.h"
 #include "iax2-provision.h"
 #include "jitterbuf.h"
+
+#define	BAD_RADIO_HACK
 
 /* Define SCHED_MULTITHREADED to run the scheduler in a special
    multithreaded mode. */
@@ -7033,9 +7035,11 @@
 	char caller_pref_buf[128];
 	struct ast_codec_pref pref;
 	char *using_prefs = "mine";
+	char __fr_location[sizeof(struct iax_frame) + 4096];
 
 	/* allocate an iax_frame with 4096 bytes of data buffer */
-	fr = alloca(sizeof(*fr) + 4096);
+//	fr = alloca(sizeof(*fr) + 4096);
+	fr = (struct iax_frame *) __fr_location; /* alloca is unstable */
 	memset(fr, 0, sizeof(*fr));
 	fr->afdatalen = 4096; /* From alloca() above */
 
@@ -7227,7 +7231,13 @@
 		if (ntohs(mh->callno) & IAX_FLAG_FULL) {
 			check_dcallno = f.frametype == AST_FRAME_IAX ? (f.subclass != IAX_COMMAND_PING && f.subclass != IAX_COMMAND_LAGRQ) : 1;
 		}
-
+/* The following hack is horrible, awful, and something quite temporary done
+to allow older versions of app_rpt and chan_iax2 not to cause systems to
+blow up, and will be removed as soon as possible */
+#ifdef	BAD_RADIO_HACK
+		if ((f.frametype == AST_FRAME_TEXT) ||
+			(f.frametype == AST_FRAME_CONTROL)) check_dcallno = 0;
+#endif
 		fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, fd, check_dcallno);
 	}
 




More information about the svn-commits mailing list