Skip to main content

Call

The call action will connect the call to other phone numbers. For example, when the caller dials the PIOPIY phone number the incoming call can be routed to multiple phone numbers at a time, such as landline and mobile number.

The call() method in the StreamAction class allows you to initiate a call from one number to multiple recipients. The call will attempt to connect to each number in sequence, with customizable options such as call duration, timeouts and retries.

For single user:

const { StreamAction } = require("piopiy");

const stream = new StreamAction();

const destination_number = "Your destination number"; // Your destination phone number with country code.

const piopiy_number = "Your piopiy number"; // Your piopiy number provided by the Piopiy TeleCMI platform.

const options = { duration: 10, timeout: 20, loop: 1 };

stream.call(customer_number, piopiy_number, options);

For multiple users:

const { StreamAction } = require("piopiy");

const stream = new StreamAction();

const multiple_destination_numbers = [ "Your destination number", "Your destination number"]; // Multiple destination's phone numbers with country code.

const piopiy_number = "Your piopiy number"; // Your piopiy number provided by the Piopiy TeleCMI platform.

const options = { duration: 10, timeout: 20, loop: 1, ring_type: "group" };

action.call(customer_number, piopiy_number, multiple_agent_number, options);

Parameters type and description

Mandatory parameters

ParameterTypeDescription
destination_numbernumberThe phone number for single destination number, including country codes.
piopiy_numbernumberThe piopiy number provided by the Piopiy TeleCMI platform.
multiple_destination_numbersarrayAn array of phone numbers for multiple destination numbers, including country codes.
optionsobjectAn object containing optional parameters (duration, timeout, loop & ring_type).

Options Parameters

ParameterTypeDescription
durationnumberThe maximum duration of the call in seconds,By default 5400 seconds.
timeoutnumberTime to wait for the call to be answered in seconds,By default 40 seconds.
loopnumberThe number of retry attempts if the call is not answered,By default 1.
ring_typestringThe type of ringing for the call. By default, it is single, where agents receive calls one by one. If set to group, all agents will receive calls simultaneously.