Hi Lonnie,

Thank you for your quick, and very accurate response!
This was everything I needed. I can hear the beep of Home Assistant, and after 
I say something, it happily announces, that he couldn't understand that :)
(this is most likely a voice recognition issue, I didn't finished configuring 
that yet)
So thank you very much again!

I'm planning to create a tutorial about how to get Home Assistant working with 
older cisco phones for voice control.
Can I use your description for this purpose? If so, then do you have a contact 
information you would like to be used in the attribution?

Sándor
________________________________________
Feladó: Lonnie Abelbeck <li...@lonnie.abelbeck.com>
Elküldve: 2023. június 28., szerda 22:27
Címzett: AstLinux Users Mailing List
Tárgy: Re: [Astlinux-users] Opus codec for home assitant

Hi Sándor,

Thanks for giving AstLinux a spin.

First, answer your Status page question.  Asterisk supports either the older 
chan_sip or newer chan_pjsip SIP drivers.  Asterisk 18's default config only 
loads chan_pjsip and not chan_sip, so the 'sip show registry' and 'sip show 
peers' CLI commands are not supported by chan_pjsip.  The web interface Prefs 
tab can be used to uncheck "Show SIP Trunk Registrations" and "Show SIP Peer 
Status" if you decide to not use chan_sip.

AstLinux does not include the OPUS CODEC as part of the standard build.  Two 
reasons...

1) While it may seem the OPUS CODEC is free to use [1], patent issues may still 
exist.  Perform proper due diligence.

2) Asterisk/Digium/Sangoma have built in a "Usage Tracking" feature [2].  Both 
codec_opus.so and format_ogg_opus.so modules are linked with libcurl.so to 
provide the "Usage Tracking" feature.


OK, with that out of the way, I took your challenge to add the OPUS CODEC to 
AstLinux.  I used Asterisk 18 as you did.  Proceeded to install in a VM.
=-=-=

== First, in order to write to /usr/lib/asterisk/modules/ you must set an 
advanced configuration option.  Using the web interface:
Network tab -> Advanced Configuration -> User System Variables: { Edit User 
Variables }

add the line...

ASTERISK_RW_MODULES_DIR="yes"

click { Save Changes } followed by clicking  { Reload/Restart } [ Apply 
user.conf variables ] - x Confirm

== Using the AstLinux CLI, restart asterisk

pbx ~ # service asterisk stop
Stopping Asterisk...
pbx ~ # service asterisk init
Starting Asterisk...

== Now download and add the codec_opus modules from Digium.

pbx ~ # mkdir /mnt/kd/opus

pbx ~ # cd /mnt/kd/opus

pbx opus # curl -O 
https://downloads.digium.com/pub/telephony/codec_opus/asterisk-18.0/x86-64/codec_opus-18.0_1.3.0-x86_64.tar.gz

pbx opus # tar xzvf codec_opus-18.0_1.3.0-x86_64.tar.gz

pbx opus # cd codec_opus-18.0_1.3.0-x86_64

pbx codec_opus-18.0_1.3.0-x86_64 # cp *_opus.so /usr/lib/asterisk/modules/

== The codec_opus_config-en_US.xml file needs to be copied (AstLinux specific 
location)

pbx codec_opus-18.0_1.3.0-x86_64 # cp codec_opus_config-en_US.xml 
/stat/var/lib/asterisk/documentation/thirdparty/

== As a quick sanity check, use the AstLinux "show-union" command, it should 
look like...

pbx codec_opus-18.0_1.3.0-x86_64 # show-union
/mnt/asturw/usr/lib/asterisk/modules/codec_opus.so
/mnt/asturw/usr/lib/asterisk/modules/format_ogg_opus.so
/mnt/asturw/etc/shadow-
/mnt/asturw/etc/passwd
/mnt/asturw/etc/passwd-
/mnt/asturw/etc/shadow
/mnt/asturw/stat/var/lib/asterisk/documentation/thirdparty/codec_opus_config-en_US.xml
/mnt/asturw/stat/var/www/admin/.htpasswd

== Finally, restart asterisk to use the new modules

pbx codec_opus-18.0_1.3.0-x86_64 # service asterisk stop
Stopping Asterisk...
pbx codec_opus-18.0_1.3.0-x86_64 # service asterisk init
Starting Asterisk...

=-=-=

I hope this gets you started.

Be aware that there is some Asterisk knowledge required to perform the CODEC 
translation task you desire.

Lonnie


[1] https://opus-codec.org/license/

[2] Opus Software Codec for Asterisk README: "Usage Tracking" The codec_opus 
module will periodically attempt to send usage statistics to an Asterisk 
community server. The statistics are sent at most every 24 hours.




> On Jun 28, 2023, at 9:39 AM, Sándor Balázs <baluso...@hotmail.com> wrote:
>
> I have some older cisco phones with SIP and alaw/ulaw support. And I want to 
> connect to home assistant.
> The direct IP call thing failed for some reason and not knowing what the 
> reason might be, I turned to asterisk. I didn't want to install linux for 
> this... but of course this thing is linux only...
> So I happily found this project, and got my VM working in a few minutes. 
> astlinux-1.5.0 x86_64 - Asterisk 18.16.0
>
> I want to note here, that on the Status page these messages appear instead of 
> the content of the div...
> SIP Trunk Registrations: No such command 'sip show registry' (type 'core show 
> help sip show' for other possible commands)
> SIP Peer Status: No such command 'sip show peers' (type 'core show help sip 
> show' for other possible commands)
>
> So after some experimenting I noticed, that microsip can only communicate 
> with home assistant only if the opus codec is enabled.
> so home assitant supposedly uses opus. My phones do not support opus, and 
> there is no way I can get CISCO to create a firmware that does.
>
> So of course I googled it. And asterisk can translate between codecs. I found 
> a maillist thread that said, that version 13 is the first version containing 
> OPUS. I use version 18 so it's not a problem. Itried to enable it in 
> astlinux, but after a few attempts I came to the conclusion, that I might 
> miss the "codec_opus.so" in "/usr/lib/asterisk/modules/".
> Firstly it said, that it is read only... so I remounted it as read-write but 
> then it complains about not enought space, as it is 100% utilised...
>
> So my question is:
> Where can I download the version that contains support for opus?
> If for some reason there isn't any, then how can I manually add it without 
> recompiling the whole thing? (I do not want to use linux after all)



_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.


_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to