Board logo

標題: Asterisk - How to know which codec I'm using [打印本頁]

作者: ttmuskie    時間: 2011-12-21 18:51     標題: Asterisk - How to know which codec I'm using

Under cli, how could I know which codec I'm using after the connection is made? Thanks!
作者: bubblestar    時間: 2011-12-21 22:17

本帖最後由 bubblestar 於 2011-12-21 22:20 編輯

Use these commands in the Asterisk CLI for a detailed listing of the actual capabilities:

:> core show tanslation recalc 10
OR
:> core show translation
OR
:> core show codecs

Tha above are just for informational purposes.  It does not indicate anything about your configuration.

To tell which codec is being used for a specific call use one of the following CLI commands:

sip show channels
iax2 show channels

In general, you can define the codecs disallow or allow in specific extensions under sip.conf like this:

disallow=all
allow=alaw
allow=ulaw
作者: ttmuskie    時間: 2011-12-22 09:17

Thanks bubblestar.

But what I want to know is if I've specified the extensions 101 with codec, a,b,c and d and 102 with the same codec, a,b,c and d  under my sip.conf. How could I know 101 is using what codec under cli when it is connected with 102?

Btw, is there any order for those codec?
i.e. if all extensions using:
disallow=all
allow=a
allow=b
allow=c
allow=d

So, the "a" will always be the first codec to use? Thanks.
作者: bubblestar    時間: 2011-12-22 09:38

As specified in my reply, you can use the command sip show channels to learn the active channels being used.  You will get something like the following format in the screen:

Peer             User/ANR    Call ID      Seq (Tx/Rx)  Lag      Jitter  Format
192.168.0.206    206         79010fe1-5a  00101/61141  00000ms  0000ms  ULAW


Yes, codec placement is in order where first available codec comes first.  
disallow=all
allow=alaw
allow=ulaw
allow=gsm
allow=g729

In above case, alaw will be chosen first.

However, disallow must be put before allow. Otherwise, you may have problem.
作者: ckleea    時間: 2011-12-22 10:05

You may need either to look at the console or do some AMI script to dig out this information.

Is bandwidth a major concern or quality?

Sometimes when both peers have the same order of codec preference, the codec used may change in real time.
作者: ttmuskie    時間: 2011-12-22 13:42

本帖最後由 ttmuskie 於 2011-12-22 13:46 編輯

Got that. Thanks!
Btw, I just want to see how's the quality while using different codec.
作者: ckleea    時間: 2011-12-22 17:58

回復 6# ttmuskie


    I want to test the quality, just use one codec in your config file.
作者: ttmuskie    時間: 2011-12-22 21:09

thanks for the tips.




歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/) Powered by Discuz! 7.2