Repository navigation
Description
Since NethVoice 1.8 the softphone devices (web client, NethLink, mobile app) use the Opus audio codec first. When the provider line (trunk) does not support Opus, every external call is converted between two codecs by the PBX, and the conversion to and from Opus is expensive: on a busy instance it takes about three times the processor time per call of the previous G.711 setup, and under load the audio becomes choppy. Today there is no supported way to choose a different codec list for the softphones of one instance: a list changed by hand is replaced with the default one at every module update, and every new softphone device gets the default list again.
The purpose is to let an administrator keep a lighter codec on the softphones of an instance that needs it, for example a call center with many concurrent calls on a G.729 or G.711 provider line, without losing the choice at the next update.
Proposed solution
A setting of the instance for the list of audio and video codecs of softphone devices. When it is set, it is used for new softphone devices and it is kept by module updates, restores and imports. When it is not set, nothing changes: the default list with Opus first stays as it is today.
Alternative solutions
- Leave values changed by hand untouched during updates. It keeps the choice on existing devices, but new devices still get the default list.
- Change the default list for everybody. It gives up the better audio quality and network tolerance of Opus also where the load is not a problem.
- Lower the Opus encoding effort (complexity) on the PBX. Its effect on the processor load and on quality has not been measured.
Additional context
Measured on a test instance with NethVoice 1.8.7, 10 concurrent calls: G.729 on the provider line and G.711 on the extension take about 2.6% of a processor core per call, G.729 and Opus about 7.9%.
On Asterisk 22 putting G.711 first in a list that still contains Opus is not enough: the codec used is the first one in the order of the side that starts the call, so a softphone that offers Opus first still gets Opus. The list has to contain only the wanted audio codec.
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTesting
Activity
feat: set the softphone codecs of an instance (#1429)
edospadoni commentedon Dec 4, 2026
Test
PRs: nethesis/ns8-nethvoice#1429 (docs: NethServer/nethvoice-docs#114)
Setup: a NethVoice instance updated to the testing release below, with web client, NethLink, mobile app and physical phone devices, and a provider line (trunk). The setting has no user interface yet, it is changed from the node shell with
api-cli.Test Case 1 - Set the softphone codecs
api-cli run module/nethvoiceX/set-softphone-codecs --data '{"softphone_codecs": "alaw,h264,vp8"}': the action ends without errors and the call stays upalaw,h264,vp8(asterisk -rx "pjsip show endpoint <extension>"inside the freepbx container, lineallow)asterisk -rx "core show channels verbose"orcore show channel <name>)Test Case 2 - New devices and updates keep the setting
alaw,h264,vp8alaw,h264,vp8Test Case 3 - Back to the default
--data '{"softphone_codecs": ""}': softphone devices go back toopus,g722,ulaw,alaw,h264,vp8, also the ones created afterwardsTest Case 4 - Invalid values are refused
--data '{"softphone_codecs": "g729"}', an unknown codec name, or a list without an audio codec (h264,vp8): the action fails on validation and the device lists do not changeTesting release: 1.8.8-testing.53 (nethesis/ns8-nethvoice#1429)