3CX icon

3CX

Interact with 3CX telephony system

Actions462

Overview

The "Create Trunk" operation in the "Trunks" resource allows users to create a new trunk configuration within the 3CX telephony system. A trunk is a communication channel that connects the PBX (Private Branch Exchange) to external telephone networks or service providers, enabling inbound and outbound calls.

This node is beneficial for automating the setup of telephony trunks, especially in environments where multiple trunks need to be managed programmatically or integrated into larger workflows. For example, telecom administrators can use this node to provision new SIP trunks dynamically based on demand or integrate with other systems to update trunk configurations automatically.

Practical examples include:

  • Automatically creating trunks when onboarding new clients or phone lines.
  • Updating trunk settings as part of a broader telephony management workflow.
  • Integrating trunk creation into CI/CD pipelines for telephony infrastructure.

Properties

Name Meaning
Auth ID Authentication identifier used for the trunk.
Auth Password Authentication password for the trunk, provided as JSON.
Certificate Certificate string associated with the trunk.
Certificate Name Name of the certificate used.
Configuration Issue Description or flag indicating any configuration issues.
Did Numbers List of Direct Inward Dialing numbers associated with the trunk, provided as JSON array.
Direction Call direction allowed on the trunk: None, Inbound, Outbound, or Both.
Disable Video Boolean flag to disable video calls on the trunk. Default is true (video disabled).
Diversion Header Boolean flag indicating if diversion headers are enabled. Default is true.
E 164 Country Code Country code in E.164 format for number processing.
E 164 Process Incoming Number Boolean flag to enable E.164 processing on incoming numbers. Default is true.
Emergency Geo Locations JSON array specifying emergency geographic locations related to the trunk.
Enable Inbound Calls Boolean flag to allow inbound calls. Default is true.
Enable Outbound Calls Boolean flag to allow outbound calls. Default is true.
External Number External phone number associated with the trunk.
Gateway JSON object defining gateway settings including codecs, inbound/outbound parameters, source identification, and variable choices.
Groups JSON array defining groups with rights and tags associated with the trunk.
Id Numeric identifier for the trunk.
In CID Formatting JSON array defining caller ID formatting rules for incoming calls.
IP Restriction IP restriction type: Any, IPV4, or IPV6. Default is Any.
Is Online Boolean flag indicating if the trunk is online. Default is true.
Messaging JSON object containing messaging-related settings.
Number Phone number assigned to the trunk.
Outbound Caller ID Caller ID used for outbound calls.
Out CID Formatting JSON array defining caller ID formatting rules for outbound calls.
Public Info Groups JSON array of public information groups associated with the trunk.
Public IP in SIP String representing the public IP address used in SIP signaling.
Publish Info Boolean flag to publish trunk information. Default is true.
Receive Extensions JSON array defining extensions that receive calls from this trunk, including membership and tags.
Receive Info Boolean flag to receive additional info. Default is true.
Remote My Phone URI Host String specifying remote phone URI host.
Remote PBX Prefix String prefix for remote PBX.
Routing Rules JSON array defining routing rules including holidays, office hours, out-of-office hours destinations, and trunk DN details.
Secondary Registrar String specifying secondary registrar address.
Separate Auth Id String for separate authentication ID if used.
Simultaneous Calls Number specifying how many simultaneous calls are allowed.
Tags JSON array of tags associated with the trunk.
Transcription Mode Option for transcription mode: Nothing, Voicemail, Recordings, Both, or Inherit. Default is Nothing.
Transport Restriction Transport protocol restriction: Any, UDP, TCP, or TLS. Default is Any.
Trunk Reg Times JSON array defining registration times for the trunk.
Tunnel Enabled Boolean flag to enable tunneling. Default is true.
Tunnel Remote Addr String specifying tunnel remote address.
Tunnel Remote Port Number specifying tunnel remote port.
Use Separate Auth Id Boolean flag indicating whether to use a separate authentication ID. Default is true.

Output

The node outputs the response from the 3CX API after creating the trunk. The output is structured as JSON data representing the newly created trunk's details, including all properties set during creation and any additional metadata returned by the API.

If the node supports binary data output, it would typically relate to certificates or other binary attachments, but based on the provided properties and code, the output is primarily JSON.

Dependencies

  • Requires an API key credential for authenticating with the 3CX telephony system.
  • The base URL for the 3CX server must be configured in the credentials.
  • The node sends HTTP requests to the 3CX API endpoint /xapi/v1.
  • Proper permissions on the 3CX system to create trunks are necessary.

Troubleshooting

  • Authentication errors: Ensure the API key credential is valid and has sufficient permissions.
  • Invalid JSON inputs: Properties like AuthPassword, DidNumbers, Gateway, and others expect JSON strings; invalid JSON will cause parsing errors.
  • Missing required fields: Some fields may be mandatory on the 3CX side; ensure all required properties are provided.
  • Network issues: Verify connectivity to the 3CX server URL.
  • API errors: Check the error message returned by the 3CX API for specific issues such as duplicate trunk IDs or invalid parameter values.

Links and References

Discussion