Skip to content

NethVoice: codec lists per device type with Opus, G.722 and H.264, video calls to desk phones #8243

Description

@edospadoni

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, video h264, 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

Activity

  1. added this to the NethVoice 1.8 milestone on Oct 16, 2026
  2. self-assigned this
    on Oct 16, 2026
  3. added
    nethvoiceBug or features releted to the NethVoice project
    nethvoice-ctiThe issue is related to NethLink (NethVoice Web client)
    on Oct 16, 2026
  4. edospadoni commented on Oct 21, 2026

    @edospadoni
    MemberAuthor

    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> (allow line) and the codec of a running call with core show channel <chan> (NativeFormats / ReadFormat / WriteFormat) from asterisk -r in the freepbx container, or from the Phone Island call statistics.

    Test Case 1 - Codec lists after the update

    • Before the update every device has ulaw,alaw,gsm,g726,vp8; after the update, with no manual reload: WebRTC, NethLink and mobile devices have opus,g722,ulaw,alaw,h264,vp8, physical and custom phones have g722,ulaw,alaw,h264,vp8
    • FreePBX admin, Settings > Asterisk SIP Settings: Audio Codecs enabled are g722, ulaw, alaw, opus in this order and nothing else; Video Support enabled, Video Codecs h264 then vp8; same result on a system where the lists were different before the update (e.g. opus, gsm and g726 enabled, g722 disabled) and on a new installation
    • /etc/asterisk/codecs.conf has the [opus] section with packet_loss=10 and fec=yes; core show codecs lists opus and h264
    • A codec list edited by hand on a device is overwritten by the update (expected)
    • Restore of a backup taken with the previous release, then update: the lists are migrated as above

    Test Case 2 - New devices

    • Associate a new Web phone, NethLink, mobile app and physical phone to users: each gets the list of its type
    • Change the device of a user (e.g. from a physical phone to a Web phone and back): the list follows the type
    • Custom device and GS Wave get the phone list
    • Phone provisioning (Tancredi) is unchanged: the phone registers and calls as before

    Test Case 3 - Audio between softphones

    • A (CTI) calls E (NethLink) and D (app): both legs in Opus, audio clear in both directions
    • A calls A on a second browser (Chrome, Firefox, Safari, Edge): Opus
    • Hold/resume, attended and blind transfer, conference, call recording and voicemail work in an Opus call

    Test Case 4 - Audio with desk phones

    • B calls C and C calls B: with two G.722 phones the call is in G.722 (HD) on both legs, no transcoding
    • B calls A and A calls B: phone leg G.722, browser leg Opus, Asterisk transcodes; audio clear both ways
    • A phone without G.722 (or with G.722 disabled in its codec settings) falls back to G.711 automatically, the call connects
    • DTMF, hold, transfer, pickup and intercom/paging (*80<ext>) with the phones
    • Echo test *43 from each device type

    Test Case 5 - Trunks

    • Outbound calls from A (Opus), B (G.722) and D (app) through the trunk: the trunk leg keeps the provider codecs (G.711), the call connects and audio is fine
    • Inbound calls from outside to A, B, C and D
    • The trunk codec list in the wizard (VoIP provider defaults) is unchanged
    • If available: fax through an ATA/trunk unaffected

    Test Case 6 - Video call between CTI users

    • Operator drawer: the Video call button is shown only when the current user has the Web phone as default device and the operator has a device that can receive video (Web phone, NethLink, mobile app, known desk video phone); hidden for operators with an audio-only desk phone
    • A (first browser) video-calls A (second browser) from the drawer: the call starts with the camera on; the callee answers with the camera off and can enable it; H.264 in both directions
    • Camera on/off, side view and full screen during the call; mute still works
    • Audio-only call between two browsers, then video enabled mid-call: still works as before
    • Light and dark theme, IT and EN: button text, icon and alignment with Call and Open chat

    Test Case 7 - Video call with a desk video phone

    • A video-calls B (Yealink T58W): B rings with video, after the answer the phone shows A's camera and the CTI shows the phone camera (720p)
    • Audio-only call from A to B, then video enabled mid-call: the phone refuses the upgrade (expected) and the call stays in audio without dropping
    • B calls A: the CTI receives the phone video; A can enable the camera
    • B calls D (app) and D calls B: video in both directions

    Test Case 8 - Video towards an audio-only phone

    • Video call from A to C: the call connects in audio only within a second, no drop, A's camera is released (camera LED off, Phone Island back to the audio view)

    Test Case 9 - NethLink

    • Operator rows: the video call icon appears only when the NethLink account has NethLink or Web phone as default device and the operator has a video-capable device
    • Click on the icon: the call starts with the camera on from the first INVITE (check with B's phone and with A in the CTI)
    • The standard call icon and the call flow are unchanged; receiving a video call works
    • Windows, macOS (x64 and arm64), Linux builds

    Test Case 10 - NethVoice app

    • D calls A and E: Opus audio; D receives video from B and from A
    • D video-calls B: video in both directions

    Test Case 11 - Regression

    • Queue calls, IVR, call groups and ring-all between all device types
    • Call recording playback and voicemail messages from Opus and G.722 calls
    • Several concurrent transcoded calls (phones ↔ softphones): server CPU stays acceptable, no audio artifacts
    • Backup and restore, clone module: codec lists preserved
  5. added
    testingPackages are available from testing repositories
    on Oct 21, 2026
  6. moved this from Todo to Testing in NethVoiceon Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

nethvoiceBug or features releted to the NethVoice projectnethvoice-ctiThe issue is related to NethLink (NethVoice Web client)testingPackages are available from testing repositories

Projects

  • Status
    Testing

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions