Retell with Asterisk AGI

Hello Retell Team,

We are integrating Retell with Asterisk AGI (Phase 2 – Production).

Workspace: PAK SAIBAAN
Billing: Pay-As-You-Go (Active)
Agents: Multi-State (Inbound & Outbound enabled)
Phone Number: +1 (201) 379-9352 (Telnyx)

Issue

All POST requests to create calls fail with:

HTTP 404 – Cannot POST /v1/create-phone-call


and also via /v2/create-phone-call.

This is confirmed via:

  • CURL

  • Asterisk AGI logs

  • Retell Community forum (multiple reports)

Request

Please enable PSTN / Phone Calls API at the workspace level for:

  • Outbound PSTN calls

  • AGI / API-initiated calls

This is currently blocking production, while all other components are verified working.

Architecture

Asterisk → AGI → Retell API
Telecom via Telnyx (US primary), Telecard local deferred.

Please confirm once PSTN permissions are enabled so we can retest immediately.

Regards,
PAK SAIBAAN Workspace


The 404 error you’re encountering is most commonly caused by an improperly configured phone number in your Retell AI account(1). The endpoint path itself appears correct (/v2/create-phone-call is the current endpoint), so the issue is likely with your phone number setup or payload structure(1).

Key Points to Verify

Phone Number Configuration: Your from_number (+1 (201) 379-9352) must be properly configured in Retell AI with an outbound_agent_id, or you need to use the override_agent_id parameter in your request(1).

Correct Payload Structure: Ensure you’re using the correct parameter names(1):

import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
});
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
});
console.log(phoneCallResponse.agent_id);

(1)

Use override_agent_id instead of agent_id, and retell_llm_dynamic_variables instead of custom_data(1):

{
  "from_number": "+16504144521",
  "to_number": "your_target_number",
  "override_agent_id": "agent_71724df7636716ceb3a7e244c8",
  "retell_llm_dynamic_variables": {
    "name": "Sarah"
  }
}

(1)

Phone Number Setup

If your Telnyx number isn’t properly imported into Retell AI, you’ll need to configure it(1). To update an existing phone number for outbound calls(1):

const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
 inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
 nickname: 'Frontdesk Number',

(1)

Verify that your phone number has been purchased/imported and configured through Retell AI—you cannot use arbitrary numbers for the from_number parameter(1).

For further assistance with workspace-level permissions or Telnyx integration specifics, visit Contact Sales, ask questions on Discord, or visit https://github.com/RetellAI/.

Hello @paksaaibaan
Please share the request you are making that gives you 404

and share your org id

org_ht8FyON99nTaQfQ0

The workspace ID org_ht8FyON99nTaQfQ0 appears to be a Retell AI workspace identifier.(1)

You can find your workspace ID in your workspace settings page.(1) To access it:

  1. Navigate to the system settings page and access your workspace settings(1)
  2. Retrieve the workspace id from the settings interface(1)

The workspace ID (also referred to as org ID) is sometimes requested when debugging issues related to your account.(1)

Hello,

Yes, that is correct.

The workspace ID (organization ID) for our account is:
org_ht8FyON99nTaQfQ0

It was retrieved from System Settings → Workspace Settings.
Please let me know if you also need the specific request or endpoint that is returning the 404 error.

Thanks.

Hello Team,

Thank you for your response.

Below are the details you requested regarding the 404 error we are receiving from Retell during live call execution.

Environment

  • Platform: Asterisk 20 (Ubuntu)

  • Integration Method: AGI (Python)

  • Call Source: SIP trunk (Telecard IP-based inbound)

  • AGI Script: retell_agi.py (executed successfully)

Organization ID

  • Org ID: {{org_ht8FyON99nTaQfQ0}}

Request Being Made
The AGI script is making the following HTTP request to Retell when a live call is received:

  • Method: POST

  • URL: {{PASTE_EXACT_RETELL_API_ENDPOINT_HERE}}

  • Headers:

    • Authorization: Bearer {{key_aafbcc17fa50dedacee698a98ade}}

    • Content-Type: application/json

  • Agent ID Used:

    • agent_53ac0299272f67398d07e2242b

Observed Behavior

  • The AGI script executes correctly.

  • The HTTP request is sent during an active inbound call.

  • Retell responds with HTTP 404 (HTML response).

  • The call then exits AGI and hangs up cleanly on Asterisk.

Request
Kindly confirm:

  1. Whether the endpoint URL being used is correct for live call handling.

  2. Whether this agent ID is valid and active for our organization.

  3. If any additional parameters or a different endpoint is required for SIP / Asterisk AGI integrations.

We are happy to share sanitized request payloads or logs if required.

Looking forward to your guidance.

Best regards,
paksaaibaan

Hello Retell Team,

We are actively deploying a hybrid PSTN architecture using Telecard (local DID) and Asterisk.

Our current blocker is that inbound and outbound PSTN calls are not functioning because the Phone Calls / PSTN API does not appear to be enabled at the workspace level.

We confirm:

  • Correct endpoint in use: /v2/create-phone-call

  • API key is valid

  • Agent is active

  • Telecard & Telnyx numbers are available and routable

  • Asterisk SIP and dialplan are stable

Request:
Please enable PSTN / Phone Calls API (Call Sessions) for our workspace so that:

  1. Inbound calls from Telecard via Asterisk can reach the Retell agent

  2. Outbound calls can use our local Telecard number as caller ID

Workspace: PAK SAAIBAAN
Plan: Pay-As-You-Go (ready to upgrade if required)

We are blocked only due to this enablement.

Best regards,
paksaaibaan

Hello @paksaaibaan
I need the exact request that is returning 404 for you, and also remove your API key from the response. This is a public channel.

Hello Team,

Thank you for the response. I’d like to clarify and correct one point and share updated findings after reviewing the call logs.

Hello Team,

Thank you for the response. I’d like to clarify and correct one point and share updated findings after reviewing the call logs.


🔄 Correction

We have tested outbound calls to multiple different international numbers (US and other regions as well), and the issue is not limited to a single country.


📞 Observed Behavior (From Call History)

From the Retell dashboard Call History:

  • Outbound calls are being initiated successfully

  • Calls appear with:

    • Direction: outbound

    • Session Status: ended / not_connected

    • End Reason: dial no answer or user hangup

  • No successful outbound call has connected to the destination number so far

Inbound calls, however, are working correctly and reach the assigned agent without issue.


🧪 Example API Test Used (Key Removed)

curl -i https://api.retellai.com/v2/create-phone-call \
  -H "Authorization: Bearer <REDACTED>" \
  -H "Content-Type: application/json" \
  -d '{
    "from_number": "+12013799352",
    "to_number": "+1XXXXXXXXXX"
  }'

The request is accepted and logged, but the call does not connect successfully.


🔍 Workspace & Number Configuration

  • Workspace: PAK SAAIBAAN

  • Plan: Pay As You Go

  • Phone Number: +1 (201) 379-9352 (Telnyx – visible in Retell dashboard)

  • Inbound Call Agent: Assigned

  • Outbound Call Agent: Assigned

  • Allowed Outbound Countries: All countries allowed

Despite this, outbound calls consistently fail to connect.


❓ Clarification Needed

Could you please confirm:

  1. Whether outbound calling is fully enabled for Pay-As-You-Go workspaces using Telnyx-backed numbers.

  2. If any additional enablement, verification, or plan upgrade is required for outbound PSTN calls to connect.

  3. Whether the “dial no answer / not connected” outcome indicates a provider-level block or a workspace-level restriction.


Inbound calling is stable on our side; outbound connectivity is the only remaining blocker before we proceed further.

Looking forward to your guidance.

Best regards,
paksaaibaan