Rate this page:

AgentsClient

Methods

addEventListener

Copy URL
addEventListener(event: 

Events

|

AgentsEvents

,
callback:

Function

):

void

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

Parameters

Returns

  • type:

    void

clearMediaBuffer

Copy URL
clearMediaBuffer(parameters: 

ClearMediaBufferParameters

):

void

Clears the Cartesia WebSocket media buffer.

Parameters

Returns

  • type:

    void

close

Copy URL
close(): 

void

Closes the Cartesia connection (over WebSocket) or connection attempt.

Returns

  • type:

    void

custom

Copy URL
custom(parameters: 

Object

):

void

Parameters

  • parameters:

    Object

Returns

  • type:

    void

dtmf

Copy URL
dtmf(parameters: 

Object

):

void

Sends DTMF (dual-tone multi-frequency) tones. https://docs.cartesia.ai/line/integrations/web-calls#dtmf-event

Parameters

  • parameters:

    Object

Returns

  • type:

    void

id

Copy URL
id(): 

string

Returns the AgentsClient id.

Returns

  • type:

    string

removeEventListener

Copy URL
removeEventListener(event: 

Events

|

AgentsEvents

,
callback:

Function

):

void

Removes a handler for the specified Cartesia.AgentsEvents or Cartesia.Events event.

Parameters

  • event:

    Events

    Event class (i.e., Cartesia.AgentsEvents.ACK)

  • callback:

    Function

    Optional

    Optional. Handler function. If not specified, all handler functions are removed

Returns

  • type:

    void

sendMediaTo

Copy URL
sendMediaTo(mediaUnit: 

VoxMediaUnit

,
parameters:

SendMediaParameters

):

void

Starts sending media from the Cartesia (via WebSocket) to the media unit. Cartesia works in real time.

Parameters

Returns

  • type:

    void

start

Copy URL
start(parameters: 

Object

):

void

Initializes the audio stream configuration. https://docs.cartesia.ai/line/integrations/web-calls#start-event

Parameters

  • parameters:

    Object

Returns

  • type:

    void

stopMediaTo

Copy URL
stopMediaTo(mediaUnit: 

VoxMediaUnit

):

void

Stops sending media from the Cartesia (via WebSocket) to the media unit.

Parameters

Returns

  • type:

    void

webSocketId

Copy URL
webSocketId(): 

string

Returns the Cartesia WebSocket id.

Returns

  • type:

    string