Codec Question

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Codec Question

Postby stephane » Mon Jun 18, 2007 3:43 pm

Hi,

Where Can I find some info on Codec ? All I have read seems NOT to deal deeply with CODECS

Is there a way toi know which CODEC a communication is using ?

TYpically, I have a VOIP provider using differnet CODECs, My Asterisk Server is using some of them, and my VOIP phone can use some of them..
What si the rule to know which codec they wull use ??

That seems to me important to know. For instance, if I am using a specific MOH... which version should I use ?

Thanks
stephane
Oldsterisk
 
Posts: 54
Joined: Fri Nov 24, 2006 4:31 pm

Postby middletn » Mon Jun 18, 2007 4:08 pm

This is a common question, I've put together a FAQ on this that will hopefully answer your questions.

http://www.noblesolutions.co.uk/voip4.html

regards
middletn
Oldsterisk
 
Posts: 137
Joined: Thu Dec 21, 2006 10:56 pm
Location: www.noblesolutions.co.uk

Postby stephane » Mon Jun 18, 2007 4:56 pm

Hi,

Thanks for your link, but there is one question, that I can't find the answer..

When you have 2 "hosts" communicating.. how do you select a specific Codec !!!!
That's really all I want to know !!

If I have ASterisk supporting GSM and alaw, and a SIP phone supporting GSM, ALAW, ULAW. How can force the com to be ALAW or GSM ???
Thanks !!!!
stephane
Oldsterisk
 
Posts: 54
Joined: Fri Nov 24, 2006 4:31 pm

Postby mbruni » Tue Jun 19, 2007 3:15 am

In sip.conf, for the two phones add this lines:

disallow=all ;no codec is allowed
allow=alaw ; alaw codec allowed
allow=gsm ; gsm codec allowed

Regards.
mbruni
Astmaster
 
Posts: 957
Joined: Thu Dec 21, 2006 10:56 pm
Location: Arezzo, Italy

Postby middletn » Tue Jun 19, 2007 5:39 am

The previous post is correct, however, the codec order is only set in the general section of the sip.conf file. The order is ignored on the individual host config (unless that has changed recently)

regards
middletn
Oldsterisk
 
Posts: 137
Joined: Thu Dec 21, 2006 10:56 pm
Location: www.noblesolutions.co.uk

Postby stephane » Tue Jun 19, 2007 2:06 pm

Hi,

Thanks for the answer...
WEll, into the [general] section, usually you have nothing, considering that you accept everything by default

Now, under a Provider or a phone, you can select which codec are available.

Now, let's say that you have declared for a phone :
disallow=all ;no codec is allowed
allow=alaw ; alaw codec allowed
allow=gsm ; gsm codec allowed

This means, that the communication wiht the phone will be : alaw if possible, Or gsm
Is that correct ?

1) HOW THE CHOICE IS MADE TO USE THIS ALAW OR THE GSM ?

That's I would like to understand

2) if I want to use GSM only with this config, because of a Bandwith problem, how can I do that ?

Thanks
stephane
Oldsterisk
 
Posts: 54
Joined: Fri Nov 24, 2006 4:31 pm

Postby middletn » Tue Jun 19, 2007 3:44 pm

The phones negotiate in the order of preference listed in the general section. So they'll try Alaw first. Assuming they both support it, the connection is made. If either one doesn't, the next codec is tried and so on.

If you want to force gsm, simply have gsm enable in the phone section for the given account.

So to recap, codec preference order is set in the general section of sip.conf. A subset is specified for each phone/account entry

So, gsm only

disallow=all ;no codec is allowed
allow=gsm ; gsm codec allowed

regards
middletn
Oldsterisk
 
Posts: 137
Joined: Thu Dec 21, 2006 10:56 pm
Location: www.noblesolutions.co.uk

Postby ianplain » Tue Jun 19, 2007 7:35 pm

Hi

Specifing codecs is different depending on whether its a set or you are registering to a ITSP or other *

A set is contolled by what is in its section and what IT wants order wise.

For example a Cisco ATA186 will always use ulaw if it is allowed in its section. no matter the order set in any conf file. Where as other sets will use the codecs in order of what is set in the user section. ie if alaw is first it will use alaw which goes against what is documented on the wiki.

If you look at the sip debug you will see the negotition going on.

You can set the general section to disallow=all and just use the individual sections. This isnt a good idea though but I have found that the order here does not affect Cisco and Aastra sets and ATAs, Budgtone the order can be set from the admin page of the unit.

It is worth checking how your sets and peers behave and then setting the conf files to reflect what you want.

Ian
ianplain
Moves Like Spencer
 
Posts: 3089
Joined: Thu Dec 14, 2006 7:01 am
Location: Bath, UK

Postby stephane » Wed Jun 20, 2007 12:36 am

Hi,

THanks for this answers..
So, for :
- Asterisk-> Phone registration => the phone can force the codec
- Asterisk -> Asterisk => that would be the codec order in the SIP.CONF, which will set up the codec ?

Is that correct ?
stephane
Oldsterisk
 
Posts: 54
Joined: Fri Nov 24, 2006 4:31 pm


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest