Availability: v1.5.3+

The EnxRoom.makeOutboundCall() method allows you to initiate an Outbound Call to PSTN Number or SIP URI while being in the session, thus inviting the called participant to join the session on accepting the call.

Method: EnxRoom.makeOutboundCall(dialout_number, cli_number, options, callback)

Parameters:

  • dialout_number – String. It can be either a PSTN Number or a SIP URI to dial out. For Phone Number, use country code without “00” or “+”.
  • cli_number – String. Calling Line Identification Number to be added as the originator of the Call. In the case of PSTN Phone Numbers, this will be validated against your purchased number or opted Shared Number. In case if the CLI does not match, the call will fail with an error “CLI mismatch”.
  • options – Availability: v2.0.2+
    • name – String. Name of the dialled participant. If the name is omitted, the dialled Phone Number is used as the name.
    • early_media – Boolean. Default false. If set to true, the ringer is played in the Room when dial-out is initiated. On the other hand, if set to false, the ringer will not be placed in the Room when dial-out is in progress.
    • silent_join – Boolean. Default true. If set to true, the dialled participant is not put into the Room until he answers the call. On the other hand, when it is set to false, he will be put into the Room as soon as dial-out is in progress and ringer will be played.
    • callback – It returns the dial-out request result. Failure notifications are given with error codes.

Note: early_media and silent_join may not be used together.

Event Listener:

  • dial-state-events – Notification to the call initiator about the state of the dial-out process as received from Gateway. The JSON Response returns states as: initiated, dialing, connected, dtmf-collected, and disconnected.
var dialout_option = {
"name": "John",
"early_media": false,
"silent_join": true
};
room.makeOutboundCall('91999999999', '1999999999', dialout_option, function(resp) {
	// Whether Dial-Out requests accepted. resp JSON example
	/*
	{ 	"result": 0,  
		"msg": "Success"  
	}
	*/  
}); 

room.addEventListener("dial-state-events ", function(evt) {
	// evnt JSON contains state of dial-out process, example
	
	{	number: "9999999999",	/* Dialled Phone Number of SIP URI */
		state: "connected", 	/* State of the dial-out Process */
		description: "Detailed description"
	} 
/*
	evt.state may be initiated, dialing, connected, 
	dtmf-collected & disconnected
	*/
}); 

Error Codes / Exceptions

CodeDescription
1141Dial out request already in process.
1142CLI doesn’t match with configured phone number.
4124Dialed-out phone number doesn’t exist.

Send DTMF Response

Availability: v2.3.26+

The EnxRoom.sendDTMF() method allows send DTMF response to pass through an IVR if dialed out PSTN Call is connected to IVR. This method can be executed repeatedly to pass single digit or multiple digits in a single call.

An outbound PSTN Call must have been answered first to make use of sendDTMF() method to pass DTMF digits on the same PSTN channel.

Method: EnxRoom.sendDTMF(options, callback)

Parameters:

  • options – Availability: v2.0.2+
    • number – String. It’s the same dialout_number used with makeOutboundCall() method. It can be either a PSTN Number or a SIP URI to dial out. For Phone Number, use country code without “00” or “+”.
    • digits – String. Digit(s) to pass on to Voice Service as DTMF digits.
  • callback – Method call success and failure notifications are given with error codes.
var dtmf_option = {
	"number": "91999999999",
	"digits": "1"
};

room.sendDTMF(dtmf_option, function(resp) {
	// Sample resp JSON example
	/*
	{ 	"result": 0,  
		"msg": "Success"  
	}
	*/  
}); 

Error Codes / Exceptions

CodeDescription
1155Invalid options/parameters/values.
1201Invalid Dial-State.
1202Outbound Dial Request not found.