asterisk-modules does not replace asterisk-opus

Bug #2044135 reported by Bram Diederik
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
asterisk (Debian)
Fix Released
Unknown
asterisk (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
New
Low
Unassigned

Bug Description

I moved from debian old stable to ubuntu due to the lack of asterisk in debian bookworm.

I have home assistant with voice assistant with the voip integration. This requires opus.
asterisk-modules does not give all the possibilities asterisk-opus did.

Because asterisk opus on debian did add translation functionality to asterisk. (my phones dont support opus so i cant use it for everything) translation for opus is missing.

I fixed the issue running http://asterisktutorials.blogspot.com/2017/08/how-to-install-and-use-opus-codec-in.html

i did an apt-file search codec_opus.so and no package was found.

Can you guys make opus translation work with use of the packages

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: asterisk-modules 1:18.10.0~dfsg+~cs6.10.40431411-2
ProcVersionSignature: Ubuntu 5.15.0-89.99-generic 5.15.126
Uname: Linux 5.15.0-89-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
Date: Tue Nov 21 14:19:39 2023
InstallationDate: Installed on 2023-11-20 (1 days ago)
InstallationMedia: Ubuntu-Server 22.04.3 LTS "Jammy Jellyfish" - Release amd64 (20230810)
SourcePackage: asterisk
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bram Diederik (bram-diederik) wrote :
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Hi Bram,

Thanks for reporting this bug and help making Ubuntu better.

The asterisk-opus project was integrated in asterisk modules, as you already know.

asterisk-opus is still available in Ubuntu 20.04 (focal).

Are you describing a regression? Could you show us an use case supported in focal that is no longer supported in jammy (preferably, with a short reproducer so we can try it ourselves in fresh focal/jammy installations)?

I will mark this bug report as incomplete until you provide this additional information, once you do so, could you please set this bug status back to new?

Thank you!

Changed in asterisk (Ubuntu):
status: New → Incomplete
Revision history for this message
Bram Diederik (bram-diederik) wrote :

sure thing.
I'm coming from debian so if it worked in previous ubuntu version im not 100% sure. But the package did exist.

If all is set correctly `core show translation paths opus` will show the translation
` opus:48000 To ulaw:8000 : (opus@48000)->(slin@48000)->(slin@8000)->(ulaw@8000)`

Just install the module packages allows you to make opus 2 opus calls but no translation. (due to the missing of codec_opus.so or not correctly using the so files in the module package)

to reproduce the issue you need 2 pjsip accounts. One to allow ulaw and the other opus.
Connect them both to some softphone and let one call the other.

pjsip.conf
```
[101]
type=endpoint
context=users
disallow=all
allow=ulaw
auth=101
aors=101

[101]
type=auth
auth_type=userpass
password=ubuntu
username=101

[101]
type=aor
max_contacts=1
remove_existing=1

[102]
type=endpoint
context=users
disallow=all
allow=opus
auth=102
aors=102

[102]
type=auth
auth_type=userpass
password=ubuntu
username=102

[102]
type=aor
max_contacts=1
remove_existing=1
```

extentions.conf

;call 101
exten => 101,1,Dial(PJSIP/101)
exten => 101,n,Hangup()

;call 102
exten => 102,1,Dial(PJSIP/102)
exten => 102,n,Hangup()

Changed in asterisk (Ubuntu):
status: Incomplete → New
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Bram.

Here are my findings so far:

Running
$ core show translation paths opus
shows no translation paths for opus at all, neither in noble, nor in focal. The translation paths are also missing in Debian unstable.

The translation table from
$ core show translation
does not even have an entry for opus (again, this is true for foca, noble, and Debian unstable).

$ module show like opus
shows the following modules in noble and Debian unstable:
- format_ogg_opus_open_source.so
- res_format_attr_opus.so

However, in focal, only
- res_format_attr_opus.so

is loaded.

Then, when trying to load the missing module, we get:
> module load format_ogg_opus_open_source.so
Unable to load module format_ogg_opus_open_source.so
Command 'module load format_ogg_opus_open_source.so' failed.
[Nov 27 14:40:26] ERROR[2992]: loader.c:170 module_load_error: Error loading module 'format_ogg_opus_open_source.so': /usr/lib/asterisk/modules/format_ogg_opus_open_source.so: undefined symbol: op_pcm_tell

This only happens in focal. We should file a different bug to get this one fixed there.

A quick code inspection showed that there is one library missing: codec_opus_open_source.so

The upstream readme file, at https://github.com/traud/asterisk-opus or under Xopus/README.md in the source package says that "Opus is not only supported for pass-through but can be transcoded as well. This allows you to translate to/from other audio codecs [...] This can be achieved by enabling codec_opus via make menuselect".

Hence, adding codec_opus to ADDONS_ENABLE in debian/rules should be enough to generate the missing library. However, I see the following entry in debian/changelog:

* stop set obsolete menuselect option codec_opus_open_source

from version 1:16.23.0~dfsg+~2.10-1.

So, before just enabling the codec_opus option in debian/rules, it would be nice to understand why the codec_opus_open_source option was removed and not replaced by codec_opus in Debian.

Checking the asterisk Debian bugs, I found https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025165, which is related to this exact same bug and also proposes the fix mentioned above (we should check whether the codec internal name is codec_opus_open_source or just codec_opus though).

The next steps here would be to ping that bug in Debian to understand the question above and ideally get codec_opus enabled there (if there are no issues we are not aware of ATM). Since this package is in sync with debian, the change will be picked-up for the development version (currently noble).

Changed in asterisk (Ubuntu):
status: New → Triaged
Revision history for this message
Bram Diederik (bram-diederik) wrote :

Thank you.

Have you also checked its regression.
It worked in debian bullseye

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

I checked Ubuntu 20.04 (not a gregression there). I did not check Debian though. But if it worked, then we have a regression there (and possibly with some EOL Ubuntu series as well). We should probably check the state in jammy as well.

For now, I believe we should wait for context on the Debian changes I mentioned in the Debian bug. Then (or if we do not get a reply soon), we can proceed with applying the fixes here.

Changed in asterisk (Debian):
status: Unknown → New
Changed in asterisk (Debian):
status: New → Fix Released
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

This was fixed in Debian and is currently in noble-proposed (should migrate soon). The new package version is 1:20.5.1~dfsg+~cs6.13.40431414-1.

Bram, would you mind testing 1:20.5.1~dfsg+~cs6.13.40431414-1 in noble-proposed (or wait for it to migrate and test it in noble) so we can close this one?

Changed in asterisk (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Bram Diederik (bram-diederik) wrote :

Eumm. how do i get an noble test environment?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Bram,
sorry for the delay, but due to the Christmas shutdown there was not much interaction.

It now got into noble (no more just -proposed)

 asterisk | 1:20.5.2~dfsg+~cs6.13.40431414-1 | noble/universe | source, amd64, arm64, armhf, ppc64el, riscv64, s390x

> Eumm. how do i get an noble test environment?

If your home assistent setup is all software and has no need to access special bare metal phone HW then I'd say the quickest is getting a vm like:

$ lxc launch ubuntu-minimal-daily:noble noble --vm
(wait a few seconds)
$ lxc exec noble bash

Then set up your Software there and try it out.

You could also upgrade any existing test environment to noble (just change it in ), but then going back is hard and often even impossible - so only do that if you can easily redeploy the full environment.

Changed in asterisk (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I'm unsure if we can consider this a fix for also a backport, after all it is enabling new build options for more features. OTOH it was meant to be enabled but failed to be that way.

We'll need to discuss this for older releases.

tags: added: server-triage-discuss
Changed in asterisk (Ubuntu Jammy):
importance: Undecided → Low
tags: removed: server-triage-discuss
Revision history for this message
Bram Diederik (bram-diederik) wrote :

>$ lxc launch ubuntu-minimal-daily:noble noble --vm

Is this working on a debian machine. All my machines except asterisk are debian. I moved be uase debian droped asterisk support in stable.

I have kvm libvirt.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Hi Bram, the use of lxd was a suggestion of how to quickly test the software. You can pull the latest noble image and create a VM using whatever preferred method you want. We use lxd a lot which is why it is suggested.

I haven't tested running LXD on debian recently, but I'd imagine it should work fine. You can read more about it here on debian's wiki[0].

[0] - https://wiki.debian.org/LXD

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.