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.

Class: EnxRoom

Method: public void makeOutboundCall(String dialout_number, String cli_number, JSONObject dialOptions)

Parameters:

  • dialout_number – String. It can be either a PSTN Number or a SIP URI to dial out.
  • cli_number – 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: Android SDK v2.1.3+
    • 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.

Note: early_media and silent_join may not be used together.

Callback:

  • onDialStateEvents -Notification to the call initiator about the status of the dial-out process as received from Gateway. The JSON Response returns status codes as: initiated, calling, connecting, connected, and terminated.
  • onDTMFCollected – Notification when DTMF input is collected. It gets the String of digits collected.
room.makeOutbound('00999999999', '00999999999' dialOptions);

Public void onDialStateEvents(JSONObject jsonobject){
	// event JSON contains status of dial-out process 
	/*
	{	number: "9999999999",	/* Dialed Phone Number of SIP URI */
		status: "connected", 	/* Status of dialout Process */
		description: "Detailed description"
	} 

	status may be initiated, calling, connecting, 
	connected & terminated
	*/     
} 

Public void onDTMFCollected(String DTMFInput){
	// DTMFINput - A String of digits collected through DTMF
} 

Error Codes / Exceptions:

CodeDescription
1141Dial out request already in process.
1142CLI doesn’t match with the configured phone number.
5095Invalid phone number.

Cancel Outbound Call

Availability: Android SDK v2.1.3+

The EnxRoom.cancelOutboundCall() method allows you to cancel an ongoing Outbound Call to PSTN Number or SIP URI thus disconnects the participant from the session on passing the number.

Class: EnxRoom

Method: public void cancelOutboundCall(String number)

Parameters:

  • number – String. A PSTN Number or a SIP URI to disconnect from the session.

Delete Method:

  • onOutBoundCallCancel: Notification to the call initiator when the participant gets disconnected.
enxRoom cancelOutboundCall('9999999999');	// Cancel a Call
 
public void onOutBoundCallCancel(JSONObject jsonObject);{
	// Acknowledge that the Call has been cancelled
	{	number: "9999999999",	/* Phone Number of SIP URI */

	} 
}