By default, the system includes integrations with different IP telephony providers. If the provider you need is not in the list, you can use this API to configure an integration on your own. To do that, create a custom module and add several functions in the module’s scripts using TypeScript.
Built-in and custom telephony integration modules basically work in the same way and have the same features. Your module allows you to:

  • initiate a call in the system by clicking a Phone number type field
  • see a pop- up form that signals about an incoming call and includes brief information about it (phone number, contact’s name, name of the user responsible for the client)
  • see the app item containing the phone number of the caller that opens automatically
  • have the system automatically create and save an app item if a call is missed, and the phone number is not found in the database
  • automatically register missed calls
  • automatically save entries about incoming and outgoing calls in the associated item's activity stream; if the call is answered, the notification includes the recording of the call that can be played back on the same page or commented (for example, you can write a brief description of the call)
  • automatically associate IP telephony accounts and system users for routing and correct identification of the operator who received or initiated a call.

    Limitations

    Before you start implementing your own IP telephony integration, consider the following limitations of APIs:
  1. There is no call routing on the system’s side. This allows avoiding conflicts with routing settings of the telephony provider and the system itself. Almost all providers have this feature: when a call is routed to an employee or group, the incoming call is displayed to the specified users.
  2. At the moment, telephony events are processed via requests delivered to an HTTP link (webhook). If the telephony provider does not give you the opportunity to specify a link to send requests to, you need to create an intermediary service that would convert the telephony provider’s data into a request that can be sent to the system’s server.
  3. For call recordings, only links to the files are saved in the system. Telephony providers usually save call recordings automatically, and links to them will not need to be added manually, but you should keep in mind that providers can have different policies regarding storage of call recordings. Your telephony provider might store recordings only for a limited time.

    Implementation

    To create an integration module, you need to add the following functions to the custom module’s scripts:
    // Checking the connection with the  telephony provider. The function is called when a user clicks the Check  connection on the module’s page. 
    // Returns the connection checking status  shown to the user on the module’s page. 
    async function VoipTestConnection():  Promise<VoipTestConnectionResult> { } 
    // Processing a request from your IP  telephony provider. The function is called when a request to the module’s  webhook is made. 
    // The 'request' parameter stores information about the  HTTP request, including HTTP headers and the request body contents. 
    // The  function returns the result of request processing. 
    // Based on this result,  the system will show notifications about the incoming call, save the call  recording, etc. 
    async function VoipParseWebhookRequest(request:  FetchRequest): Promise<VoipWebhookParseResult> { } 
    // Getting a list of  users from the IP telephony provider. 
    // This function is called when  telephony users are associated with system users, after a user clicks  Configure on the module’s page. 
    // It returns a list of telephony provider  users. 
    async function VoipGetMembers(): Promise<VoipMember[]> { } 
    //  Generating an outgoing call. This function is called when a system user  clicks Call 
    // in a Phone number type field of an app item. In the  `srcPhone` parameters, the caller’s phone number is specified, 
    // and  `dstPhone` is the number that is called. 
    async function  VoipGenerateCall(srcPhone: string, dstPhone: string): Promise<void> { } 
    //  Getting a link to a call recording. This function is called when a user  plays a call recording in the app item’s activity stream. 
    // The 'callData'  parameter stores data from the `VoipParseWebhookRequest` function 
    //  specified when the information about the recording was saved. The function  returns a link to a file. 
    async function VoipGetCallLink(callData: any):  Promise<string> { } 
    // This function is called automatically when the link  to the webhook changes (for example, then the token is updated). 
    // The  `webhookUrl` parameter stores an absolute link to the integration module’s  webhook. Using this function is optional. 
    async function  VoipOnWebhookUpdated(webhookUrl: string): Promise<void> { } 
    
    When you add these functions and save the script on the module’s page, you will see a new section, Telephony settings. In this section, you will see your link to the webhook. Each time data is sent to this link, the VoipParseWebhookRequest function you added to the script will be called. This function helps you to process the request and returns its instance, VoipWebhookParseResult, that is used by the system to display information about the call and save information about the call recording. You need to specify the link to the webhook in your IP telephony provider’s settings. The link processes HTTP requests of the GET and POST types. It has to contain the required parameter token.