[Asterisk-cvs] asterisk UPGRADE.txt,1.18,1.19 frame.c,1.61,1.62
kpfleming
kpfleming
Mon Aug 22 15:27:24 CDT 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv8900
Modified Files:
UPGRADE.txt frame.c
Log Message:
support new format for musiconhold.conf (issue #4908)
support non-SLINEAR moh streams (issue #4908)
add external app to feed TCP stream into Asterisk for moh (issue #4908)
Index: UPGRADE.txt
===================================================================
RCS file: /usr/cvsroot/asterisk/UPGRADE.txt,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- UPGRADE.txt 21 Aug 2005 16:54:43 -0000 1.18
+++ UPGRADE.txt 22 Aug 2005 19:29:29 -0000 1.19
@@ -137,3 +137,9 @@
behavior has been fixed. If you do not want your script to terminate
at the end of AGI being called (e.g. on a hangup) then set SIGHUP to
be ignored within your application.
+
+Music On Hold:
+
+* The preferred format for musiconhold.conf has changed; please see the
+ sample configuration file for the new format. The existing format
+ is still supported but will generate warnings when the module is loaded.
Index: frame.c
===================================================================
RCS file: /usr/cvsroot/asterisk/frame.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- frame.c 15 Jul 2005 23:00:46 -0000 1.61
+++ frame.c 22 Aug 2005 19:29:29 -0000 1.62
@@ -1168,7 +1168,6 @@
return cnt;
}
-
int ast_codec_get_samples(struct ast_frame *f)
{
int samples=0;
@@ -1210,3 +1209,35 @@
return samples;
}
+int ast_codec_get_len(int format, int samples)
+{
+ int len = 0;
+
+ /* XXX Still need speex, g723, and lpc10 XXX */
+ switch(format) {
+ case AST_FORMAT_ILBC:
+ len = (samples / 240) * 50;
+ break;
+ case AST_FORMAT_GSM:
+ len = (samples / 160) * 33;
+ break;
+ case AST_FORMAT_G729A:
+ len = samples / 8;
+ break;
+ case AST_FORMAT_SLINEAR:
+ len = samples * 2;
+ break;
+ case AST_FORMAT_ULAW:
+ case AST_FORMAT_ALAW:
+ len = samples;
+ break;
+ case AST_FORMAT_ADPCM:
+ case AST_FORMAT_G726:
+ len = samples / 2;
+ break;
+ default:
+ ast_log(LOG_WARNING, "Unable to calculate sample length for format %s\n", ast_getformatname(format));
+ }
+
+ return len;
+}
More information about the svn-commits
mailing list