Class: NXMCall

NXMCall(application, conversation, from)

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
Source:
Fires:

Members

(static, readonly) CALL_DIRECTION :string

Enum for NXMCall direction.
Type:
  • string
Properties:
Name Type Description
INBOUND string The NXMCall started from another end
OUTBOUND string The NXMCall started from this client
Source:

(static, readonly) CALL_STATUS :string

Enum for NXMCall status.
Type:
  • string
Properties:
Name Type Description
STARTED string The NXMCall is in started status
RINGING string The NXMCall is in ringing status
ANSWERED string The NXMCall is in answered status
COMPLETED string The NXMCall is in completed status
BUSY string The NXMCall is in busy status
TIMEOUT string The NXMCall is in timeout status
UNANSWERED string The NXMCall is in unanswered status
REJECTED string The NXMCall is in rejected status
FAILED string 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

answer(autoPlayAudioopt) → {Promise.<Audio>}

Answers an incoming nxmCall Join the conversation that you are invited Create autoplay Audio object
Parameters:
Name Type Attributes Default Description
autoPlayAudio boolean <optional>
true attach the audio stream automatically to start playing (default true)
Source:
Returns:
Type
Promise.<Audio>

hangUp(reasonopt) → {Promise}

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 Attributes Description
reason object <optional>
the reason for hanging up the nxmCall
Properties
Name Type Attributes Description
reason_code string <optional>
the code of the reason
reason_text string <optional>
the description of the reason
Source:
Returns:
Type
Promise

hangUpIfAllLeft() → {Promise}

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(reasonopt) → {Promise}

Rejects an incoming nxmCall Leave from the conversation that you are invited
Parameters:
Name Type Attributes Description
reason object <optional>
the reason for rejecting the nxmCall
Properties
Name Type Attributes Description
reason_code string <optional>
the code of the reason
reason_text string <optional>
the description of the reason
Source:
Returns:
Type
Promise