Skip to main content
All CollectionsTelephony
Telephonies PBX, Asterisk and FreePBX

Telephonies PBX, Asterisk and FreePBX

We'll tell how to integrate software-based PBX telephony, using PBX, Asterisk, or FreePBX, with CRM and work with calls directly in the Space

Uspacy Support Team avatar
Written by Uspacy Support Team
Updated over a week ago

Make incoming and outgoing calls within your CRM by connecting well-known platforms for implementing PBX, Asterisk, or FreePBX.

It allows you to set up communication and, as a result, significantly improve the quality of service, thereby boosting client loyalty.

At Uspacy, telephony works through integrations with specialized services. In the Marketplace section, you’ll find free apps that, once installed and configured, will allow you to seamlessly call clients or receive calls from them.

For the successful operation of PBX, Asterisk, or FreePBX, you need to perform initial configurations on both sides: telephony and Uspacy.

☝🏻Before proceeding with the step-by-step telephony service and Uspacy setup, a few preparatory actions need to be taken.

More details below ⬇️

Preparatory actions

First, install the free app for the PBX, Asterisk, or FreePBX platform that you’re using, for your Space.

To do this, go to the Marketplace section and click the Get button.

Once the app is installed, the integration data required for use on the PBX, Asterisk, or FreePBX platform will become available. So, open its settings.

Here, you’ll need the field: Webhook. This is required during the integration setup on the PBX, Asterisk, or FreePBX platform. Therefore, copy its value.

PBX, Asterisk, or FreePBX settings

Uspacy receives call data from telephony. Therefore, it is necessary to configure the transmission of this information for the integration.

Call event requests should be in the following format:

Method: POST

Format: JSON

In the table below, you can familiarize yourself with the description of the parameters.

The structure of the request body could look like this (example of a call start event):

{

"action": "call",

"call": {

"id": "1233123",

"direction": "outgoing",

"to": "380730000001",

"from": "333",

"state": "started"

}

}

Examples of integration scenarios

1. Outgoing Call:

1.1 Call initialization:

If you have added a call initialization URL in the integration settings, when you click on the phone number in the CRM card, the following request will be sent to the telephony system via this link:

{

"caller": "operator", // internal line number of the manager who initiated the call

"destination_number": "380670000132" // client's phone number

}

1.2 Call start event:

After the call starts, the telephony system should send the following request to the link provided in the Uspacy webhook field in the integration settings:

{

"action": "call",

"call": {

"id": "call_outgoing_1",

"direction": "outgoing",

"from": "operator",

"to": "380670000132",

"state": "started"

}

}

1.3 Call end event:

Once the call ends, the following request will be sent:

{

"action": "call",

"call": {

"id": "call_outgoing_1",

"direction": "outgoing",

"from": "operator",

"to": "380670000132",

"state": "completed",

"duration": 154,

"audio_url": "https://…."

}

}


2. Incoming Call:

2.1 Call start event:

{

"action": "call",

"call": {

"id": "call_incoming_1",

"direction": "incoming",

"from": "380670000132",

"to": "operator",

"state": "started"

}

}

2.2 Call transfer event to another operator:

{

"action": "call",

"call": {

"id": "call_incoming_1",

"direction": "incoming",

"from": "380670000132",

"to": "operator_2",

"state": "transferred"

}

}

2.3 Operator answers the call:

{

"action": "call",

"call": {

"id": "call_incoming_1",

"direction": "incoming",

"from": "380670000132",

"to": "operator_2",

"state": "answered"

}

}

2.4 Call end event:

{

"action": "call",

"call": {

"id": "call_incoming_1",

"direction": "outgoing",

"from": "380670000132",

"to": "operator_2",

"state": "completed",

"duration": 154,

"audio_url": "https://…."

}

}


3. Event to retrieve information about a number:

{

"action": "route",

"route": "380670000132"

}

In response, you will receive the following:

{

"inner_number": "operator_2", // SIP number of the responsible operator

"entity": {

"type": "leads",

"owner_id": 75,

"title": "Lead: 380670000132",

"link": "https://{domain}/crm/leads/1138/?type=lead"

}

}

Uspacy settings

Once the additional application settings for integration with PBX, Asterisk, or FreePBX platforms are complete, you will be able to call clients or receive calls from them.

Step 1. Connection

In this settings block, you only need to enter the Token, Call Initialization URL, and Call Termination URL. However, these are NOT required, but:

🟣 Token – used for authentication and authorization checks of requests to the server. If added, its value will be included in the request header on the Uspacy side: Authorization: Bearer {token}.

🟣 Call Initialization URL – enables the click2call feature. The URL is created on the telephony side. Once the call starts in CRM, a POST request in JSON format will be sent to it.

🟣 Call Termination URL – allows the call to be ended via the call card in CRM. The URL is created on the telephony side. A POST request in JSON format will be sent when the manager ends the call.

Don't forget to Save the data if you’ve entered it.

Step 2. Integration with CRM

In this settings block, you can select which entities to create for different call types:

You can also specify the desired Source.

💡 Source options depend on the entity type selected for creation based on the call.

☝🏻 The source is NOT available for activities.

You can add your own options to fill this field. So, your list can include not only the standard sources but also those you have created manually, for example, for specific telephony systems.


How to add the name of the telephony service as a source?

Go to the Settings for the entity for which you want to add a custom Source option.

Then, edit the parameters of this field.

Next, add (1) a new row with a name (2), and then Save (3).

After that, the newly created option will appear in the Source field in the telephony settings, and you can use it.

Step 3. Phone numbers matching

At Uspacy, you need to specify the SIP number assigned to each responsible employee in your PBX telephony settings. First, click Add.

Next, in the Employees field, select the desired user from the list. In the Internal number or Line value field, enter the SIP number.

💡Be sure to check the box when adding settings for each individual user.

Step 4. Assigning a default person responsible

It’s possible to assign a specific user as responsible for new entities created based on handling missed calls.

💡 If you don’t do this, the Space owner will be considered the default person responsible.

Working with telephony

☎️ After completing these steps, you can start working with telephony directly in Uspacy – always stay connected with your current and potential clients.

☎️ All calls (incoming, outgoing, and missed) will be saved in the history and will appear on the Call log page.

🌟 This feature is available only on commercial plans.

On the call log page, you can immediately process calls, for example, listen to call recordings or go to the CRM card of the related entity.

🙌🏻 Please note that call recordings usually appear with a delay of 10-15 minutes. If the call was long, the delay may be a bit longer. Call recordings will also be available in the CRM card, on the right side, under the activities filter, where the interaction history with the element is displayed.

If you have additional questions or you need to contact the support, send a request to this email [email protected]

Did this answer your question?