This guide covers Computer Telephony Integration (CTI) using the Sukam Synapse API.
Sukam Synapse is a PBX (Private Branch Exchange) solution based on the Asterisk Engine.
Integrating your application with Sukam Synapse provides the following CTI functionalities:
The integration requires setting up two key components to communicate.
| Component | Location | Role | |
| 1. Sukam Synapse / Asterisk Server | Office or Cloud | Manages all telephony and PBX functions. | ![]() |
| 2. Your Application Server (e.g., LAMP) | Cloud or On-Premise | Hosts your Web/Desktop application. | ![]() |
To enable all CTI functionalities, you need to manage three core aspects:
Log in to Synapse.
2. Go to the License menu.
3. Click on API License.
4. Choose the License File and click “Update License” to activate the API License.
Click on Configuration
Click on Configuration
Here Add System IPs to allow “Click to Call” from that system in the “Allowed IP List” section.
Action: Originate
Example JSON Parameter:
JSON
{
"action": "Originate",
"extension": "70",
"number": "9876543XXX",
"context": "DLPN_all"
}
Example Full URL Request:
http://192.168.1.51/SukamAsteriskAPI/synapseactions.php?actiondetails={“action”:”Originate”,”extension”:”SIP/70″,”number”:”9876543XXX”,”context”:”DLPN_all”}
| Field | Description | Example Value |
| 192.168.1.51 | Synapse IP Address | 192.168.1.51 |
| extension | The extension placing the call | 70 |
| number | The number to be called | 9876543XXX |
| context | The dial plan for the extension | DLPN_all |
Action: Transfer call
Example JSON Parameter:
JSON
{
"action": "Transfer",
"transferchannel": "DAHDI/21",
"newextension": "46",
"context": "DLPN_all"
}
Example Full URL Request:
http://192.168.1.51/SukamAsteriskAPI/synapseactions.php?actiondetails={“action”:”Transfer”,”transferchannel”:”DAHDI/21″,”newextension”:”46″,”context”:”DLPN_all”}
| Field | Description | Example Value |
| transferchannel | The channel to be transferred | DAHDI/21 |
| newextension | The new extension/number to transfer to | 46 |
Action: Hangup
Example JSON Parameter:
JSON
{
"action": "Hangup",
"hangupchannel": "SIP/700000418d"
}
Example Full URL Request:
http://192.168.1.51/SukamAsteriskAPI/synapseactions.php?actiondetails={“action”:”Hangup”,”hangupchannel”:”SIP/700000418d”}
| Field | Description | Example Value |
| hangupchannel | The channel to be terminated | SIP/700000418d |
Synapse sends call events (start, connect, finish) to the Remote APP URL configured in the API Settings. The Synapse server will execute your application URL with a JSON string of the call status via the GET method.
Sent when a call is initiated.
Key Action Items: Use the hangupchannel value for later call hang-up, and the redirectchannel for call transfer.
Example JSON:
JSON
{
"asteriskhost": "192.168.1.51",
"event": "CallStart",
"direction": "Outgoing",
"number": "9876543XXX",
"extension": "70",
"hangupchannel": "SIP\/700000418d",
"redirectchannel": "DAHDI\/21",
"uniqueid": "1430819361.25418"
}
Provides details when the call is answered/connected.
Sent when a call ends, providing a complete summary.
Example JSON:
JSON
You can explicitly fetch CDRs extension-wise between two dates by executing a separate URL:
URL Format:
http://serverip/SukamAsteriskAPI/asteriskapi/cdr.php?action=getcdr&extension=extensionno&fromdate=fromdate&todate=todate
Example Request:
http://192.168.1.51/SukamAsteriskAPI/asteriskapi/cdr.php?action=getcdr&extension=70&fromdate=2015-11-06&todate=2015-11-07