Voip

Telephony

Interface for working with telephony on behalf of the current user: retrieving connected providers and making outgoing calls.

Hierarchy

  • Voip

Methods

generateCall

  • generateCall(providerCode: string, tel: string): Promise<void>
  • Make an outgoing call on behalf of the current user.

    A call can be made in one of the following ways:

    • via the CTI panel in the current browser tab — if the user is connected to telephony via such a panel;
    • via a softphone — if the user has a softphone app installed and configured on their computer. To successfully send a call request, make sure the telephony provider is connected. Example of checking telephony provider connection:
      const providers = await  System.voip.getConnectedProviders();
      if (providers.length > 0) { 
        await  System.voip.generateCall(providers[0].code, '39XXYYYYYYY'); 
      } 
      

    Parameters

    • providerCode: string
    • tel: string

    Returns Promise<void>

    A Promise object with information about the successful submission of a call request.

getConnectedProviders

  • getConnectedProviders(): Promise<readonly VoipProvider[]>
  • Get connected telephony providers for the current user.

    For each of the specified providers, the current user can receive incoming calls and make outgoing calls. A provider is considered connected if:

    • a system user is mapped to an internal phone extension;
    • when using a CTI panel for telephony, the panel is connected to the provider in the browser tab. Example of retrieving connected providers:
      const  providers = await System.voip.getConnectedProviders();
      if  (providers.length > 0) { 
        await System.voip.generateCall (providers[0].code, '39XXYYYYYYY'); 
      } 
      

    Returns Promise<readonly VoipProvider[]>

    Connected telephony providers for the current user.