Participant

Represents a CCAI participant instance.
View as Markdown

Methods

addEventListener

Adds a handler for the specified CCAI.Events.Participant event. Use only functions as handlers; anything except a function leads to an error and scenario termination when a handler is called.

1addEventListener(event: CCAI.Events.Participant | T, callback: (event: CCAI.Events._ParticipantEvents[T]) => any): void

Parameters

event
CCAI.Events.Participant | TRequired
callback
(event: CCAI.Events._ParticipantEvents[T]) => anyRequired

addPlaybackMarker

Adds a Dialogflow speech synthesis playback marker. The CCAI.Events.Participant.MarkerReached event is triggered when the marker is reached.

1addPlaybackMarker(offset: number, playbackId?: string): void

Parameters

offset
numberRequired
playbackId
string

analyzeContent

Adds a message from a participant into the Dialogflow CCAI.

1analyzeContent(query: CCAI.Vendor.EventInput | CCAI.Vendor.TextInput): void

Parameters

query
CCAI.Vendor.EventInput | CCAI.Vendor.TextInputRequired

call

Returns the call associated with the participant.

1call(): Call

id

Returns the participant’s id.

1id(): string

removeEventListener

Removes a handler for the specified CCAI.Events.Participant event.

1removeEventListener(event: CCAI.Events.Participant | T, callback?: (event: CCAI.Events._ParticipantEvents[T]) => any): void

Parameters

event
CCAI.Events.Participant | TRequired
callback
(event: CCAI.Events._ParticipantEvents[T]) => any

sendMediaTo

Starts sending media (voice) from the Dialogflow participant to the media unit.

1sendMediaTo(mediaUnit: VoxMediaUnit, parameters?: SendMediaParameters): void

Parameters

mediaUnit
VoxMediaUnitRequired
parameters
SendMediaParameters

stopMediaTo

Stops sending voice from the Dialogflow participant to the media unit.

1stopMediaTo(mediaUnit: VoxMediaUnit): void

Parameters

mediaUnit
VoxMediaUnitRequired