Skip to content

Integrate ElevenLabs trunk support into NethVoice #7892

Closed

Description

@andrea-marchionni

We would like to improve the ElevenLabs integration in NethVoice with the following enhancements:

  1. Add ElevenLabs trunk to configurable trunks via UI
    Currently, the ElevenLabs trunk is not available among the trunks that can be configured through the NethVoice web interface.
    Please add the ElevenLabs trunk to the list of trunks that can be managed from the UI, so it can be configured without manual intervention.

  2. Update transfer mode to also check the Trunk context when resolving the transfer context, since an extension using a modified dial string (e.g., PJSIP/TRUNK_NAME) can initiate a transfer.

  3. Documentation: internal extension dialing directly via trunk
    Add documentation explaining how to create an internal extension that dials directly through the ElevenLabs trunk.

Activity

  1. moved this from Todo to In Progress in NethVoiceon Feb 27, 2026
  2. added
    verifiedAll test cases were verified successfully
    on Mar 16, 2026
  3. moved this from In Progress to Verified in NethVoiceon Mar 16, 2026
  4. moved this from Verified to In Progress in NethVoiceon Mar 16, 2026
  5. removed
    verifiedAll test cases were verified successfully
    on Mar 16, 2026
  6. Amygos commented on Mar 16, 2026

    @Amygos
    Member

    Release nethesis/ns8-nethvoice 1.6.4

  7. moved this from In Progress to Done in NethVoiceon Mar 16, 2026
  8. 4 remaining items

  9. removed
    testingPackages are available from testing repositories
    on Jun 8, 2026
  10. moved this from Testing to In Progress in NethVoiceon Jun 8, 2026
  11. Stell0 commented on Jun 9, 2026

    @Stell0

    Requirements for Integration

    1. Create the ElevenLabs Trunk from the Wizard

    Create the trunk using the NethVoice trunk wizard and select the ElevenLabs provider.

    The wizard configures the required PJSIP parameters automatically, including:

    • inbound authentication
    • auth_username-based endpoint identification
    • ElevenLabs SIP server parameters
    • required PJSIP trunk settings

    2. Configure the ElevenLabs Trunk Credentials

    On the NethVoice side, configure:

    • Trunk Name: NOME_TRUNK
    • Trunk Password: SECRET_TRUNK
    • Outbound CallerID / Number: NUMERO_TRUNK

    On the ElevenLabs side, configure:

    • SIP Trunk Username: NOME_TRUNK
    • SIP Trunk Password: SECRET_TRUNK

    The SIP Trunk Username configured in ElevenLabs must match the NethVoice Trunk Name exactly.


    3. Inbound Call Authentication and Identification

    ElevenLabs inbound calls are authenticated using SIP digest authentication.

    NethVoice identifies the inbound trunk using the SIP Authorization username through the PJSIP auth_username identifier.

    Therefore:

    • no custom SIP header is required
    • no match_header rule is required
    • no manual PJSIP identify section is required
    • no endpoint identification order change to header is required

    The trunk is matched by the authentication username, not by a custom ElevenLabs header.


    4. Create an Extension for the AI

    Create an extension that calls the ElevenLabs trunk using the following dial string:

    PJSIP/NOME_TRUNK/sip:NUMERO_TRUNK@sip.rtc.elevenlabs.io
    

    Replace:

    • NOME_TRUNK with the NethVoice trunk name
    • NUMERO_TRUNK with the ElevenLabs destination number or SIP target

    5. Shared Parameters Between NethVoice and ElevenLabs

    The following parameters must match on both sides:

    • NOME_TRUNK
    • SECRET_TRUNK

    The following parameter is used by NethVoice for outbound calls:

    • NUMERO_TRUNK

    Header parameters are no longer required:

    • HEADER_NAME is not needed
    • HEADER_VALUE is not needed
  12. Stell0 commented on Jun 9, 2026

    @Stell0

    Test case 1 — ElevenLabs trunk inbound call with authentication

    Objective

    Verify that an ElevenLabs trunk created from the NethVoice wizard accepts inbound calls from ElevenLabs using inbound SIP digest authentication and auth_username endpoint identification.

    Preconditions

    • NethVoice updated with the ElevenLabs trunk wizard changes.
    • ElevenLabs account with SIP trunk support.
    • Public DNS, SIP proxy, and RTP routing correctly configured.
    • NethVoice Proxy is installed and working.
    • A reachable inbound route or test destination is available in NethVoice.

    Steps

    1. Open the NethVoice trunk wizard.

    2. Create a new trunk using provider ElevenLabs.

    3. Configure:

      • Trunk Name: elevenlabs-test
      • Trunk Password: <secure-password>
      • Inbound route destination: test extension, IVR, or echo/test destination
    4. Save and apply the configuration.

    5. On the ElevenLabs side, configure the SIP trunk:

      • SIP Trunk Username: elevenlabs-test
      • SIP Trunk Password: <secure-password>
    6. From ElevenLabs, place an inbound call to NethVoice.

    7. Check the Asterisk/PJSIP logs.

    Expected result

    • NethVoice challenges the inbound INVITE with SIP digest authentication.
    • ElevenLabs retries the INVITE with an Authorization header.
    • The Authorization username is elevenlabs-test.
    • Asterisk identifies the trunk using auth_username.
    • Authentication succeeds.
    • The call enters NethVoice and reaches the configured inbound route/destination.
    • No custom SIP header matching is required.
    • No manual match_header configuration is required.

    Negative check

    Repeat the inbound call with a wrong ElevenLabs SIP trunk password.

    Expected result:

    • SIP digest authentication fails.
    • The call is rejected.
    • The call does not enter the inbound route.

    Test case 2 — Unauthenticated trunk identified by header through NethVoice Proxy

    Objective

    Verify that a trunk without registration and without inbound authentication can be identified by SIP header when calls arrive through NethVoice Proxy.

    Preconditions

    • NethVoice updated with the trunk header-identification changes.
    • NethVoice Proxy version is >= 1.6.2-testing.2.
    • External SIP provider or SIP test tool able to send inbound INVITEs to NethVoice Proxy.
    • Provider/test client source IP is known.
    • Inbound route or test destination is available in NethVoice.

    Steps

    1. Verify the installed proxy version:

      api-cli run module-info --agent module/nethvoice-proxy1

      or use the NS8 UI/module status page.

    2. Confirm that NethVoice Proxy is version 1.6.2-testing.2 or newer.

    3. Create a PJSIP trunk with:

      • Registration: disabled
      • Inbound Authentication: disabled
      • Outbound Authentication: disabled or enabled, either is valid
      • Identification mode: header-based identify
      • Header used for identify: X-Forwarded-For
      • Header value: expected original source IP of the SIP provider/test client

      Example expected generated identify logic:

      [test-noauth-header]
      type=identify
      endpoint=test-noauth-header
      match_header=X-Forwarded-For: <provider_public_ip>
    4. Save and apply the configuration.

    5. From the external SIP provider or SIP test client, send an inbound INVITE to NethVoice through NethVoice Proxy.

    6. Check the SIP message received by Asterisk.

    7. Check that the forwarded INVITE contains:

      X-Forwarded-For: <provider_public_ip>
      
    8. Check Asterisk/PJSIP logs and call routing.

    Expected result

    • The call reaches NethVoice through NethVoice Proxy.
    • The source IP seen by Asterisk may be the proxy address.
    • Asterisk does not rely on the proxy source IP for trunk identification.
    • Asterisk identifies the trunk using the X-Forwarded-For header.
    • The inbound INVITE is associated with the configured unauthenticated trunk.
    • The call enters NethVoice and reaches the configured inbound route/destination.

    Negative checks

    Missing header

    Send the same INVITE without X-Forwarded-For.

    Expected result:

    • The trunk is not matched by header.
    • The call is rejected or does not reach the expected inbound route.

    Wrong header value

    Send the same INVITE with:

    X-Forwarded-For: <wrong_ip>
    

    Expected result:

    • The trunk is not matched.
    • The call is rejected or does not reach the expected inbound route.
  13. moved this from In Progress to Testing in NethVoiceon Jun 9, 2026
  14. added
    testingPackages are available from testing repositories
    on Jun 11, 2026
  15. added
    verifiedAll test cases were verified successfully
    and removed
    testingPackages are available from testing repositories
    on Jun 19, 2026
  16. moved this from Testing to In Progress in NethVoiceon Jun 19, 2026
  17. moved this from In Progress to Verified in NethVoiceon Jun 19, 2026
  18. Amygos commented on Jun 19, 2026

    @Amygos
    Member

    Release nethesis/ns8-nethvoice 1.6.12

  19. moved this from Verified to Done in NethVoiceon Jun 19, 2026
  20. removed
    verifiedAll test cases were verified successfully
    on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice project

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions