CallListener | sinch-rtc
Description: Documentation for sinch-rtc

# Interface CallListener

Represents a listener of Call events. The methods handle call state changes.

# Call State Progression

For a complete outgoing call, the listener methods will be called in the following order:

- onCallProgressing
- onCallRinging
- onCallAnswered
- onCallEstablished
- onCallEnded

For a complete incoming call, the delegate methods will be called in the following order, after the callback method CallClientListener.onIncomingCall has been called:

- onCallAnswered
- onCallEstablished
- onCallEnded

interface CallListener {
onCallAnswered(call: Call): void;
onCallEnded(call: Call): void;
onCallEstablished(call: Call): void;
onCallProgressing(call: Call): void;
onCallQualityWarningEvent(
call: Call,
callQualityWarningEvent: CallQualityWarningEvent,
): void;
onCallRinging(call: Call): void;
onRemoteTrack(call: Call, track: MediaStreamTrack): void;
}

##### Index

### Methods

onCallAnswered?
onCallEnded?
onCallEstablished?
onCallProgressing?
onCallQualityWarningEvent?
onCallRinging?
onRemoteTrack?

## Methods

### `Optional`onCallAnswered

- onCallAnswered(call: Call): void

  Tells the listener that the call was answered.

  The call has entered the ANSWERED state.

  #### Parameters

  - call: Call

    The call that was answered.

  #### Returns void

### `Optional`onCallEnded

- onCallEnded(call: Call): void

  Tells the listener that the call ended.

  The call has entered the ENDED state.

  #### Parameters

  - call: Call

    The call that ended.

  #### Returns void

### `Optional`onCallEstablished

- onCallEstablished(call: Call): void

  Tells the listener that the call was established .

  The call has entered the ESTABLISHED state.

  #### Parameters

  - call: Call

    The call that was established.

  #### Returns void

### `Optional`onCallProgressing

- onCallProgressing(call: Call): void

  Tells the listener that the outgoing call is progressing and a progress tone can be played.

  The call has entered the PROGRESSING state.

  #### Parameters

  - call: Call

    The outgoing call to the client on the other end.

  #### Returns void

### `Optional`onCallQualityWarningEvent

- onCallQualityWarningEvent(
  call: Call,
  callQualityWarningEvent: CallQualityWarningEvent,
  ): void

  Tells the listener that an event connected with call quality warning functionality is observed.

  #### Parameters

  - call: Call

    The call that has received the call quality warning.

  - callQualityWarningEvent: CallQualityWarningEvent

    Call quality warning event object.

  #### Returns void

### `Optional`onCallRinging

- onCallRinging(call: Call): void

  Tells the listener that the callee received the call.

  The call has entered the RINGING state.

  #### Parameters

  - call: Call

    The outgoing call to the client on the other end.

  #### Returns void

### `Optional`onRemoteTrack

- onRemoteTrack(call: Call, track: MediaStreamTrack): void

  Tells the listener that a new remote track has been received.

  #### Parameters

  - call: Call

    The call that received the remote track.

  - track: MediaStreamTrack

    The media track.

  #### Returns void