返回列表 發帖

Asterisk Opus Codecs

因為GSWave 有無多免費好用嘅功能, 所以加咗啲嘢係Asterisk Server 到, 可以比大家參考下
Opus 係免費, 個流量大約60K 以下, 和G729 差不多!!
This document shows you how to install and use Opus codec in Asterisk server:

我係用Asterisk 13.13.1

1. Go to link, http://downloads.digium.com/pub/telephony/codec_opus/

Here select appropriate Asterisk version of your instalation and then server architecture, in my case it was Asterisk 13 with 64 bit

2. Now download file as below,
- cd /usr/src
- wget http://downloads.digium.com/pub/ ... rrent-x86_64.tar.gz

3. Extract the downloaded file,
- tar -xvzf codec_opus-13.0_current-x86_64.tar.gz
- cd codec_opus-13.0_1.1.0-x86_64

4. Copy the codec_opus.so file into the Asterisk module directory
- cp codec_opus.so /usr/lib/asterisk/modules/

5. Copy the codec_opus_config-en_US.xml file into the Asterisk external documentation directory
- cp codec_opus_config-en_US.xml /var/lib/asterisk/documentation/thirdparty

6. Goto Asterisk CLI and restart it
- asterisk -rvvvv
- core restart now
- asterisk -rvvvv
- core reload

7. Now check opus codec running or not with below command
ubuntu*CLI> module show like opus
Module Description Use Count Status Support Level
codec_opus.so OPUS Coder/Decoder 0 Running extended
res_format_attr_opus.so Opus Format Attribute Module 1 Running core

If module not loaded, then try to load it manually from Asterisk cli,
- module load codec_opus.so
- module load res_format_attr_opus.so

8. Open file, nano /etc/asterisk/sip.conf and allow opus codec in it as shown below, so SIP soft phones can use that codec.

[general]
callcounter=yes ; enable device states for SIP devices
rtcachefriends=yes
udpbindaddr=0.0.0.0:5060
disallow=all
allow=opus
allow=ulaw
allow=alaw
allow=gsm

After adding, do sip reload from Asterisk cli to take changes into effect
ankit-desktop*CLI> sip reload
Reloading SIP
== Parsing '/etc/asterisk/sip.conf': Found
== Parsing '/etc/asterisk/users.conf': Found
== Using SIP CoS mark 4
== Parsing '/etc/asterisk/sip_notify.conf': Found
ankit-desktop*CLI>

返回列表