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:

  • -(void)makeOutboundCall:(NSString*_Nonnull)number callerId:(NSString *_Nonnull)callerId withDialOptions:(NSDictionary* _Nonnull)dialOptions; – To dial Single Phone Number
  • -(void)makeOutboundCalls:(NSArray*_Nonnull)numberList callerId:(NSString *_Nonnull)callerId withDialOptions:(NSDictionary* _Nonnull)dialOptions; – To dial multiple Phone Numbers (Maximum 5)

Parameters:

  • dialout_number – String. It can be either a PSTN Number or a SIP URI to dial out.
  • numberList – List of Strings. Multiple PSTN or SIP URL to dial out.
  • callerId – 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: iOS 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.

Delete Method:

  • -room:didOutBoundCallInitiated: Notification to the call initiator when Dial out call is initiated.
  • -room:didDialStateEvents: 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.
[enxRoom makeOutboundCall:@"9999999999"  callerId:@"8888888888" withDialOptions: dialOptions];	// Make a Call

where var dialOptions = {
@"name": @"John",
@"early_media": @false,
@"silent_join": @true
};
 
-(void)room:(EnxRoom *)room didOutBoundCallInitiated:(NSArray *)Data{
	// Acknowledge that Call has been initiated
}

-(void)room:(EnxRoom *)room didDialStateEvents:(EnxOutBoundCallState)state{
	// Notifies repeatedly status of Dialout Process 
}

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: iOS 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: -(void)cancelOutboundCall:(NSString*_Nonnull)number;

Parameters:

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

Delegate Method:

  • -room:didOutBoundCallCancel: Notification to the call initiator when the participant gets disconnected.
[enxRoom cancelOutboundCall:@"9999999999"];	// Cancel a Call
 
- (void)room:(EnxRoom *_Nullable)room didOutBoundCallCancel:(NSArray *_Nullable)data{
	// Acknowledge that the Call has been cancelled
}

Send DTMF Response

Availability: v2.3.16

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.

Class: EnxRoom

Method: (void)sendDTMF:(NSString*_Nonnull)number digits:((NSString*_Nonnull)digits;

Parameters:

  • 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.

Delegate Method:

  • -room:didOutBoundCallSendDtmf – Method call success and failure notifications are given with error codes.
[enxRoom sendDTMF:@“919999988888” digits:@"1"];

- (void)room:(EnxRoom *_Nullable)room didOutBoundCallSendDtmf:(NSArray *_Nullable)data {
	// Acknowledge that the DTMF Sending is successful
}

Error Codes / Exceptions

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