Skip to main content

CallDetect

Represents a current or past detecting session in a call.

Obtain instances of this class by starting a Detect session with one of the following methods:

Properties

id

The unique ID for this detecting session.

Syntax: CallDetect.id()

Returns: string

type

The type of this detecting session.

Syntax: CallDetect.type()

Returns: "machine" | "digit" | "fax"| "beep"

result

The result of the detecting session.

Syntax: CallDetect.result()

Returns:

Detect TypeTypeEvent Values
amd | detectAnsweringMachine"string"
  • MACHINE: Machine detected
  • HUMAN: Human detected - this is a final event
  • UNKNOWN: Unknown detection
  • READY: Machine is ready for voicemail delivery - This is a final event if detect_interruptions=false or beep=true
  • NOT_READY: Machine voicemail has restarted, interrupting voicemail delivery. Only fired if detect_interruptions=true.
detectDigit"string"Possible digits detected: 0 1 2 3 4 5 6 7 8 9 # *
detectFax"string"
  • CED: called station fax tone
  • CNG: calling station fax tone

Methods

ended

ended(): Promise<CallDetect>

Returns a promise which will get resolved only after the detecting session is completed.

Returns

Promise<CallDetect> - See CallDetect for more details.

Example

const detect = await call.detectDigit();
const result = await detect.ended();

console.log("Detect result:", result.type);

stop

stop(): Promise<CallDetect>

Stops the detect session.

Returns

Promise<CallDetect> - See CallDetect for more details.

Example

const detect = await call.detectDigit();
await detect.stop();

Events

onStarted

CallCollect.listen({ onStarted: Callback }})

Emitted when the detecting session has started. Your event handler will be called with an instance of CallDetect.

Parameters

NameTypeDescription
detectCallDetectThe detecting session that has started.

onUpdated

CallCollect.listen({ onUpdated: Callback }})

Emitted when the detecting session has been updated. Your event handler will be called with an instance of CallDetect.

Parameters

NameTypeDescription
detectCallDetectThe detecting session that has updated.

onEnded

CallCollect.listen({ onEnded: Callback }})

Emitted when the detecting session has ended. Your event handler will be called with an instance of CallDetect.

Parameters

NameTypeDescription
detectCallDetectThe detecting session that has ended.