[Home]

Summary:ASTERISK-27475: codec_opus requires libcurl
Reporter:Samuel For (samfun)Labels:
Date Opened:2017-12-11 08:44:34.000-0600Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Codecs/codec_opus
Versions:14.7.3 15.1.3 16.15.0 18.1.0 Frequency of
Occurrence
Related
Issues:
Environment:Ubuntu 16.04, Ubuntu 18.04 LTS and Ubuntu 20.04 LTS (tested: Desktop, the so-called Minimal Installation) on default.Attachments:
Description:If libcurl is not present on the platform when building Asterisk everything will still build and codec_opus will be downloaded however there will be not translation path available for Opus.

Reason is that Opus requires libcurl. Once libcurl is installed then Opus will show up in the translation path.

Probably should be documented or stated as a requirement next to xmlstarlet in the menuselect options.
Comments:By: Asterisk Team (asteriskteam) 2017-12-11 08:44:35.271-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Friendly Automation (friendly-automation) 2017-12-11 12:23:23.186-0600

Change 7506 merged by Jenkins2:
codec_opus: Make libcurl a dependency in menuselect

[https://gerrit.asterisk.org/7506|https://gerrit.asterisk.org/7506]

By: Friendly Automation (friendly-automation) 2017-12-11 12:42:03.431-0600

Change 7504 merged by Jenkins2:
codec_opus: Make libcurl a dependency in menuselect

[https://gerrit.asterisk.org/7504|https://gerrit.asterisk.org/7504]

By: Friendly Automation (friendly-automation) 2017-12-11 13:07:45.491-0600

Change 7505 merged by George Joseph:
codec_opus: Make libcurl a dependency in menuselect

[https://gerrit.asterisk.org/7505|https://gerrit.asterisk.org/7505]

By: Alexander Traud (traud) 2018-01-05 04:22:59.413-0600

[~samfun], good catch! When one goes for {{ldd /usr/lib/asterisk/modules/codec_opus.so}}, you see the dependencies. This issue got missed because {{libcurl}} is installed as default on many Linux distributions, even on your Ubuntu 16.04 LTS for Desktops.

Currently, the fix was to add ‘curl’ as dependency in {{make menuselect}}. However in the {{./configure}} script of Asterisk, that ‘curl’ is not just the shared library (.so) but also the header files and a tool called {{curl-config}}. Furthermore, {{libcurl-dev}} is a virtual package in Debian/Ubuntu. Consequently to get transcoding for the Opus Codec, one to go for

{{sudo apt install libcurl4-openssl-dev}}

with the upcoming Asterisk 13.19 and Asterisk 15.2. Moreover in Ubuntu 14.04 LTS, that packages requires/installs several other packages, enabling many features in Asterisk as side effect (like SIP-over-TLS, LDAP, …).

Therefore: Could the Digium team double-check whether {{curl}} is really required? Alternatively, the build system should be enhanced to look not for the headers but just for the shared library of curl. I do not have the resources to do that change right now, especially because I do not use the Opus Codec module of Digium personally. Just a suggestion, because this change here is going to create unforeseen support requests.

By: Sean Bright (seanbright) 2018-01-08 09:29:38.487-0600

[~traud], without the {{-dev}} package, we don't have a way to determine if {{libcurl}} is installed or not on the target machine. The curl dependency is a requirement for Digium's codec_opus which I do not see changing (but that is above my pay grade). The only other way I can think of is to try and {{dlopen}} libcurl in menuselect (which is a big hack and ugly).

By: Alexander Traud (traud) 2018-01-09 01:31:07.800-0600

I understood that the {{-dev}} package is required now. Nevertheless, it took me 20 minutes to find the cause and to find that package in my Linux distribution. If I have so much trouble, others might have too. Furthermore while analyzing this, I found 16 other issues in Asterisk, for example
- the {{install_prereq}} script was wrong,
- the now build module {{res/res_curl.c}} printed an error message, and
- (when you do not have [newt|https://packages.ubuntu.com/bionic/libnewt-dev] but only [ncurses|https://packages.ubuntu.com/bionic/libncurses5-dev]) menuselect does not show this new dependency at all (string too long).

Long story short: The current resolution for this issue asks for _too_ much and I fear too many novice/existing users are not able to resolve this new dependency themselves. Although your contribution is appreciated, personally I would not release Asterisk with the current change, rather undo that change, and wait until a better solution is found.

By: Alexander Traud (traud) 2018-05-16 04:03:07.899-0500

Can someone re-open this report and update the version numbers? Sean reverted the change (thanks for that) and the change did not made it into an Asterisk release. After fixing a lot of issues in the build system, I still do not have an approach for this either. AC_LINK_IFELSE sounds promising, but I have not tested it, yet. Until then, another approach would be at least to update the comment/info for opus_codec in Menuselect.

bq. This issue got missed because libcurl is installed as default on many Linux distributions, even on your Ubuntu 16.04 LTS for Desktops.

Since Ubuntu 18.04 LTS, a minimal installation option exists. With that libcurl is not installed on default. One has to go for{code}sudo apt install libcurl4{code}

By: Alexander Traud (traud) 2020-11-30 03:59:47.932-0600

I am not allowed to edit the description. Can the original reporter or an Asterisk Team member do so?
* The issue severity is not Trivial but Minor.
* The issue still happens with version Asterisk 16.5 and Asterisk 18.1.
* The issue happens in the environments Ubuntu 18.04 LTS and Ubuntu 20.04 LTS (tested: Desktop, the so-called Minimal Installation) *on default*.

Another idea of tackling this: menuselect already requires apps like ‘xmlstarlet’ and ‘bash’. What about adding not the development headers but the app ‘curl’? Again this would be broader than needed. However, that package would install libcurl but not any development headers/tools. There is one drawback: ‘curl’ exists already for ‘libcurl-dev’. In Asterisk, one would have to create something like PBX_CURL_RUNTIME. That hack would be visible to the user because menuselect then displays not the requirement ‘curl’ but ‘curl_runtime’. What about that approach?