Skip to main content

Connecting to Multiple Numbers

The call() method in the PiopiyAction 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, retries, and recording.

call(from, to, options)
parameterTypeDescription
fromnumberThe caller's phone number
tonumber / arrayA single receiver's phone number or an array of phone numbers.
optionsObjectAn object containing optional parameters (duration,timeout,loop and record)
durationnumberMaximum call duration in seconds
timeoutnumberTime in seconds to wait for input
loopnumberNumber of retry attempts for each number
recordbooleanWhether to record the call

Example Implementation

  • The following example demonstrates how to connect a call from one number to multiple recipients, retrying each number twice, with a 10-second call duration and a 20-second timeout for each attempt. The call will also be recorded for set record true.
const { PiopiyAction } = require("piopiy");

const action = new PiopiyAction();

action.call([9198xxxxxx, 9194xxxxx] ,9180xxxx, { duration: 10, timeout: 20, loop: 2, record: true })