* You are viewing the archive for August, 2010

Asterisk Does Not Translate From Wav To Alaw

Use sox to downsample to 8khz (and 1 chan), and the problems should go away. While you are at it, you could use sox to convert to the target format in a single operation.

The scripts that Digium uses to take Allison’s voice prompts (at 48khz) to the different formats, convert things to slin (raw) as a central format, but in my experience, the fewer steps the better. But I doubt that anyone could detect the difference in the end result.

Here’s what I do with CD-qual sounds to turn them into the common Asterisk formats:

Assume $i is the name of the .wav file you want to convert:

x=`basename $i .wav`
sox -v 0.7 $i -r 16000 -c 1 -t sw $x.sln16
sox -v 0.7 $i -r 8000 -c 1 -t sw $x.raw
sox -r 8000 -c 1 -t sw $x.raw -t gsm $x.gsm ## OR ### sox -v 0.7 $i -r 8000 -t gsm $x.gsm
sox -r 8000 -c 1 -t sw $x.raw -t ul $x.ulaw ## OR ### sox -v 0.7 $i -r 8000 -t ul $x.ulaw
sox -r 8000 -c 1 -t sw $x.raw -t al $x.alaw ## OR ### sox -v 0.7 $i -r 8000 -t wav $x.wav
rm $x.raw
y=`pwd`
sudo asterisk -rx “file convert $y/$i $y/$x.g722″

 

I’m ignoring the siren & g729 formats; use asterisk for those in like format, depending on your asterisk version and codecs. Allison normalizes the volume of sounds she distributes; use the -v 0.7 to bring the volume down a bit to the standard, and your sounds won’t stick out against rest of Allison’s existing recordings in Asterisk. Digium uses a filter program to ‘heighten’ the sounds a little; That’s the main reason, I think, that they use the .raw format as an in-between. I’ve been skipping this step, as it doesn’t seem critical, in which case the direct conversion is probably preferable.

I suggest, that if you are converting sounds for Asterisk’s sake, that you convert to all the possible formats. Disk space is cheap, and you’ll squeeze a little extra performance out of Asterisk by allowing it to pick the ‘best’ format. Dahdi type interfaces would prefer the ulaw/alaw formats; High-def phones like Snom (and appropriate Polycoms, etc) could use the g722. Ulaw and gsm transcodings are cheap, but no transcoding is cheaper still.

If you load “res_convert.so”, you will have a CLI command “file convert …”.
Usage: file convert
Convert from file_in to file_out. If an absolute path is not given, the default Asterisk sounds directory will be used.

Example:
file convert tt-weasels.gsm tt-weasels.ulaw

or,

asterisk -rx “file convert /home/user/tt-weasels.gsm /home/user/tt-weasels.g729″

only part of dialplan available

Hello list,

yesterday I finished work having my whole dialplan available…

Today I want to make a call from one local phone to another and I get this :

[Aug 28 10:48:57] NOTICE[1895]: chan_sip.c:15144 handle_request_invite:
Call from ‘test2′ to extension ’60′ rejected because extension not found.

Although I have this context :

[from-TEST]

where all my local extensions are defined…

Yesterday all went fine, today it no longer works.

With the command “dialplan show [tab]“, I also see only a small part of
all my defined contexts…

Reloading, restarting… it all does not help…

When I look at my file extensions.conf, it has not changed !! Asterisk
just only loads 20% of the total dialplan…

Using asterisk 1.4.30. Don’t know which nightmare Asterisk had last
night, but it’s all messed up this morning !

Anyone has had the same experience yet ?! Any solution ?!

Kind regards,

Jonas.

Linux RDNIS

RDNIS is Redirected Dialed Number Information Service. RDNIS contains Type of Number (TON), Presentation, and Redirecting Number (RGN), and Reason (busy, no answer, etc.). When redirecting calls, the Originally Called Number (OCN) contains, as its name suggests, the number that was originally called.

The RGN identifies the telephone number redirecting a call. For example, if one forwards a call on busy from home to another number, RGN contains the home number. This is useful if, for example, one is running a voice mail system and wants one incoming number to which everyone can forward calls. The RGN can then be used to determine the appropriate mailbox. This usually only works on a PRI.

Q.931 supports RDNIS Type of Number (TON), Presentation, and Redirecting Number (RGN). It is (IE) 115 on a DMS-100 switch, IE 116 on National-ISDN-2.

A note about wireless phones: the ‘forward all calls’ feature does not necessarily send RDNIS, but ‘forward when busy’, ‘forward when unavailable’, and ‘forward when unreachable’ are supposed to send RDNIS. Functionality may depend on wireless provider more than PRI provider.

Groupe Telecom and Bell Canada both support this on their PRIs.

Asterisk 1.6 Displaying BackGround() in call trace but no audio is heard from caller

Thought a different succinct subject line must drum up an answer or two…

Also, this has been tested from two different carriers: We’re getting
an average of 2/10 call success rate.

Early media and IAX2

My IAX2 trunk provider, Teliax, seems to be forcing early media. Early
media is cool and all, but my Asterisk install doesn’t seem to be
fully supporting it. My initial setting was using Dial() to call all
of my dahdi (TDM400P) extensions. The results were that incoming calls
would not hear any ringing tones and the call would be ended by Teliax
after 21 seconds.

Looking at the packet dumps, my asterisk box is sending an ACCEPT and
a RINGING packet to Teliax. I tried:

Progress();
Dial();

Progress();
Ringing();
Dial();

Ringing();
Dial();

Dial(,,r);

Progress();
Dial(,,r);

All with the same result. After some experimenting, I found that:

Playback(tt-weasels,noanswer);

Would playback tt-weasels to the caller in early media. Furthermore:

Dial(,,m);

Plays back moh to the caller and also allows the ringing portion of
the call to pass the 21 second mark. If I had a ringing moh mp3, it
would be everything I wanted. However, it seems like the wrong
solution. Not only should Dial(,,r); work, but it seems like
Dial(); should know to send the ringing tones.

My asterisk version is 1:1.6.2.9-1 on debian/sid.