[asterisk-commits] tilghman: trunk r132510 - in /trunk: build_tools/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 21 15:59:04 CDT 2008


Author: tilghman
Date: Mon Jul 21 15:59:03 2008
New Revision: 132510

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132510
Log:
Optionally build integer-based routines for FSK tone decoding (but default
to the more accurate float-based routines).
(Closes issue #11679)
(Step 1 of 2)

Added:
    trunk/include/asterisk/fskmodem_float.h
      - copied unchanged from r78226, trunk/include/asterisk/fskmodem.h
    trunk/include/asterisk/fskmodem_int.h
      - copied unchanged from r132426, trunk/include/asterisk/fskmodem.h
    trunk/main/fskmodem_float.c
      - copied unchanged from r78226, trunk/main/fskmodem.c
    trunk/main/fskmodem_int.c
      - copied unchanged from r132426, trunk/main/fskmodem.c
Removed:
    trunk/include/asterisk/fskmodem.h
    trunk/main/fskmodem.c
Modified:
    trunk/build_tools/cflags.xml
    trunk/main/callerid.c
    trunk/main/tdd.c

Modified: trunk/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/cflags.xml?view=diff&rev=132510&r1=132509&r2=132510
==============================================================================
--- trunk/build_tools/cflags.xml (original)
+++ trunk/build_tools/cflags.xml Mon Jul 21 15:59:03 2008
@@ -44,4 +44,6 @@
 		</member>
 		<member name="IAX_OLD_FIND" displayname="Use the old, slow method of searching for IAX callnos">
 		</member>
+		<member name="INTEGER_CALLERID" displayname="Use the (less accurate) integer-based method for decoding FSK tones (for embedded systems)">
+		</member>
 	</category>

Modified: trunk/main/callerid.c
URL: http://svn.digium.com/view/asterisk/trunk/main/callerid.c?view=diff&rev=132510&r1=132509&r2=132510
==============================================================================
--- trunk/main/callerid.c (original)
+++ trunk/main/callerid.c Mon Jul 21 15:59:03 2008
@@ -128,6 +128,7 @@
 	struct callerid_state *cid;
 
 	if ((cid = ast_calloc(1, sizeof(*cid)))) {
+#ifdef INTEGER_CALLERID
 		cid->fskd.ispb = 7;          	/* 1200 baud */	
 		/* Set up for 1200 / 8000 freq *32 to allow ints */
 		cid->fskd.pllispb  = (int)(8000 * 32  / 1200);
@@ -155,6 +156,27 @@
 		/* cid->pos = 0; */
 
 		fskmodem_init(&cid->fskd);
+#else
+		cid->fskd.spb = 7.0;          	/* 1200 baud */
+		/* cid->fskd.hdlc = 0; */     	/* Async */
+		cid->fskd.nbit = 8;           	/* 8 bits */
+		cid->fskd.nstop = 1.0;        	/* 1 stop bit */
+		/* cid->fskd.paridad = 0; */  	/* No parity */
+		cid->fskd.bw = 1;             	/* Filter 800 Hz */
+		if (cid_signalling == 2) {    	/* v23 signalling */
+			cid->fskd.f_mark_idx =  4;	/* 1300 Hz */
+			cid->fskd.f_space_idx = 5;	/* 2100 Hz */
+		} else {                      	/* Bell 202 signalling as default */
+			cid->fskd.f_mark_idx =  2;	/* 1200 Hz */
+			cid->fskd.f_space_idx = 3;	/* 2200 Hz */
+		}
+		/* cid->fskd.pcola = 0; */    	/* No clue */
+		/* cid->fskd.cont = 0.0; */   	/* Digital PLL reset */
+		/* cid->fskd.x0 = 0.0; */
+		/* cid->fskd.state = 0; */
+		cid->flags = CID_UNKNOWN_NAME | CID_UNKNOWN_NUMBER;
+		/* cid->pos = 0; */
+#endif
 	}
 
 	return cid;

Modified: trunk/main/tdd.c
URL: http://svn.digium.com/view/asterisk/trunk/main/tdd.c?view=diff&rev=132510&r1=132509&r2=132510
==============================================================================
--- trunk/main/tdd.c (original)
+++ trunk/main/tdd.c Mon Jul 21 15:59:03 2008
@@ -99,6 +99,7 @@
 	struct tdd_state *tdd;
 	tdd = calloc(1, sizeof(*tdd));
 	if (tdd) {
+#ifdef INTEGER_CALLERID
 		tdd->fskd.ispb = 176;        /* 45.5 baud */
 		/* Set up for 45.5 / 8000 freq *32 to allow ints */
 		tdd->fskd.pllispb  = (int)((8000 * 32 * 2) / 90);
@@ -115,8 +116,24 @@
 		tdd->fskd.state = 0;
 		tdd->pos = 0;
 		tdd->mode = 0;
+		fskmodem_init(&tdd->fskd);
+#else
+		tdd->fskd.spb = 176;        /* 45.5 baud */
+		tdd->fskd.hdlc = 0;         /* Async */
+		tdd->fskd.nbit = 5;         /* 5 bits */
+		tdd->fskd.nstop = 1.5;      /* 1.5 stop bits */
+		tdd->fskd.parity = 0;       /* No parity */
+		tdd->fskd.bw=0;             /* Filter 75 Hz */
+		tdd->fskd.f_mark_idx = 0;   /* 1400 Hz */
+		tdd->fskd.f_space_idx = 1;  /* 1800 Hz */
+		tdd->fskd.pcola = 0;        /* No clue */
+		tdd->fskd.cont = 0;         /* Digital PLL reset */
+		tdd->fskd.x0 = 0.0;
+		tdd->fskd.state = 0;
+		tdd->pos = 0;
+		tdd->mode = 2;
+#endif
 		tdd->charnum = 0;
-		fskmodem_init(&tdd->fskd);
 	} else
 		ast_log(LOG_WARNING, "Out of memory\n");
 	return tdd;




More information about the asterisk-commits mailing list