Creatio development guide
PDF
This documentation is valid for Creatio version 7.10.0. We recommend using the newest version of Creatio documentation.

Asterisk

Glossary Item Box

General information

Use AMI (Asterisk Manager Interface) to interact with the Asterisk server. The API enables client programs to connect to Asterisk server by using TCP/IP protocol. The Application Programming Interface enables you to process events in the digital multiplex system (DMS), and send commands to control calls.

NOTE

Currently the integration of bpm'online with Asterisk is supported up to version 11.

A client uses a simple text protocol for communication between the Asterisk and the connected Manager API: "parameter: value". The end of a string is determined by the sequence of Carriage Return and Line Feed (CRLF).

NOTE

In the future, for a set of strings like "parameter: value", followed by a blank line containing only a CRLF, for simplicity the term "package" will be used.

How to set up the configuration file of the Messaging Service to integrate Asterisk to bpm'online

For integration to work with bpm'online, you need to install Terrasoft Messaging Service (TMS) on a dedicated computer that will be used as the integration server. You must set the following parameters for Asterisk in the Terrasoft.Messaging.Service.exe.config configuration file:

<asterisk filePath="" url="Name_or_address_of_Asterisk_server" port="Asterisk_server_port" userName="Asterisk login" secret="Asterisk password" originateContext="Originate context" parkingLotContext="Parking lot context" autoPauseOnCommutationStart="true" queueExtensionFormat="Local/{0}@from-queue/n" asyncOriginate="true" sendRingStartedOnRingingState="true" traceQueuesState="false" packetInfoConfig="Additional package parameters to be processed in configuration" />

Ports for Asterisk integration with bpm'online

  • TMS accepts WebSocket connection to the 2013 port via TCP.
  • TMS connects to the Asterisk server by default via the 5038 port.

The Terrasoft Messaging Service for Asterisk integration with bpm'online

The integration part of the Messaging Service is implemented in the main bpm'online solution kernel in the Terrasoft.Messaging.Asterisk library.

Library main classes:

  • AsteriskAdapter — an Asterisk class that transforms events to the top-level call model events used in bpm'online integration.
  • AsteriskManager — a class that creates and deletes user connections to the Asterisk server.
  • AsteriskConnection — a class that represents the user connection for integration with Asterisk.
  • AsteriskClient — a class used to send commands to the Asterisk server.

Example of CtiModel, Terrasoft Messaging Service and Asterisk Manager API interaction

Operator outgoing call to a subscriber: putting a call on hold, putting off hold by a subscriber and finishing the call by the operator.

Fig. 1 shows the occurrence of events for this example While table 1 shows an example of processing of events — how these events are interpreted by the TMS, which values from these events are used in processing an incoming call.

Fig. 3. Sequence of events during a call

scr_asterisk_events.png

Table 1. Asterisk events

Asterisk log TMS Action Client

{

Event: newchannel

Channel: <channel_name>

UniqueID: <unique_id>

}

A channel is created and added to a collection

new AsteriskChannel({

Name: <channel_name>,

UniqueId: <unique_id>

});

{

Event: Hold

UniqueID: <unique_id>

Status: "On"

}

Search for the channel by <unique_id> and generate an event by using the fireEvent method. PutHoldAction Processing the PutHoldAction and displaying the call on hold.

{

Event: Hold

UniqueID: <unique_id>

Status: "Off"

}

Search for the channel by <unique_id> and generate an event by using the fireEvent method. EndHoldAction Processing the EndHoldAction and displaying the call on hold.

{

Event: Hangup

UniqueID: <unique_id>

}

Search for the channel by <unique_id> and generate an event by using the fireEvent method. RingFinished Processing event and displaying the call end.

{

Event: Dial

SubEvent: Begin

UniqueID: <unique_id>

}

Search for the channel by <unique_id>, fill in the data and generate an event by using the fireEvent method. RingStarted Processing the RingStarted event and displaying it on the outgoing call panel.

{

Event: Bridge

UniqueID: <unique_id>

}

Search for the channel by <unique_id> and generate an event by using the fireEvent method. CommutationStarted Processing the CommunicationStarted event and displaying the communication.
Clicking the "Answer" button initiates a new event in Asterisk.

Asterisk events

A detail list of events and information about their parameters is described in the Asterisk documentation.

© bpm'online 2002-2017.

Did you find this information useful?

How can we improve it?