SIGN UP

VICall

Interface that may be used for call operations like answer, reject, hang up and mid-call operations like hold, start/stop video and others.

Methods

addDelegate:

- (void)addDelegate:(id<VICallDelegate>)delegate

Add call delegate to handle call events.

Parameters

answerWithSettings:

- (void)answerWithSettings:(VICallSettings *)settings

Answer incoming call.

Parameters

  • settings:

    VICallSettings *

    Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.

duration

- (NSTimeInterval)duration

Get the call duration.

Returns

  • Return:

    NSTimeInterval

    Call duration.

hangupWithHeaders:

- (void)hangupWithHeaders:(nullable NSDictionary *)headers

Terminates call. Call should be either established or outgoing progressing.

Parameters

  • headers:

    nullable NSDictionary *

    Optional set of headers to be sent with message. Names must begin with "X-" to be processed by SDK.

issueLevelForType:

- (VIQualityIssueLevel)issueLevelForType:(VIQualityIssueType)type

Get current level of specific quality issue.

Parameters

Returns

qualityIssues

- (NSArray<VIQualityIssueType> *)qualityIssues

Get all quality issues types.

Returns

rejectWithMode:headers:

- (void)rejectWithMode:(VIRejectMode)mode
               headers:(nullable NSDictionary *)headers

Reject incoming call.

Parameters

  • Specify mode of call rejection.

  • headers:

    nullable NSDictionary *

    Optional set of headers to be sent with message. Names must begin with "X-" to be processed by SDK.

removeDelegate:

- (void)removeDelegate:(id<VICallDelegate>)delegate

Remove previously added delegate.

Parameters

sendDTMF:

- (BOOL)sendDTMF:(NSString *)dtmf

Send DTMF within the call.

Parameters

  • dtmf:

    NSString *

    DTMFs.

Returns

  • Return:

    BOOL

    YES if DTMFs are sent successfully, NO otherwise.

sendInfo:mimeType:headers:

- (void)sendInfo:(NSString *)body
        mimeType:(NSString *)mimeType
         headers:(nullable NSDictionary *)headers

Send INFO message within the call.

Parameters

  • body:

    NSString *

    Custom string data.

  • mimeType:

    NSString *

    MIME type of info.

  • headers:

    nullable NSDictionary *

    Optional set of headers to be sent with message. Names must begin with "X-" to be processed by SDK

sendMessage:

- (void)sendMessage:(NSString *)message

Send message within the call. Implemented atop SIP INFO for communication between call endpoint and Voximplant cloud, and is separated from Voximplant messaging API.

Parameters

  • message:

    NSString *

    Message text.

setHold:completion:

- (void)setHold:(BOOL)hold
     completion:(nullable VICompletionBlock)completion

Hold or unhold the call.

Parameters

  • hold:

    BOOL

    YES if the call should be put on hold, NO for unhold.

  • completion:

    nullable VICompletionBlock

    Completion block to handle the result of the operation.

    typedef void (^VICompletionBlock)(NSError *__nullable error);
    • error: An error object that indicates why the operation failed (see VICallErrorCode for possible variants), or nil if the operation was successful.

setSendVideo:completion:

- (void)setSendVideo:(BOOL)video
          completion:(nullable VICompletionBlock)completion

Start or stop sending video for the call.

Parameters

  • video:

    BOOL

    YES if video should be sent, NO otherwise.

  • completion:

    nullable VICompletionBlock

    Completion block to handle the result of the operation.

    typedef void (^VICompletionBlock)(NSError *__nullable error);
    • error: An error object that indicates why the operation failed (see VICallErrorCode for possible variants), or nil if the operation was successful.

start

- (void)start

Start outgoing call.

startReceiveVideoWithCompletion:

- (void)startReceiveVideoWithCompletion:(nullable VICompletionBlock)completion

Start receive video if video receive was not enabled before. Stop receiving video during the call is not supported.

Parameters

  • completion:

    nullable VICompletionBlock

    Completion block to handle the result of operation.

    typedef void (^VICompletionBlock)(NSError *__nullable error);
    • error: An error object that indicates why the operation failed (see VICallErrorCode for possible variants), or nil if the operation was successful.

Properties

callId

@property (nonatomic, strong, readonly) NSString *callId

The call id.

callKitUUID

@property (nonatomic, strong, nullable) NSUUID *callKitUUID

The CallKit UUID that may be used to match an incoming call with a push notification received before.

Always nil for outgoing calls on VICall instance creation.

For outgoing calls it is recommended to set CXStartCallAction.callUUID value to this property on handling CXStartCallAction

endpoints

@property (nonatomic, strong, readonly) NSArray<VIEndpoint *> *endpoints

An array of the endpoints associated with the call.

localVideoStreams

@property (nonatomic, strong, readonly) NSArray<VIVideoStream *> *localVideoStreams

The local video streams associated with the call.

qualityIssueDelegate

@property (weak, nonatomic, nullable) id<VIQualityIssueDelegate> qualityIssueDelegate

Set VIQualityIssueDelegate to monitor issues that affect call quality.

sendAudio

@property (nonatomic, assign) BOOL sendAudio

A Boolean value that determines whether an audio is transferred from microphone into the call.

Setting this property enables or disables audio transfer.

videoEnabled

@property (nonatomic, assign, readonly, getter=isVideoEnabled) BOOL videoEnabled

A Boolean value that determines whether a video is enabled in the call.

videoSource

@property (nonatomic, strong) VIVideoSource *videoSource

A video source. By default [VICameraManager sharedCameraManager] is used that gets video from back or front camera. Must be set before using [VICall start] and [VICall answerWithSettings:] if needed.