Rate this page:

Participant

This class represents a CCAI Participant instance. Add the following line to your scenario code to use the class: require(Modules.AI);

Methods

addEventListener

Copy URL
addEventListener(event: 

Participant

,
callback:

Function

):

void

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

Parameters

  • Event class

  • callback:

    Function

    Handler function

Returns

  • type:

    void

addPlaybackMarker

Copy URL
addPlaybackMarker(offset: 

number

,
playbackId:

string

):

void

Add a Dialogflow speech synthesis playback marker. The Participant.MarkerReached event will be triggered when the marker is reached.

Parameters

  • offset:

    number

  • playbackId:

    string

    Optional

Returns

  • type:

    void

analyzeContent

Copy URL
analyzeContent(query: 

EventInput

|

TextInput

):

void

Add a message from a participant into the CCAI Dialogflow.​

Parameters

Returns

  • type:

    void

call

Copy URL
call(): 

Call

Call object associated with a Participant.

Returns

id

Copy URL
id(): 

string

Participant id.

Returns

  • type:

    string

removeEventListener

Copy URL
removeEventListener(event: 

Participant

,
callback:

Function

):

void

Remove the event handler for a specific event generated by the specified CCAI Agent instance.

Parameters

  • Event class

  • callback:

    Function

    Optional

    Handler function. If not specified, all event listeners are removed

Returns

  • type:

    void

sendMediaTo

Copy URL
sendMediaTo(targetMediaUnit: 

VoxMediaUnit

,
optional:

sendMediaOptions

):

void

Start sending voice from a CCAI Dialogflow participant to the media unit specified in targetCall.

Parameters

Returns

  • type:

    void

stopMediaTo

Copy URL
stopMediaTo(targetMediaUnit: 

VoxMediaUnit

):

void

Stop sending voice from a CCAI Dialogflow participant to the media unit specified in targetCall.

Parameters

Returns

  • type:

    void