API Settings on PBX

Before establishing a connection between the application server and PBX, you need to enable API feature and configure relevant settings on PBX web interface.

API - basic settings

Before using API feature, you need to enable API and configure basic settings.

Log in the PBX web interface, go to Settings > PBX > General > API, enable API and configure relevant settings.

  • Enabled: Whether to enable API feature or not.
  • Report Method: Select the protocol which is used to sending events. For details of the two report methods, refer to API Events.
    • HTTP: PBX sends HTTP events by short-live TCP flows.
    • TCP: PBX sends TCP events by keep-alive TCP flows.
  • Username: User-defined name.
  • Password: User-defined password.
    Note: The username and password are the credentials for the application server to connect to PBX.
    • In the request of Get API token, the password is a 32-digit lowercase string, encrypted by MD5 (Message-Digest Algorithm).
    • In the TCP login data, the password is a clear-text password.

API - advanced settings

If you want to monitor the status of extensions and trunks, or control inbound calls from external numbers, you need to check relevant options in Advanced Settings.

Log in the PBX web interface, and go to Settings > PBX > General > API, edit API advanced settings.

Extension
Whether to monitor extension status or not.
When the extension status changes (e.g. extension status is changed from busy to idle), PBX sends ExtensionStatus event to the application server.
Trunk
Whether to control inbound calls from the selected trunks, or monitor call status on the selected trunks or not.
  • Control Inbound Call Accepting: After enabled, PBX will send Invite events to the application server when receiving an inbound call through the trunk. The application server has 10 seconds to decide whether to answer the call or not.
    Note: If no response from the application server within 10 seconds, PBX will accept and route the call to the destination of originated inbound route.
    • Accept: The application server calls call/accept_inbound to accept the call.

      The call will be routed to the destination of originated inbound route.

    • Reject: The application server calls call/refuse_inbound to reject the call.

      The call will be ended and will not reach PBX. PBX will not generate any CDR.

  • Control Inbound Call Destination: After enabled, PBX will sendIncoming events to the application server when an inbound call through the trunk is accepted. The application server has 10 seconds to control destination of the inbound call.
    Note:
    • The application server calls call/transfer to control the destination of the inbound call.
    • If no response from the application server within 10 seconds, PBX will route the call to the destination of the originated inbound route.
  • Status Monitor: After enabled, PBX will send a CallStatus report of the trunk to the application server.

Delete blocked API IP

If an IP address fails to log in the PBX by calling Get API token for too many times in a short time, PBX will block and classify the IP address as "API-IP".

If the IP address is a trusted IP address, you can delete it from the Blocked IP Address list.

  1. Go to PBX > System > Security > IP Auto Defense > Blocked IP address to check the blocked IP address.

  2. Select an IP address, and click .