Suggestions

close search

StringeeCall2

@interface StringeeCall2 : NSObject

This class provides methods to make/receive a Stringee call2. It contains all data of a call.

callId

The call's id generated by Stringee server.

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

The call's serial generated by Stringee server.

@property (assign, nonatomic, readonly) int serial;
from

The caller's phone number or id.

@property (strong, nonatomic, readonly) NSString *from;
to

The callee's phone number or id.

@property (strong, nonatomic, readonly) NSString *to;
fromAlias

The alias of the caller.

@property (strong, nonatomic, readonly) NSString *fromAlias;
toAlias

The alias of the callee.

@property (strong, nonatomic, readonly) NSString *toAlias;
callType

The type of the call. For more information, see CallType

@property (assign, nonatomic, readonly) CallType callType;
isVideoCall

Whether the call is a video call:
- isVideoCall = YES, a video call
- isVideoCall = NO, a voice call

@property (assign, nonatomic) BOOL isVideoCall;
videoResolution

The local video's resolution. For more information, see VideoResolution

@property (assign, nonatomic) VideoResolution videoResolution;
localVideoView

The view in which the local video is rendered. For more information, see StringeeLocalVideoView

@property (strong, nonatomic, readonly) StringeeLocalVideoView *localVideoView;
remoteVideoView

The view in which the remote video is rendered. For more information, see StringeeRemoteVideoView

@property (strong, nonatomic, readonly) StringeeRemoteVideoView *remoteVideoView;
customData

This is a customizable text of the call. This text will be sent to Stringee server. Then Stringee server sends it to Your Server via the project's answer_url.

@property (strong, nonatomic) NSString *customData;
customDataFromYourServer

The custom data from your server when a client makes a call or receives an incoming call.

@property (strong, nonatomic) NSString *customDataFromYourServer;
- initWithStringeeClient:from:to:

Creates a new Stringeecall instance to answer a call.

- (instancetype)initWithStringeeClient:(StringeeClient *)stringeeClient from:(NSString *)from to:(NSString *)to
- makeCallWithCompletionHandler:

Make a call with a callback:
- status = YES, code = 0, message = "Make call successfully"
- status = NO, code = 1, message = "Make call failed. Answer url is empty"
- status = NO, code = 2, message = "Make call failed. Answer url scco incorrect format"
- status = NO, code = 3, message = "Make call failed. To type is not internal or external"
- status = NO, code = 4, message = "Make call failed. From number not found"
- status = NO, code = 5, message = "Make call failed. From number not belong your account"
- status = NO, code = 6, message = "Make call failed. Sip truck not found"
- status = NO, code = 7, message = "Make call failed. Sip truck not belong your account"
- status = NO, code = 8, message = "Make call failed. Not enough money"
- status = NO, code = 9, message = "Make call failed. Unknow error."
- status = NO, code = 10, message = "Make call failed. The call is not allowed by your server or "to number" is not exist.
- status = NO, code = -1, message = "Make call failed. The client is not connected to Stringee Server"
- data: The custom data from your server.

- (void)makeCallWithCompletionHandler:(void(^)(BOOL status, int code, NSString *message, NSString *data))completionHandler

- initAnswerCall

Initializes an answer. Must be implemented before you can answer a call.

- (void)initAnswerCall;
- answerCallWithCompletionHandler:

Answers a call with a callback:
- status = YES, code = 0, message = "Answer call successfully"
- status = NO, code = 1, message = "Answer call failed. The call is not exist"
- status = NO, code = 2, message = "Answer call failed. The call was controlled from other device"
- status = NO, code = 3, message = "Answer call failed. Call data is not exist"
- status = NO, code = -1, message = "Answer call failed. The client is not connected to Stringee Server."

- (void)answerCallWithCompletionHandler:(void(^)(BOOL status, int code, NSString * message)) completionHandler;
- hangupWithCompletionHandler:

Terminates a call with a callback:
- status = YES, code = 0, message = "Hangup call successfully."
- status = NO, code = 1, message = "Hangup call failed. The call is not exist."
- status = NO, code = 2, message = "Hangup call failed. The call answered on another device."
- status = NO, code = -1, message = "Hangup call failed. The client is not connected to Stringee Server."

- (void)hangupWithCompletionHandler:(void(^)(BOOL status, int code, NSString * message))completionHandler;
- rejectWithCompletionHandler:

Reject a call with a callback:
- status = YES, code = 0, message = "Reject call successfully."
- status = NO, code = 1, message = "Reject call failed. The call is not exist."
- status = NO, code = 2, message = "Reject call failed. The call answered on another device."
- status = NO, code = -1, message = "Reject call failed. The client is not connected to Stringee Server."

- (void)rejectWithCompletionHandler:(void(^)(BOOL status, int code, NSString * message))completionHandler;
- switchCamera

Switches the device's camera.

- (void)switchCamera;
- enableLocalVideo:

Enables or disables local video:
- isEnable = YES enables local video.
- isEnable = NO disables local video.
Returns YES on success or NO on failure.

- (BOOL)enableLocalVideo:(BOOL)isEnable;
- mute:

Toggles audio on or off:
- isMute = YES toggles audio off.
- isMute = NO toggles audio on.

- (void)mute:(BOOL)isMute;
- statsWithCompletionHandler:

Gets the call's statistics.

- (void)statsWithCompletionHandler:
(void (^)( NSDictionary *values ))completionHandler;
- sendCallInfo:completionHandler:

Send info to another client with a callback. Info is a Dictionary which you can define by your self:
- status = YES, code = 0, message = "Send call info successfully."
- status = NO, code = -1, message = "Send call info failed. The client is not connected to Stringee Server"
- status = NO, code = -2, message = "Send call info failed. The call data is not existence
- status = NO, code = -3, message = "Send call info failed. Generic error."

- (void)sendCallInfo:(NSDictionary *)info completionHandler:(void(^)(BOOL status, int code, NSString * message))completionHandler;