| Jabber Guest iOS SDK

- Main Page
- Modules
- Classes

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
47 - (void) onInvalidCert:(NSString*)certFingerprint
48 certSubjectCN:(NSString*)certSubjectCN
49 referenceID:(NSString*)referenceID
50 invalidReason:(NSArray*)invalidReason
51 subjectCertificateData:(NSString*)subjectCertificateData
52 intermediateCACertificateData:(NSArray*)intermediateCACertificateData
53 invalidCertCallback:(id <CJGuestInvalidCertCallback>)invalidCertCallback;
54 @end
55
56 #pragma mark Notifications
57
65 extern NSString *const CJGuestCallStateChangeNotification;
71 extern NSString *const CJGuestCallErrorNotification;
76 extern NSString *const CJGuestCallErrorKey;
81 extern NSString *const CJGuestCallSelfVideoResolutionNotification;
86 extern NSString *const CJGuestCallRemoteVideoResolutionNotification;
91 extern NSString *const CJGuestCallAudioInStateNotification;
96 extern NSString *const CJGuestCallAudioOutStateNotification;
101 extern NSString *const CJGuestCallVideoInStateNotification;
106 extern NSString *const CJGuestCallVideoOutStateNotification;
111 extern NSString *const CJGuestCallOrientationNotification;
116 extern NSString *const CJGuestCallSentDTMFNotification;
120 extern NSString *const CJGuestCallCameraSwitchedNotification;
121
126 #pragma mark Errors
127
134 typedef NS_ENUM(NSInteger, CJGuestErrorCode) {
138 CJGuestSipError = 1,
142 CJGuestRoapExceptionError,
146 CJGuestBlankSipUriError,
150 CJGuestBlankSdpError,
154 CJGuestInvalidSipUriError,
158 CJGuestMediaGatewayUndefinedError,
162 CJGuestMediaGatewayAllocationFailedError,
166 CJGuestMediaGatewayIceFailedError,
170 CJGuestSipConfigurationError,
174 CJGuestSipEndpointBusyError,
178 CJGuestInvalidCallStateError,
182 CJGuestTurnCredAcquireFailedError,
186 CJGuestLinkNotFoundError = 50,
190 CJGuestLinkNotValidYetError,
194 CJGuestLinkExpiredError,
198 CJGuestLinkDisabledError,
202 CJGuestHttpError = 1000,
207 CJGuestNetError,
211 CJGuestUnknownError,
212 /*
213 * The version of the API reported by the Jabber Guest server was invalid.
214 */
215 CJGuestInvalidApiVersionError,
216 /*
217 * The version of the API reported by the Jabber Guest server is not supported with this version of the SDK.
218 */
219 CJGuestUnsupportedApiVersionError
220 };
226 @class CJGuestCall;
227
240 @interface CJGuestCall : NSObject
241
252 - (id)init;
253
254
262 - (id)initWithServerName:(NSString *)serverName toURI:(NSString *)toURI;
263
275 @property (nonatomic, readwrite, strong) NSString *serverName;
283 @property (nonatomic, readwrite, strong) NSString *toURI;
284
297 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * selfView;
298
302 @property (nonatomic, readonly) CGSize selfSize;
303
307 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remoteView;
308
312 @property (nonatomic, readonly) CGSize remoteSize;
313
318 @property (nonatomic, readwrite) UIDeviceOrientation captureOrientation;
319
320 #if 0
321
326 - (BOOL)startSelfView;
327 #endif
328
334 - (void)startSelfView:(CJGuestVideoLicenseCompletion) completion;
335
340 - (void)stopSelfView;
341
345 - (void)switchCamera;
346
356 #if 0
357
362 - (BOOL)startCall;
363 #endif
364
370 - (void)startCall:(CJGuestVideoLicenseCompletion) completion;
371
377 - (void)endCall;
378
391 typedef NS_ENUM(NSInteger, CJGuestCallStateType) {
395 GuestCallStateNotInitialized,
396
401 GuestCallStateDisconnected,
402
410 GuestCallStateConnecting,
411
417 GuestCallStateConnected,
418
425 GuestCallStateDisconnecting
426 };
430 @property (nonatomic, readonly) CJGuestCallStateType callState;
431
444 typedef NS_ENUM(NSInteger, CJGuestMuteStateType) {
448 GuestMuteStateMuted,
449
454 GuestMuteStateUnmuting,
455
459 GuestMuteStateUnmuted,
460
464 GuestMuteStateMuting
465 };
466
470 @property (nonatomic, readonly) CJGuestMuteStateType audioOutState;
474 @property (nonatomic, readonly) CJGuestMuteStateType videoOutState;
478 @property (nonatomic, readonly) CJGuestMuteStateType audioInState;
482 @property (nonatomic, readonly) CJGuestMuteStateType videoInState;
483
484
489 @property (nonatomic, readonly, getter = isAudioOutMuted) BOOL audioOutMuted;
494 @property (nonatomic, readonly, getter = isAudioOutUnmuted) BOOL audioOutUnmuted;
499 @property (nonatomic, readonly, getter = isAudioInMuted) BOOL audioInMuted;
504 @property (nonatomic, readonly, getter = isAudioInUnmuted) BOOL audioInUnmuted;
509 @property (nonatomic, readonly, getter = isVideoOutMuted) BOOL videoOutMuted;
514 @property (nonatomic, readonly, getter = isVideoOutUnmuted) BOOL videoOutUnmuted;
519 @property (nonatomic, readonly, getter = isVideoInMuted) BOOL videoInMuted;
524 @property (nonatomic, readonly, getter = isVideoInUnmuted) BOOL videoInUnmuted;
525
531 - (void)muteAudioOut;
532
538 - (void)unmuteAudioOut;
539
545 - (void)muteVideoOut;
546
552 - (void)unmuteVideoOut;
553
565 @property (nonatomic, readonly) NSString *sentDTMF;
566
572 - (void)sendDTMF:(char)dtmf;
573
581 - (void)sendDTMFString:(NSString *)dtmfString;
582
596 @property (nonatomic, readwrite, weak) IBOutlet id <CJGuestInvalidCertDelegate> invalidCertDelegate;
597
601 @property (nonatomic, readonly, getter = isReady) BOOL ready DEPRECATED_ATTRIBUTE;
602
606 @property (nonatomic, readonly, weak) CJGuestAudioStatistics * audioStatistics;
607
611 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * videoStatistics;
612
617 @property (nonatomic, readonly, weak) NSString * htmlCallStatistics;
618
619
629 - (void)audioSetActive:(BOOL) active;
630
631
636 typedef NS_ENUM(NSInteger, CJGuestNetworkStatus) {
637 CJGuestNetworkStatus_Unknown,
638 CJGuestNetworkStatus_Online,
639 CJGuestNetworkStatus_Changed,
640 CJGuestNetworkStatus_Offline
641 };
642
648 - (void)updateNetworkStatus:(CJGuestNetworkStatus) networkStatus;
649
658 + (CJGuestCall *)sharedInstance;
659
666 + (NSDictionary *)parseQueryString:(NSString *)query;
667
672 + (NSArray * )getAllLogs;
673
680 + (NSString*)stringFromCallState:(CJGuestCallStateType)state;
681
688 + (NSString*)stringFromMuteState:(CJGuestMuteStateType)state;
689
690 @end