Index: frame.c
===================================================================
RCS file: /usr/cvsroot/asterisk/frame.c,v
retrieving revision 1.61
diff -u -1 -r1.61 frame.c
--- frame.c	15 Jul 2005 23:00:46 -0000	1.61
+++ frame.c	17 Jul 2005 22:20:55 -0000
@@ -194,3 +194,3 @@
 			/* If we have delivery time, increment it, otherwise, leave it at 0 */
-			s->delivery = ast_tvadd(s->delivery, ast_samp2tv(s->f.samples, 8000));
+			s->delivery = ast_tvadd(s->delivery, ast_samp2tv(s->f.samples, 32000));
 		}
Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.139
diff -u -1 -r1.139 rtp.c
--- rtp.c	15 Jul 2005 23:00:46 -0000	1.139
+++ rtp.c	17 Jul 2005 22:20:56 -0000
@@ -588,3 +588,3 @@
    of our codecs, or RTP-specific data type. */
-static struct {
+static const struct {
   struct rtpPayloadType payloadType;
@@ -617,3 +617,3 @@
    table for transmission */
-static struct rtpPayloadType static_RTP_PT[MAX_RTP_PT] = {
+static const struct rtpPayloadType static_RTP_PT[MAX_RTP_PT] = {
   [0] = {1, AST_FORMAT_ULAW},
@@ -1171,3 +1171,3 @@
 		/* Re-calculate last TS */
-		rtp->lastts = rtp->lastts + ms * 8;
+		rtp->lastts = rtp->lastts + ms * 32;
 		if (ast_tvzero(f->delivery)) {
Index: translate.c
===================================================================
RCS file: /usr/cvsroot/asterisk/translate.c,v
retrieving revision 1.40
diff -u -1 -r1.40 translate.c
--- translate.c	15 Jul 2005 23:00:46 -0000	1.40
+++ translate.c	17 Jul 2005 22:20:56 -0000
@@ -163,3 +163,3 @@
 		/* Predict next incoming sample */
-		path->nextin = ast_tvadd(path->nextin, ast_samp2tv(f->samples, 8000));
+		path->nextin = ast_tvadd(path->nextin, ast_samp2tv(f->samples, 32000));
 	}
@@ -184,3 +184,3 @@
 				   frame. */
-				path->nextout = ast_tvadd(path->nextout, ast_samp2tv( out->samples, 8000));
+				path->nextout = ast_tvadd(path->nextout, ast_samp2tv( out->samples, 32000));
 			} else {
@@ -221,3 +221,3 @@
 	/* Call the encoder until we've processed one second of time */
-	while(sofar < samples * 8000) {
+	while(sofar < samples * 32000) {
 		f = t->sample();
Index: apps/app_mp3.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_mp3.c,v
retrieving revision 1.26
diff -u -1 -r1.26 app_mp3.c
--- apps/app_mp3.c	15 Jul 2005 23:00:46 -0000	1.26
+++ apps/app_mp3.c	17 Jul 2005 22:20:56 -0000
@@ -66,2 +66,3 @@
 	}
+	const char *rate = "32000";
 	/* Execute mpg123, but buffer if it's a net connection */
@@ -69,7 +70,7 @@
 		/* Most commonly installed in /usr/local/bin */
-	    execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-b", "1024", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-b", "1024", "-f", "8192", "--mono", "-r", rate, filename, (char *)NULL);
 		/* But many places has it in /usr/bin */
-	    execl(MPG_123, "mpg123", "-q", "-s", "-b", "1024","-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execl(MPG_123, "mpg123", "-q", "-s", "-b", "1024","-f", "8192", "--mono", "-r", rate, filename, (char *)NULL);
 		/* As a last-ditch effort, try to use PATH */
-	    execlp("mpg123", "mpg123", "-q", "-s", "-b", "1024",  "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execlp("mpg123", "mpg123", "-q", "-s", "-b", "1024",  "-f", "8192", "--mono", "-r", rate, filename, (char *)NULL);
 	}
@@ -77,7 +78,7 @@
 		/* Most commonly installed in /usr/local/bin */
-	    execl(MPG_123, "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execl(MPG_123, "mpg123", "-q", "-s", "--mono", "-r", rate, filename, (char *)NULL);
 		/* But many places has it in /usr/bin */
-	    execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "--mono", "-r", rate, filename, (char *)NULL);
 		/* As a last-ditch effort, try to use PATH */
-	    execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
+	    execlp("mpg123", "mpg123", "-q", "-s", "--mono", "-r", rate, filename, (char *)NULL);
 	}
@@ -116,3 +117,3 @@
 		char offset[AST_FRIENDLY_OFFSET];
-		short frdata[160];
+		short frdata[640];
 	} myf;
@@ -171,3 +172,3 @@
 				}
-				next = ast_tvadd(next, ast_samp2tv(myf.f.samples, 8000));
+				next = ast_tvadd(next, ast_samp2tv(myf.f.samples, 32000));
 			} else {
Index: channels/chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.781
diff -u -1 -r1.781 chan_sip.c
--- channels/chan_sip.c	15 Jul 2005 23:00:46 -0000	1.781
+++ channels/chan_sip.c	17 Jul 2005 22:21:04 -0000
@@ -4008,3 +4008,3 @@
 				strncat(m, costr, sizeof(m) - strlen(m) - 1);
-				snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, p->prefcodec));
+				snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/32000\r\n", codec, ast_rtp_lookup_mime_subtype(1, p->prefcodec));
 				ast_copy_string(a, costr, sizeof(a));
@@ -4030,3 +4030,3 @@
 					strncat(m, costr, sizeof(m) - strlen(m) - 1);
-					snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, pref_codec));
+					snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/32000\r\n", codec, ast_rtp_lookup_mime_subtype(1, pref_codec));
 					strncat(a, costr, sizeof(a) - strlen(a) - 1);
@@ -4052,3 +4052,3 @@
 					strncat(m, costr, sizeof(m) - strlen(m) - 1);
-					snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x));
+					snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/32000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x));
 					strncat(a, costr, sizeof(a) - strlen(a) - 1);
Index: codecs/codec_speex.c
===================================================================
RCS file: /usr/cvsroot/asterisk/codecs/codec_speex.c,v
retrieving revision 1.17
diff -u -1 -r1.17 codec_speex.c
--- codecs/codec_speex.c	12 Jul 2005 22:20:16 -0000	1.17
+++ codecs/codec_speex.c	17 Jul 2005 22:21:04 -0000
@@ -81,3 +81,3 @@
 	if (tmp) {
-		if (!(tmp->speex = speex_encoder_init(&speex_nb_mode))) {
+		if (!(tmp->speex = speex_encoder_init(&speex_uwb_mode))) {
 			free(tmp);
@@ -87,2 +87,3 @@
 			speex_bits_reset(&tmp->bits);
+
 			speex_encoder_ctl(tmp->speex, SPEEX_GET_FRAME_SIZE, &tmp->framesize);
@@ -117,3 +118,3 @@
 	if (tmp) {
-		if (!(tmp->speex = speex_decoder_init(&speex_nb_mode))) {
+		if (!(tmp->speex = speex_decoder_init(&speex_uwb_mode))) {
 			free(tmp);
@@ -154,3 +155,3 @@
 	/* All frames are 20 ms long */
-	f.samples = 160;
+	f.samples = 640;
 	f.mallocd = 0;
@@ -287,3 +288,3 @@
 	tmp->f.datalen = len;
-	tmp->f.samples = y * 160;
+	tmp->f.samples = y * tmp->framesize;
 #if 0
