[asterisk-dev] Asterisk observations and suggestions

lope lopeonline at gmail.com
Thu Apr 28 02:52:56 CDT 2016


Hi,

*About me*
I'm new to Asterisk. I've compiled 13.6 and I've been using that. I've 
managed to get a bunch of different functionality working and I'm quite 
pleased with it so far. Thanks to everyone who has contributed to it!

Here are some things I noticed, comments/problems/suggestions, which may 
be useful?

*file convert ... g726-32 problems:*
`file convert foo.bar foo.g726-32` is extremely fussy about what files 
it will convert.
It seemed to work fine converting the example file: `file convert 
tt-weasels.ulaw tt-weasels.g726-32`

But when it came to converting an actual piece of music (for moh) I had 
problems converting from these filetypes: wav wav16 mp3 ogg ilbc ulaw 
alaw g722
I started with a normal mp3 file (44khz 160kbps mpeg1 layer 3 stereo), 
then converted it to wav as follows:
sox foo.mp3 -e signed-integer -c 1 -r 8000 out.wav
sox foo.mp3 -e signed-integer -c 1 -r 16000 out16.wav && rm out16.wav 
out.wav16
 From these 2 files, I was able to convert to every other format (that 
I've tested with Asterisk), except g726-32
These are the errors I got trying `file convert foo.bar foo.g726-32` 
where bar is one of (wav wav16 mp3 ogg ilbc ulaw alaw g722)
format_g726.c:143 g726_write: Invalid data length 39, should be multiple 
of 40
format_g726.c:143 g726_write: Invalid data length 39, should be multiple 
of 20
format_g726.c:143 g726_write: Invalid data length 45, should be multiple 
of 40
format_g726.c:143 g726_write: Invalid data length 128, should be 
multiple of 40

In some cases I was able to convert mp3 to g726-32 but it was very fussy 
with how the mp3 was encoded.
For example, when an mp3 was encoded like this, it was accepted:
lame --noreplaygain -b 560 foo.wav foo.mp3
This mp3 was rejected:
lame --noreplaygain -b 560 -q 0 foo.wav foo.mp3
But even once the mp3 that it would accept was converted "successfully" 
with file convert, the music was all messed up.

The only source format that was *successfully* converted by `file 
convert` to g726-32 was gsm.
However asterisk has no problem encoding a slin file to g726-32 during a 
call.

-------------------------

*Feature request: Filetypes for speex and speex16*
The speex and speex16 codecs do not have any associated file formats and 
thus cannot be read from disk and must be converted during the call. 
`core show file formats` speex/spx/speex16/spx16 is missing.
I have loaded the speex codec module and `core show codecs` shows I have 
speex, speex 16khz and speex 32khz loaded.
I don't know much about the Asterisk code but I would imagine adding a 
filetype association for speex would be trivial to implement?

I might be on the wrong track, but I just thought that my MOH, which is 
about 5 mins long, should be pre-encoded so that I don't waste CPU 
encoding it into the caller's format on every call?

Thanks for reading

Kind Regards
Lope
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160428/705bd268/attachment.html>


More information about the asterisk-dev mailing list