TUTORIAL OPUS Codec Installation

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
Hello.

I'm posting the procedure that I used (found online and changed accordingly) to install the opus codec and make it fully functional for Asterisk 13.x
Everything seems to be working but I'd prefer that Ward checked everything himself since I'm compiling from source and that can possibly lead to issues
So Ward to the wise :biggrin5: use with caution or better yet wait until this gets approved

1) Install latest OPUS
Code:
cd /root
wget http://downloads.xiph.org/releases/opus/opus-1.1.3.tar.gz
tar xvzf opus-1.1.3.tar.gz
rm -rf opus-1.1.3.tar.gz
cd opus-1.1.3/
./configure
make
make install

2) Check if everything went ok and the library is indeed available
Code:
ldconfig
/sbin/ldconfig -v | grep opus
You should get something like
libopus.so.0 -> libopus.so.0.5.3
Note: The ldconfig command gave me a bit of trouble. Sometimes it seems to execute fine, other times it gives an error. In case you get an error try with:
Code:
locate libopus
You should see the above mentioned libraries inside the list after executing the command


3) Download patch files for Asterisk 13 (different patches for earlier versions)
Code:
cd /root
wget https://github.com/seanbright/asterisk-opus/archive/asterisk-13.3.zip
mv asterisk-13.3.zip opus-vp8-asterisk-13.3.zip
unzip opus-vp8-asterisk-13.3.zip
rm opus-vp8-asterisk-13.3.zip

4) Apply patch to Asterisk 13 source
Code:
cd /usr/src/asterisk-13*
cp ../../../root/asterisk-opus-asterisk-13.3/codecs/* codecs/
cp ../../../root/asterisk-opus-asterisk-13.3/formats/* formats/
patch -p1 < ../../../root/asterisk-opus-asterisk-13.3/asterisk.patch

5) We are now ready to recompile
Code:
amportal stop
./bootstrap.sh
./configure --prefix=/usr
make menuselect   # Make sure codec_opus and format_vp8 are selected, save and Exit
make
make install

6) Now we check to see if module is installed
Code:
ls /usr/lib/asterisk/modules/ | grep opus
You should get something like
codec_opus.so
res_format_attr_opus.so



7) Restart Asterisk and do some final checks
Code:
amportal restart
asterisk -rvvv
module load codec_opus.so    # it's probably already loaded but just to make sure
core show translation    # and you should see opus in the list

8) Final step is to go from inside the GUI to Settings --> Asterisk SIP Settings and enable and drag up the OPUS codec checkbox. Submit and Apply and you are ready

That's all.
Test it, change it and (why not) add it to the main IncrediblePBX installation script if possible
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,083
Reaction score
2,602
While opus is a terrific codec, there are reasons it's not already in Asterisk. You can read all about it on Reddit. If you decide to use it and follow the tutorial above, you may also have to recompile FLITE to get TTS working again:
Code:
cd /usr/src/Asterisk-Flite*
make
make install
amportal restart
 
  • Like
Reactions: progs_00

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
Thank you very much Ward

I'm aware of the possible legal issues (if that is what you mean) with OPUS but I'm quite confident that this is going to be resolved easily enough. It's just hard to believe the situation with patents you have going on in America. They are killing practically everything
 
  • Like
Reactions: wardmundy

krzykat

Guru
Joined
Aug 2, 2008
Messages
1,514
Reaction score
401
Location
South Florida
Can you tell us more about OPUS? Will it give you better quality than G.711 and do the major handset makers such as Yealink, Grandstream, etc support it?
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
505
Reaction score
209
Grandstream added support in the latest gxp21xx beta.
 

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
Grandstream added support in the latest gxp21xx beta.
Indeed but it's still limited. They will fully implement it in the next firmware available.
As for quality, OPUS is lossy so it can't beat G711.
However as far as lossy codecs go, for me it's simply amazing. The way I see it and if you search you'll see that a lot of people are stating the same, all you need is G711 and OPUS. No other codec is (or better will be) necessary. Yes. It's that good
 
Last edited:
  • Like
Reactions: wardmundy

jerrm

Guru
Joined
Sep 23, 2015
Messages
505
Reaction score
209
Indeed but it's still limited. They will fully implement it in firmware to come. As for quality, opus is lossy so it can't beat g711.
However for me it comes at first place as far as lossy codecs go (better than g729 with possibly the same bandwidth utilization)
I had other issues with the beta and shelved it before getting to new features like Opus. Maybe the next update will be a keeper.
 

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
I'm currently testing it and have also been having some tiny issues. Nothing major so far which by Grandstream standards it's practically a miracle. Anyway to answer krzykat's second question, OPUS is a bit on the cutting edge which means that it's not as widely supported as the rest of the codecs. However its gaining in popularity (as you've seen Grandstream supports it at least on its Enterprise model phones and also Yealink) You should try it. It's a really amazing codec
 

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
Exactly. 1.0.7.81 which is what I'm currently testing. The main issue is with BLFs. Some extensions seem to freeze after usage (when BLF is red) but will eventually return to green. I've also noticed a problem once with parked calls but didn't happen again so I could not investigate further
1.0.7.25 I believe was Grandstream's way of reducing population. We lost many a good sysadmin long the way :D
It was so bad that I couldn't even get the phone to register 9 times out of 10 and that one time it stayed registered for no more than 20 minutes. It was pure pain
On the other hand 1.0.7.15 has served me pretty well

P.S. Sorry. Didn't see the question was for jerm. Hope I'm not intruding
 
Last edited:

krzykat

Guru
Joined
Aug 2, 2008
Messages
1,514
Reaction score
401
Location
South Florida
My results identical. I'm using 1.0.7.15 across the board. I just updated an old phone that for whatever reason was still on 1.04.x to 1.0.7.81 - and so far I haven't heard complaints. I'm really hoping it gets straightened out. I don't know why BLF seems to be such an issue with these companies (I've seen it on yealink too) - its like if they miss that packet, you're screwed. Why don't they just recheck every minute to confirm they are in the right state.
 

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
At least on the 1.0.65 the main issue seemed to be some oddly formatted sip packets and you had yourself a BLF christmas tree. I sure hope things get sorted out because I lost a lot of faith in Grandstream. And to think I'm one of the lucky ones that didn't get the 2170. Things there were (are?) a lot worse
 
  • Like
Reactions: wardmundy

jerrm

Guru
Joined
Sep 23, 2015
Messages
505
Reaction score
209
My results identical. I'm using 1.0.7.15 across the board. I just updated an old phone that for whatever reason was still on 1.04.x to 1.0.7.81 - and so far I haven't heard complaints. I'm really hoping it gets straightened out. I don't know why BLF seems to be such an issue with these companies (I've seen it on yealink too) - its like if they miss that packet, you're screwed. Why don't they just recheck every minute to confirm they are in the right state.
BLF Issues with 1.0.7.81. Seems to be really bad if there is an invalid account on the phone, but never seems quite right at any time. The 1.0.7.78 beta seems OK for my use, but I still haven't moved past .15 for general use.
 
  • Like
Reactions: krzykat

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,083
Reaction score
2,602
FYI: As of noon today, Opus codec and Asterisk 13.12.1 are included in latest Incredible PBX installers for CentOS and Ubuntu as well as with new Incredible PBX ISO installs. Just download the latest installer of your choice or perform new ISO install.

NOTE: No new ISO download is required! The ISO downloads and runs the latest Incredible PBX installer automatically.

 
Last edited:
  • Like
Reactions: markieb

TirsoJRP

Member
Joined
Jan 8, 2015
Messages
85
Reaction score
30
Is it possible to install on the Rpi2?
 
Last edited:

miguel

Member
Joined
May 22, 2013
Messages
276
Reaction score
8
I jusr installed the gold standard and it says it has opus, i tried to used it and I could not dial, anything that I a missing? DO i have to recompile asterisk and select it on makemenu?

I am waitng for your response.

thanks you
 
Last edited:

progs_00

Member
Joined
Jan 6, 2014
Messages
93
Reaction score
24
Hi Miguel

I don't believe there is any need for you to recompile asterisk since you've installed the brand new version with opus support included.
The first thing that comes in mind is your endpoint. Does it support all opus formats or does it have partial support? Check and let me know

Bye
 

Members online

No members online now.

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,320
Messages
137,026
Members
14,550
Latest member
treimers