Converting wav to alaw (with help from Asterisk)

I was looking for a way to convert wav files to alaw files and had trouble finding the right software to do this so I tried using sox but got some strange errors when converting to alaw

After playing around a bit I found a workaround by converting to gsm format first using sox and using Asterisk to convert gsm format to alaw next.

Let me explain how:

1. Upload your wav file to your server and make sure you put it in a directory the Asterisk user and group have access to.

2. Next typ the following command:  sox filename.wav filename.gsm
Notice: we use gsm format here

3. Go to Asterisk CLI by typing:  asterisk -vvvvvvr

4. In Asterisk CLI typ:  file convert filename.gsm filename.alaw

5. That's all, you can now find your alaw file in the folder you specified.