Jabber Guest iOS SDK
 All Classes Functions Variables Enumerations Enumerator Properties Groups
CJGuestCall.h
1 //
2 // CJGuestCall.h
3 // JabberGuest
4 //
5 // Copyright (c) 2013 Cisco Systems, Inc. All Rights Reserved.
6 //
7 
8 #import <Foundation/Foundation.h>
9 #import <UIKit/UIKit.h>
10 
11 #import <JabberGuest/CJGuestMediaStatistics.h>
12 
18 @protocol CJGuestInvalidCertCallback<NSObject>
22 - (void)accept;
26 - (void)reject;
27 @end
28 
33 @protocol CJGuestInvalidCertDelegate <NSObject>
34 @optional
45 -(void) onInvalidCert:(NSString*)certFingerprint
46  certSubjectCN:(NSString*)certSubjectCN
47  referenceID:(NSString*)referenceID
48  invalidReason:(NSArray*)invalidReason
49 subjectCertificateData:(NSString*)subjectCertificateData
50 intermediateCACertificateData:(NSArray*)intermediateCACertificateData
51  invalidCertCallback:(id<CJGuestInvalidCertCallback>)invalidCertCallback;
52 @end
53 
54 #pragma mark Notifications
55 
63 extern NSString *const CJGuestCallStateChangeNotification;
69 extern NSString *const CJGuestCallErrorNotification;
74 extern NSString *const CJGuestCallErrorKey;
79 extern NSString *const CJGuestCallSelfVideoResolutionNotification;
89 extern NSString *const CJGuestCallAudioInStateNotification;
94 extern NSString *const CJGuestCallAudioOutStateNotification;
99 extern NSString *const CJGuestCallVideoInStateNotification;
104 extern NSString *const CJGuestCallVideoOutStateNotification;
109 extern NSString *const CJGuestCallOrientationNotification;
114 extern NSString *const CJGuestCallSentDTMFNotification;
118 extern NSString *const CJGuestCallCameraSwitchedNotification;
119 
124 #pragma mark Errors
125 
132 typedef NS_ENUM(NSInteger, CJGuestErrorCode) {
210  /*
211  * The version of the API reported by the Jabber Guest server was invalid.
212  */
213  CJGuestInvalidApiVersionError,
214  /*
215  * The version of the API reported by the Jabber Guest server is not supported with this version of the SDK.
216  */
217  CJGuestUnsupportedApiVersionError
218 };
224 @class CJGuestCall;
225 
238 @interface CJGuestCall : NSObject
239 
250 - (id)init;
251 
252 
260 - (id)initWithServerName:(NSString *)serverName toURI:(NSString *)toURI;
261 
273 @property (nonatomic, readwrite, strong) NSString *serverName;
281 @property (nonatomic, readwrite, strong) NSString *toURI;
282 
295 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * selfView;
296 
300 @property (nonatomic, readonly) CGSize selfSize;
301 
305 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remoteView;
306 
310 @property (nonatomic, readonly) CGSize remoteSize;
311 
316 @property (nonatomic, readwrite) UIDeviceOrientation captureOrientation;
317 
322 - (void)startSelfView;
323 
328 - (void)stopSelfView;
329 
333 - (void)switchCamera;
334 
347 - (void)startCall;
348 
354 - (void)endCall;
355 
368 typedef NS_ENUM(NSInteger, CJGuestCallStateType) {
373 
379 
388 
395 
403 };
407 @property (nonatomic, readonly) CJGuestCallStateType callState;
408 
421 typedef NS_ENUM(NSInteger, CJGuestMuteStateType) {
426 
432 
437 
442 };
443 
447 @property (nonatomic, readonly) CJGuestMuteStateType audioOutState;
451 @property (nonatomic, readonly) CJGuestMuteStateType videoOutState;
455 @property (nonatomic, readonly) CJGuestMuteStateType audioInState;
459 @property (nonatomic, readonly) CJGuestMuteStateType videoInState;
460 
461 
466 @property (nonatomic, readonly, getter = isAudioOutMuted) BOOL audioOutMuted;
471 @property (nonatomic, readonly, getter = isAudioOutUnmuted) BOOL audioOutUnmuted;
476 @property (nonatomic, readonly, getter = isAudioInMuted) BOOL audioInMuted;
481 @property (nonatomic, readonly, getter = isAudioInUnmuted) BOOL audioInUnmuted;
486 @property (nonatomic, readonly, getter = isVideoOutMuted) BOOL videoOutMuted;
491 @property (nonatomic, readonly, getter = isVideoOutUnmuted) BOOL videoOutUnmuted;
496 @property (nonatomic, readonly, getter = isVideoInMuted) BOOL videoInMuted;
501 @property (nonatomic, readonly, getter = isVideoInUnmuted) BOOL videoInUnmuted;
502 
508 - (void)muteAudioOut;
509 
515 - (void)unmuteAudioOut;
516 
522 - (void)muteVideoOut;
523 
529 - (void)unmuteVideoOut;
530 
542 @property (nonatomic, readonly) NSString *sentDTMF;
543 
549 - (void)sendDTMF:(char)dtmf;
550 
558 - (void)sendDTMFString:(NSString *)dtmfString;
559 
573 @property (nonatomic, readwrite, weak) IBOutlet id<CJGuestInvalidCertDelegate> invalidCertDelegate;
574 
578 @property (nonatomic, readonly, getter = isReady) BOOL ready DEPRECATED_ATTRIBUTE;
579 
583 @property (nonatomic, readonly, weak) CJGuestAudioStatistics * audioStatistics;
584 
588 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * videoStatistics;
589 
594 @property (nonatomic, readonly, weak) NSString * htmlCallStatistics;
595 
596 
606 - (void)audioSetActive:(BOOL) active;
607 
608 
613 typedef NS_ENUM(NSInteger, CJGuestNetworkStatus) {
614  CJGuestNetworkStatus_Unknown,
615  CJGuestNetworkStatus_Online,
616  CJGuestNetworkStatus_Changed,
617  CJGuestNetworkStatus_Offline
618 };
619 
625 - (void)updateNetworkStatus:(CJGuestNetworkStatus) networkStatus;
626 
636 
643 + (NSDictionary *)parseQueryString:(NSString *)query;
644 
649 + (NSArray * )getAllLogs;
650 
657 +(NSString*)stringFromCallState:(CJGuestCallStateType)state;
658 
665 +(NSString*)stringFromMuteState:(CJGuestMuteStateType)state;
666 @end