Integrating with Web Based CRM via the HTTP API

Important Note: HTTP API is available in 3CX Phone System V12 and 12.5 only.

3CX Phone System also provides the facility to control extension operations via an HTTP API that is simple to use, and therefore ideal for simple integration into a web-based custom application.

Note: By default this functionality is only made available to IP Addresses in the Private IP Address space (127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) for security reasons. Please be aware of the risks of adjusting your Web Server’s access restrictions.

The functions available are:

  • Make a call from an Extension to any number (may be internal or external)
  • Disable an Extension
  • Enable an Extension
  • Disable External Calls for an Extension
  • Enable External Calls for an Extension
  • Disable Call Recording for an Extension
  • Enable Call Recording for an Extension

Each of the functions requires an HTTP post with a particular format. These examples will require the items in column 1 to be changed, as follows:

<pbx> IP ADDRESS OR FQDN OF 3CX PHONE SYSTEM MACHINE
<ext> EXTENSION NUMBER example 100
<destination> DESTINATION NUMBER TO DIAL
<ext_pin> V12 – THE EXTENSION SIP PASSWORD
V11 – THE EXTENSION VOICEMAIL PIN NUMBER
<pbxpass> THE 3CX PHONE SYSTEM MANAGEMENT CONSOLE PASSWORD

Note: HTTP API requests will only work from internal / local IP Addresses. External requests are blocked.

Make Call
http://<pbx>:5000/ivr/PbxAPI.aspx?func=make_call&from=<ext>&to=<dest>&pin=<ext_pin>


Disable Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&disable=1


Enable Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&disable=0


Disable External Calls for an Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&disable_external=1


Enable External Calls for an Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&disable_external=0


Disable Call Recording for an Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&record_calls=0


Enable Call Recording for an Extension

http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=<ext>&pwd=<pbxpass>&record_calls=1


Concatenation:
You can pass more than one instruction – lets say I want extension 100 to be disabled from making external calls and recording enabled. The command would look like this:

http://10.172.0.15:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=100&pwd=admin&disable=0&disable_external=1&record_calls=1

You can see a simple example (works only on IIS) of  how the 3CX API was used here.
(Launch this link in your browser, and then select the “View Source” menu option. This will demonstrate a simple example of how to programmatically achieve integration with 3CX Phone System.)

Rlated 3CX API Articles

Liked this article?


Get notified of new articles
or share
You might also be interested in: