[asterisk-commits] oej: branch oej/tdd-sip r101292 - /team/oej/tdd-sip/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 30 11:54:47 CST 2008


Author: oej
Date: Wed Jan 30 11:54:46 2008
New Revision: 101292

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101292
Log:
Updates

Modified:
    team/oej/tdd-sip/channels/chan_sip.c

Modified: team/oej/tdd-sip/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/tdd-sip/channels/chan_sip.c?view=diff&rev=101292&r1=101291&r2=101292
==============================================================================
--- team/oej/tdd-sip/channels/chan_sip.c (original)
+++ team/oej/tdd-sip/channels/chan_sip.c Wed Jan 30 11:54:46 2008
@@ -2,6 +2,7 @@
 	We need to create a structure with the TDD stuff and malloc that
 	structure when needed. We can't continue to expand the SIP_PVT with
 	new variables for every possible scenario out there.
+	Does TTY only work on ULAW with 20ms framing? Seems like the BUFLEN stuff assumes ulaw and 160 samples
 */
 /*
  * Asterisk -- An open source telephony toolkit.
@@ -247,8 +248,8 @@
 
 #define INITIAL_CSEQ                 101              /*!< our initial sip sequence number */
 
-#define	END_SILENCE_LEN              400              /*!< TTY silence length */
-#define	ASCII_BYTES_PER_CHAR         80               /*!< TTY bytes of sound data per character */
+#define TTY_READBUFLEN		160		/*!< uLaw=>160 samples/frame */
+#define TTY_CHARBUFLENGTH	2048
 
 #define DEFAULT_MAX_SE               1800             /*!< Session-Timer Default Session-Expires period (RFC 4028) */
 #define DEFAULT_MIN_SE               90               /*!< Session-Timer Default Min-SE period (RFC 4028) */
@@ -1310,12 +1311,10 @@
         struct tdd_state *tdd;                  /*!< TDD state */
         unsigned int didtdd:1;
 	unsigned int tddIsSending;
-#define TDDREADBUFLEN 160  /* uLaw=>160 samples/frame */
-        short tddbuffer[AST_FRIENDLY_OFFSET/2 + TDDREADBUFLEN];  /* TDD read buffer */
+        short tddbuffer[AST_FRIENDLY_OFFSET/2 + TTY_READBUFLEN];  /* TDD read buffer */
 	unsigned char* ttytonebuf;
 	int ttytonebufend;
-#define TTYCHARBUFLENGTH 2048
-	char ttycharbuf[TTYCHARBUFLENGTH];
+	char ttycharbuf[TTY_CHARBUFLENGTH];
 	int ttycharbuflen;
 	int ttyhasholdtone;
 	int vcoMode;
@@ -21247,7 +21246,7 @@
 				tdd_free(p->tdd);
 			p->tdd = 0;
 			p->didtdd = 0;
-			memset(p->ttycharbuf, '\0', TTYCHARBUFLENGTH-1);
+			memset(p->ttycharbuf, '\0', TTY_CHARBUFLENGTH-1);
 
 			return 0;
 		}
@@ -21264,7 +21263,7 @@
 			
 			p->ttytonebuf = ast_malloc(1024*TDD_BYTES_PER_CHAR);
 			p->ttytonebufend = 0;
-			memset(p->ttycharbuf,'\0',TTYCHARBUFLENGTH-1);
+			memset(p->ttycharbuf,'\0',TTY_CHARBUFLENGTH-1);
 			p->ttycharbuf[0] = '\0';
 			p->ttyhasholdtone = 0;
 			p->vcoMode = 0;




More information about the asterisk-commits mailing list