Class: NXMCall

NXMCall


new NXMCall(application, conversation, from)

Conversation NXMCall Object.

Parameters:
Name Type Description
application Application

The Application object.

conversation Conversation

The Conversation object that belongs to this nxmCall.

from Member

The member that initiated the nxmCall.

Properties:
Name Type Default Description
application Application

The Application object that the nxmCall belongs to.

conversation Conversation

The Conversation object that belongs to this nxmCall.

from Member

The caller. The member object of the caller (not a reference to the one in conversation.members)

to Map.<string, Member>

The callees keyed by a member's id. The members that receive the nxmCall (not a reference to conversation.members)

id String

The nxmCall id (our member's leg_id, comes from rtc:answer event, or member:media)

CALL_STATUS NXMCall.CALL_STATUS "started"

the available nxmCall statuses

direction NXMCall.CALL_DIRECTION

the Direction of the nxmCall, Outbound, Inbound

STATUS_PERMITTED_FLOW NXMCall.STATUS_PERMITTED_FLOW

the permitted nxmCall status transition map, describes the "from" and allowed "to" transitions

rtcObjects Array.<object>

data related to the rtc connection

Properties
Name Type Argument Description
rtc_id string

the rtc_id

pc PeerConnection

the current PeerConnection object

stream Stream

the stream of the specific rtc_id

type string <optional>

audio the type of the stream

streamIndex number

the index number of the stream (e.g. use to mute)

stream Stream

the remote stream

Source:
Fires:

Members


<static, readonly> CALL_DIRECTION :string

Enum for NXMCall direction.

Type:
  • string
Properties:
Name Type Default Description
INBOUND string inbound

The NXMCall started from another end

OUTBOUND string outbound

The NXMCall started from this client

Source:

<static, readonly> CALL_STATUS :string

Enum for NXMCall status.

Type:
  • string
Properties:
Name Type Default Description
STARTED string started

The NXMCall is in started status

RINGING string ringing

The NXMCall is in ringing status

ANSWERED string answered

The NXMCall is in answered status

COMPLETED string completed

The NXMCall is in completed status

BUSY string busy

The NXMCall is in busy status

TIMEOUT string timeout

The NXMCall is in timeout status

UNANSWERED string unanswered

The NXMCall is in unanswered status

REJECTED string rejected

The NXMCall is in rejected status

FAILED string failed

The NXMCall is in failed status

Source:

<static, readonly> STATUS_PERMITTED_FLOW :Map.<string, Set.<NXMCall.CALL_STATUS>>

Enum for the permitted call status transition.

Type:
Source:

Methods


<async> answer(autoPlayAudio)

Answers an incoming nxmCall
Join the conversation that you are invited
Create autoplay Audio object

Parameters:
Name Type Argument Default Description
autoPlayAudio boolean <optional>
true

attach the audio stream automatically to start playing (default true)

Source:
Returns:
Type
Promise.<Audio>

<async> hangUp(reason)

Hangs up the nxmCall

If there is a knocking active, do a knocking:delete
otherwise
Leave from the conversation
Disable the audio

Parameters:
Name Type Argument Description
reason object <optional>

the reason for hanging up the nxmCall

Properties
Name Type Argument Description
reason_code string <optional>

the code of the reason

reason_text string <optional>

the description of the reason

Source:
Returns:
Type
Promise

hangUpIfAllLeft()

Go through the members of the conversation and if .me is the only one (JOINED or INVITED)
nxmCall nxmCall.hangUp().

Source:
Returns:
  • empty promise or the nxmCall.hangUp promise chain
Type
Promise

reject(reason)

Rejects an incoming nxmCall
Leave from the conversation that you are invited

Parameters:
Name Type Argument Description
reason object <optional>

the reason for rejecting the nxmCall

Properties
Name Type Argument Description
reason_code string <optional>

the code of the reason

reason_text string <optional>

the description of the reason

Source:
Returns:
Type
Promise