最後更新: 2015-07-22
查看支援什麼 codec
core show codecs
2 audio ulaw (G.711 u-law) 3 audio alaw (G.711 a-law) 36 video vp8 (VP8 video) ..................
G.711(OpenSource)
* released for usage in 1972
* PCM
* fax communication over IP networks
* 64 kbit/s
* 300–3400 Hz
* 8,000 samples / 8 bits each sample
* Typical algorithmic delay is 0.125 ms
* logarithmic
* almost zero load on the CPU
http://en.wikipedia.org/wiki/Coherence_bandwidth
http://en.wikipedia.org/wiki/Narrowband
Both are logarithmic:
- μ-law algorithm (used in North America & Japan) Input: 13-bit ---> 8-bit
-
a-law algorithm (used in Europe and the rest of the world) Input: 14-bit ---> 8-bit
(specifically designed to be simpler for a computer to process)
G.726
- ADPCM (Adaptive Differential Pulse-Code Modulation)
- 16 Kbps, 24 Kbps, and 32 Kbps
- it sends only enough information to describe the difference between the current sample and the previous one
- inability to carry modem and fax signals
# 經測試, 質量很差 @@"
* Asterisk(1.8) currently supports the 32kbps standard only.
G.729 (Proprietry)
# DISCLAIMER: You might have to pay royalty fees to the G.729/723.1 patent holders for using their algorithm.
運作
compresses digital voice in packets of 10 milliseconds duration
特性:
bit rate of 8 kbit/s
extended: G.729a and G.729b
P.S.
Dual-tone multi-frequency signaling (DTMF), fax transmissions, and high-quality audio cannot be transported reliably with this codec.
# put in your Asterisk modules directory.
codec_g729.so
codec_g723.so
GSM (Proprietry)
audio into between 6.5( Half Rate ) and 13 kbit/s( Full Rate)
GSM (Global System for Mobile communications)
* GSM includes a codec
* linear predictive coding
運作:
The speech signal is divided into blocks of 20 ms.
These blocks are then passed to the speech codec, which has a rate of 13 kbps, in order to obtain blocks of 260 bits.
Newer:
HR (Half Rate) uses CELP-VSELP (Code Excited Linear Prediction - Vector Sum Excited Linear Prediction)
Enhanced Full Rate (EFR) uses ACELP (Algebraic Code Excited Linear Prediction)(12.2 kbit/s) (yr 1997)
後繼: variable-rate codec: AMR-Narrowband
asterisk 1.8
gsm = 13 Kbps (full rate), 20ms frame size
speex (Open Source)
* bitrates ranging from 2 to 44 kbps
* based on CELP
* Narrowband (8 kHz), wideband (16 kHz), and ultra-wideband (32 kHz) compression in the same bitstream
* Packet loss concealment
* Variable bitrate operation (VBR)
* Voice Activity Detection (VAD)
* Discontinuous Transmission (DTX)
* Fixed-point port
* Acoustic echo canceller
* Noise suppression
PESQ MOS-LQO (Perceptual Evaluation of Speech Quality)
a test methodology for automated assessment of the speech quality as experienced by a user of a telephony system.
http://en.wikipedia.org/wiki/PESQ
# 系統可支援的編碼類型
CLI> core show codecs [audio|video|image]
# 系統可用的語音編碼及轉換所需要的時間
CLI> core show translation
CLI> core show translation recalc 10
重新計算不同語音編碼轉換所需的時間
Check SIP 通話所使用的語音編碼
server*CLI> sip show channels
Peer User/ANR Call ID Format Hold Last Message Expiry Peer
192.168.88.172 (None) 7100491849bf009 0x0 (nothing) No Rx: REGISTER <guest>
192.168.88.171 201 5e0634bc697052d 0x2 (gsm) No Rx: ACK 201
2 active SIP dialogs
server*CLI> sip show channel 5e0634bc697052d
* SIP Call Curr. trans. direction: Incoming Call-ID: [email protected] Owner channel ID: SIP/201-00000007 Our Codec Capability: 0x2 (gsm) Non-Codec Capability (DTMF): 1 Their Codec Capability: 0x2 (gsm) Joint Codec Capability: 0x2 (gsm) Format: 0x2 (gsm) T.38 support No Video support No MaxCallBR: 384 kbps Theoretical Address: 192.168.88.171:5060 Received Address: 192.168.88.171:5060 SIP Transfer mode: open Force rport: No Audio IP: 192.168.88.150 (local) Our Tag: as15c335d0 Their Tag: 16035868 SIP User agent: CM5K-PHONE (903060) Username: 201 Peername: 201 Original uri: sip:[email protected]:5060 Caller-ID: 201 Need Destroy: No Last Message: Rx: ACK Promiscuous Redir: No Route: sip:[email protected]:5060 DTMF Mode: rfc2833 SIP Options: 100rel replaces replace Session-Timer: Inactive
MaxCallBR
Default is 384 kbps
P.S.
Your call for that peer allowed max bit rate or bandwidth of 384 kpbs only
sip.conf
;maxcallbitrate=384
設定語音編碼
sip.conf
[202]
fullname = tim
registersip = no
host = dynamic
callgroup = 1
mailbox = 202
call-limit = 100
type = peer
username = 202
transfer = yes
callcounter = yes
context = DLPN_all_user
cid_number = 202
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = no
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = ??????????
nat = no
canreinvite = no
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
macaddress = 202
autoprov = yes
label = 202
linenumber = 1
LINEKEYS = 1
disallow=all
allow=gsm
allow=ulaw
allow=alaw
附加檔案 | 大小 |
---|---|
nb_codecs_small.png | 16.47 KB |