Repository navigation
NethVoice: codec lists per device type with Opus, G.722 and H.264, video calls to desk phones #8243
Description
Every NethVoice device is created with the same codec list (ulaw,alaw,gsm,g726,vp8), so WebRTC, NethLink and mobile app calls run in narrowband G.711 although the clients offer Opus, and video is dropped whenever a browser (VP8) talks to a desk phone or an intercom (H.264), since Asterisk does not transcode video. The purpose is to give each device the best audio it supports while keeping phones and trunks compatible, and to make video calls work with desk video phones.
Proposed solution
Codec lists per device type, applied when a device is associated and migrated on update:
- WebRTC, NethLink, mobile app:
opus,g722,ulaw,alaw,h264,vp8 - physical and custom phones:
g722,ulaw,alaw,h264,vp8(G.722 first, so two phones that support it talk HD; phones without it fall back to G.711) - Asterisk SIP Settings (the FreePBX defaults used where no per-device list applies, e.g. trunks created from its GUI): audio
g722, ulaw, alaw, opus, videoh264, vp8, migrated on update and seeded on new installations (fix(codecs): drop GSM and G.726, align the global SIP codec defaults nethesis/ns8-nethvoice#1085)
Opus gets in-band FEC on the legs Asterisk transcodes (codecs.conf, packet_loss=10). Every device allows both H.264 and VP8, so browser↔browser, browser↔phone and phone↔phone video share a codec. Trunks are untouched: the per-provider defaults already list the codecs each provider supports.
Phone Island gains video: true on phone-island-call-start: the camera is offered in the first INVITE, because desk video phones such as the Yealink T58W refuse a video upgrade added later in the call.
Alternative solutions
Asterisk codec_prefs_* cannot be used: FreePBX Core does not render them. Changing only the phone provisioning templates has no effect, since Asterisk picks the first codec of the endpoint allow list the peer offers.
Additional context
Verified on NethVoice (Asterisk 22, Janus) with a Yealink T58W, a Fanvil V67 and the mobile app: Opus between softphones, G.722/Opus between phones and softphones, H.264 video browser↔browser, browser↔Yealink (in both directions with the Phone Island change) and Yealink↔mobile app. Inbound trunk calls stay G.711 end to end; outbound calls from Opus/G.722 devices are transcoded to G.711 by the PBX.
See also
- feat(freepbx): codec lists per device type with Opus, G.722 and H.264 nethesis/ns8-nethvoice#1051
- feat(call): start a call with the camera in the first INVITE nethesis/phone-island#295
- feat(operators): video call button in the operator drawer nethesis/nethvoice-cti#594
- feat(calls): video call action for operators with a video device nethlink#240
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTesting
Activity
feat(operators): video call button in the operator drawer
feat(freepbx): codec lists per device type with Opus, G.722 and H.264 (…
edospadoni commentedon Oct 21, 2026
Test
Release: https://github.com/nethesis/ns8-nethvoice/releases/tag/1.8.0-testing.26 or later (CTI v1.2.0, Phone Island 1.0.16; includes nethesis/ns8-nethvoice#1085, which drops GSM and G.726 and aligns the Asterisk SIP Settings codec lists)
NethLink builds (Windows, macOS x64/arm64, Linux): NethServer/nethlink#240 (comment)
Setup: NethVoice updated to 1.8.0-testing.3 from a previous release with devices already associated; operators A (CTI, Web phone as default device), B (desk video phone, e.g. Yealink T58W), C (desk phone without video, e.g. Snom or Fanvil audio model), D (NethVoice app), E (NethLink, builds above); a VoIP trunk for external calls. Codec lists are read with
pjsip show endpoint <ext>(allowline) and the codec of a running call withcore show channel <chan>(NativeFormats / ReadFormat / WriteFormat) fromasterisk -rin the freepbx container, or from the Phone Island call statistics.Test Case 1 - Codec lists after the update
ulaw,alaw,gsm,g726,vp8; after the update, with no manual reload: WebRTC, NethLink and mobile devices haveopus,g722,ulaw,alaw,h264,vp8, physical and custom phones haveg722,ulaw,alaw,h264,vp8/etc/asterisk/codecs.confhas the[opus]section withpacket_loss=10andfec=yes;core show codecslists opus and h264Test Case 2 - New devices
Test Case 3 - Audio between softphones
Test Case 4 - Audio with desk phones
*80<ext>) with the phones*43from each device typeTest Case 5 - Trunks
Test Case 6 - Video call between CTI users
Test Case 7 - Video call with a desk video phone
Test Case 8 - Video towards an audio-only phone
Test Case 9 - NethLink
Test Case 10 - NethVoice app
Test Case 11 - Regression
fix(codecs): drop GSM and G.726, align the global SIP codec defaults (#…