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.

Members
Other Methods
–  init

Warning: NS_UNAVAILABLE

- (instancetype)init
preferredVideoCodec

Preferred video codec, for example: @“H264”. Nil by default. Must be set before using startWithHeaders:, if needed.

@property (nonatomic, strong) NSString *preferredVideoCodec
videoSource

Video source. By default [VICameraManager sharedCameraManager] is used that gets video from back or front camera. Must be set before using startWithHeaders:, if needed.

@property (nonatomic, strong) VIVideoSource *videoSource
–  addDelegate:

Add call delegate to handle call events.

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

Instance of VICallDelegate delegate

–  removeDelegate:

Remove previously added call delegate.

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

Instance of VICallDelegate delegate

callId

The call id.

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

Array of the endpoints associated with the call.

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

Call statistics. Updated every 5 seconds.

@property (nonatomic, strong, readonly) VICallStat *stat
sendAudio

Enables or disables audio transfer from microphone into the call.

@property (nonatomic, assign) BOOL sendAudio
–  duration

Get the call duration

- (NSTimeInterval)duration
Return

Call duration

–  startWithHeaders:

Start outgoing call

- (void)startWithHeaders:(NSDictionary *)headers
Parameters
headers

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

–  stopWithHeaders:

Terminate established or outgoing processing call.

- (void)stopWithHeaders:(NSDictionary *)headers
Parameters
headers

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

–  setSendVideo:completion:

Start or stop sending video for the call.

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

True if video should be sent, false otherwise

completion

Completion block to handle the result of the operation

–  setHold:completion:

Hold or unhold the call

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

True if the call should be put on hold, false for unhold

completion

Completion block to handle the result of the operation

–  startReceiveVideoWithCompletion:

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

- (void)startReceiveVideoWithCompletion:(VICompletionBlock)completion
Parameters
completion

Completion block to handle the result of operation

–  sendMessage:headers:

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

- (void)sendMessage:(NSString *)message headers:(NSDictionary *)headers
Parameters
message

Message text

headers

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

–  sendInfo:mimeType:headers:

Send INFO message within the call

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

Custom string data

mimeType

MIME type of info

headers

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

–  sendDTMF:

Send DTMF within the call

- (BOOL)sendDTMF:(NSString *)dtmf
Parameters
dtmf

DTMFs

Return

True if DTMFs are sent successfully, false otherwise

–  answerWithSendVideo:receiveVideo:customData:headers:

Answer incoming call.

- (void)answerWithSendVideo:(BOOL)sendVideo receiveVideo:(BOOL)receiveVideo customData:(NSString *)customData headers:(NSDictionary *)headers
Parameters
sendVideo

Specify if video send is enabled for a call

receiveVideo

Specify if video receive is enabled for a call

customData

Optional custom data passed with call. Will be available in VoxEngine scenario

headers

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

–  rejectWithHeaders:

Reject incoming call.

- (void)rejectWithHeaders:(NSDictionary *)headers
Parameters
headers

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

–  hangupWithHeaders:

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

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

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

Streams Methods
localVideoStreams

Local video streams associated with the call

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