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 #import <JabberGuest/CJGuestVideoLicense.h>
13 
19 @protocol CJGuestInvalidCertCallback<NSObject>
23 - (void)accept;
27 - (void)reject;
28 @end
29 
34 @protocol CJGuestInvalidCertDelegate <NSObject>
35 @optional
46 -(void) onInvalidCert:(NSString*)certFingerprint
47  certSubjectCN:(NSString*)certSubjectCN
48  referenceID:(NSString*)referenceID
49  invalidReason:(NSArray*)invalidReason
50 subjectCertificateData:(NSString*)subjectCertificateData
51 intermediateCACertificateData:(NSArray*)intermediateCACertificateData
52  invalidCertCallback:(id<CJGuestInvalidCertCallback>)invalidCertCallback;
53 @end
54 
55 #pragma mark Notifications
56 
64 extern NSString *const CJGuestCallStateChangeNotification;
70 extern NSString *const CJGuestCallErrorNotification;
75 extern NSString *const CJGuestCallErrorKey;
80 extern NSString *const CJGuestCallSelfVideoResolutionNotification;
90 extern NSString *const CJGuestCallAudioInStateNotification;
95 extern NSString *const CJGuestCallAudioOutStateNotification;
100 extern NSString *const CJGuestCallVideoInStateNotification;
105 extern NSString *const CJGuestCallVideoOutStateNotification;
110 extern NSString *const CJGuestCallOrientationNotification;
115 extern NSString *const CJGuestCallSentDTMFNotification;
119 extern NSString *const CJGuestCallCameraSwitchedNotification;
120 
125 #pragma mark Errors
126 
133 typedef NS_ENUM(NSInteger, CJGuestErrorCode) {
211  /*
212  * The version of the API reported by the Jabber Guest server was invalid.
213  */
214  CJGuestInvalidApiVersionError,
215  /*
216  * The version of the API reported by the Jabber Guest server is not supported with this version of the SDK.
217  */
218  CJGuestUnsupportedApiVersionError
219 };
225 @class CJGuestCall;
226 
239 @interface CJGuestCall : NSObject
240 
251 - (id)init;
252 
253 
261 - (id)initWithServerName:(NSString *)serverName toURI:(NSString *)toURI;
262 
274 @property (nonatomic, readwrite, strong) NSString *serverName;
282 @property (nonatomic, readwrite, strong) NSString *toURI;
283 
296 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * selfView;
297 
301 @property (nonatomic, readonly) CGSize selfSize;
302 
306 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remoteView;
307 
311 @property (nonatomic, readonly) CGSize remoteSize;
312 
317 @property (nonatomic, readwrite) UIDeviceOrientation captureOrientation;
318 
319 #if 0
320 
325 - (BOOL)startSelfView;
326 #endif
327 
333 - (void)startSelfView:(CJGuestVideoLicenseCompletion) completion;
334 
339 - (void)stopSelfView;
340 
344 - (void)switchCamera;
345 
355 #if 0
356 
361 - (BOOL)startCall;
362 #endif
363 
369 - (void)startCall:(CJGuestVideoLicenseCompletion) completion;
370 
376 - (void)endCall;
377 
390 typedef NS_ENUM(NSInteger, CJGuestCallStateType) {
395 
401 
410 
417 
425 };
429 @property (nonatomic, readonly) CJGuestCallStateType callState;
430 
443 typedef NS_ENUM(NSInteger, CJGuestMuteStateType) {
448 
454 
459 
464 };
465 
469 @property (nonatomic, readonly) CJGuestMuteStateType audioOutState;
473 @property (nonatomic, readonly) CJGuestMuteStateType videoOutState;
477 @property (nonatomic, readonly) CJGuestMuteStateType audioInState;
481 @property (nonatomic, readonly) CJGuestMuteStateType videoInState;
482 
483 
488 @property (nonatomic, readonly, getter = isAudioOutMuted) BOOL audioOutMuted;
493 @property (nonatomic, readonly, getter = isAudioOutUnmuted) BOOL audioOutUnmuted;
498 @property (nonatomic, readonly, getter = isAudioInMuted) BOOL audioInMuted;
503 @property (nonatomic, readonly, getter = isAudioInUnmuted) BOOL audioInUnmuted;
508 @property (nonatomic, readonly, getter = isVideoOutMuted) BOOL videoOutMuted;
513 @property (nonatomic, readonly, getter = isVideoOutUnmuted) BOOL videoOutUnmuted;
518 @property (nonatomic, readonly, getter = isVideoInMuted) BOOL videoInMuted;
523 @property (nonatomic, readonly, getter = isVideoInUnmuted) BOOL videoInUnmuted;
524 
530 - (void)muteAudioOut;
531 
537 - (void)unmuteAudioOut;
538 
544 - (void)muteVideoOut;
545 
551 - (void)unmuteVideoOut;
552 
564 @property (nonatomic, readonly) NSString *sentDTMF;
565 
571 - (void)sendDTMF:(char)dtmf;
572 
580 - (void)sendDTMFString:(NSString *)dtmfString;
581 
595 @property (nonatomic, readwrite, weak) IBOutlet id<CJGuestInvalidCertDelegate> invalidCertDelegate;
596 
600 @property (nonatomic, readonly, getter = isReady) BOOL ready DEPRECATED_ATTRIBUTE;
601 
605 @property (nonatomic, readonly, weak) CJGuestAudioStatistics * audioStatistics;
606 
610 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * videoStatistics;
611 
616 @property (nonatomic, readonly, weak) NSString * htmlCallStatistics;
617 
618 
628 - (void)audioSetActive:(BOOL) active;
629 
630 
635 typedef NS_ENUM(NSInteger, CJGuestNetworkStatus) {
636  CJGuestNetworkStatus_Unknown,
637  CJGuestNetworkStatus_Online,
638  CJGuestNetworkStatus_Changed,
639  CJGuestNetworkStatus_Offline
640 };
641 
647 - (void)updateNetworkStatus:(CJGuestNetworkStatus) networkStatus;
648 
658 
665 + (NSDictionary *)parseQueryString:(NSString *)query;
666 
671 + (NSArray * )getAllLogs;
672 
679 +(NSString*)stringFromCallState:(CJGuestCallStateType)state;
680 
687 +(NSString*)stringFromMuteState:(CJGuestMuteStateType)state;
688 @end