Jabber Guest iOS SDK
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 
35 @protocol CJGuestServerConfiguraionCallDelegate <NSObject>
36 @optional
41 -(void) serverConfiguraionDidRetriveWithScheduledCallInfo:(NSInteger)secs;
42 
46 -(void) scheduledCallDidExecute;
47 
51 - (void)allServerConfigurationDidRetrieve;
52 @end
53 
58 @protocol CJGuestInvalidCertDelegate <NSObject>
59 @optional
71 - (void) onInvalidCert:(NSString*)certFingerprint
72  certSubjectCN:(NSString*)certSubjectCN
73  referenceID:(NSString*)referenceID
74  invalidReason:(NSArray*)invalidReason
75 subjectCertificateData:(NSString*)subjectCertificateData
76 intermediateCACertificateData:(NSArray*)intermediateCACertificateData
77  invalidCertCallback:(id <CJGuestInvalidCertCallback>)invalidCertCallback;
78 @end
79 
80 #pragma mark Notifications
81 
89 extern NSString *const CJGuestCallStateChangeNotification;
95 extern NSString *const CJGuestCallErrorNotification;
100 extern NSString *const CJGuestCallErrorKey;
105 extern NSString *const CJGuestCallSelfVideoResolutionNotification;
110 extern NSString *const CJGuestCallRemoteVideoResolutionNotification;
120 extern NSString *const CJGuestCallRemotePresoVideoActiveNotification;
125 extern NSString *const CJGuestCallSelfVideoActiveNotification;
135 extern NSString *const CJGuestCallAudioInStateNotification;
140 extern NSString *const CJGuestCallAudioOutStateNotification;
145 extern NSString *const CJGuestCallVideoInStateNotification;
150 extern NSString *const CJGuestCallVideoOutStateNotification;
155 extern NSString *const CJGuestCallOrientationNotification;
160 extern NSString *const CJGuestCallSentDTMFNotification;
164 extern NSString *const CJGuestCallCameraSwitchedNotification;
168 extern NSString *const CJGuestCallServerVersionNotification;
173 
174 
175 
180 #pragma mark Errors
181 
188 typedef NS_ENUM(NSInteger, CJGuestErrorCode) {
266  /*
267  * The version of the API reported by the Jabber Guest server was invalid.
268  */
269  CJGuestInvalidApiVersionError,
270  /*
271  * The version of the API reported by the Jabber Guest server is not supported with this version of the SDK.
272  */
273  CJGuestUnsupportedApiVersionError
274 };
280 @class CJGuestCall;
281 
295 @interface CJGuestCall : NSObject
296 
307 - (id)init;
308 
309 
318 - (id)initWithServerName:(NSString *)serverName toURI:(NSString *)toURI callerName:(NSString*)callerName;
319 
331 @property (nonatomic, readwrite, strong) NSString *serverName;
339 @property (nonatomic, readwrite, strong) NSString *toURI;
343 @property (nonatomic, readwrite, strong) NSString *fullServerUrl;
344 
348 @property (nonatomic, readonly) NSString *remoteDisplayName;
349 
353 @property (nonatomic, readwrite) NSString *callerName;
354 
355 
368 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * selfView;
369 
373 @property (nonatomic, readonly) CGSize selfSize;
374 
378 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remoteView;
379 
383 @property (nonatomic, readonly) CGSize remoteSize;
384 
388 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remotePresoView;
389 
393 @property (nonatomic, readonly) CGSize remotePresoSize;
394 
398 @property (nonatomic, readonly) BOOL remotePresoActive;
399 
403 @property (nonatomic, readonly) BOOL selfVideoActive;
404 
408 @property (nonatomic, readonly) BOOL remotePresoStarted;
409 
414 @property (nonatomic, readwrite) UIInterfaceOrientation captureOrientation;
415 
416 #if 0
417 
422 - (BOOL)startSelfView;
423 #endif
424 
430 - (void)startSelfView:(CJGuestVideoLicenseCompletion) completion;
431 
436 - (void)stopSelfView;
437 
441 - (void)switchCamera;
442 
452 #if 0
453 
458 - (BOOL)startCall;
459 #endif
460 
466 - (void)startCall:(CJGuestVideoLicenseCompletion) completion;
467 
473 - (void)endCall;
474 
478 - (void)cancelAutoStartCall;
479 
492 typedef NS_ENUM(NSInteger, CJGuestCallStateType) {
497 
503 
512 
519 
527 };
531 @property (nonatomic, readonly) CJGuestCallStateType callState;
532 
545 typedef NS_ENUM(NSInteger, CJGuestMuteStateType) {
550 
556 
561 
566 };
567 
571 @property (nonatomic, readonly) CJGuestMuteStateType audioOutState;
575 @property (nonatomic, readonly) CJGuestMuteStateType videoOutState;
579 @property (nonatomic, readonly) CJGuestMuteStateType audioInState;
583 @property (nonatomic, readonly) CJGuestMuteStateType videoInState;
584 
585 
590 @property (nonatomic, readonly, getter = isAudioOutMuted) BOOL audioOutMuted;
595 @property (nonatomic, readonly, getter = isAudioOutUnmuted) BOOL audioOutUnmuted;
600 @property (nonatomic, readonly, getter = isAudioInMuted) BOOL audioInMuted;
605 @property (nonatomic, readonly, getter = isAudioInUnmuted) BOOL audioInUnmuted;
610 @property (nonatomic, readonly, getter = isVideoOutMuted) BOOL videoOutMuted;
615 @property (nonatomic, readonly, getter = isVideoOutUnmuted) BOOL videoOutUnmuted;
619 @property (nonatomic, readonly, getter = isVideoControlEnabled) BOOL videoControlEnabled;
624 @property (nonatomic, readonly, getter = isVideoInMuted) BOOL videoInMuted;
629 @property (nonatomic, readonly, getter = isVideoInUnmuted) BOOL videoInUnmuted;
630 
636 - (void)muteAudioOut;
637 
643 - (void)unmuteAudioOut;
644 
650 - (void)muteVideoOut;
651 
657 - (void)unmuteVideoOut;
658 
670 @property (nonatomic, readonly) NSString *sentDTMF;
671 
677 - (void)sendDTMF:(char)dtmf;
678 
686 - (void)sendDTMFString:(NSString *)dtmfString;
687 
701 @property (nonatomic, readwrite, weak) IBOutlet id <CJGuestInvalidCertDelegate> invalidCertDelegate;
702 
708 @property (nonatomic, readwrite, weak) IBOutlet id <CJGuestServerConfiguraionCallDelegate> autoStartCallDelegate;
709 
713 @property (nonatomic, readonly, getter = isReady) BOOL ready DEPRECATED_ATTRIBUTE;
714 
718 @property (nonatomic, readonly, weak) CJGuestAudioStatistics * audioStatistics;
719 
723 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * videoStatistics;
724 
728 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * shareStatistics;
729 
730 
735 @property (nonatomic, readonly, weak) NSString * htmlCallStatistics;
736 
746 - (void)audioSetActive:(BOOL) active;
747 
748 
753 typedef NS_ENUM(NSInteger, CJGuestNetworkStatus) {
754  CJGuestNetworkStatus_Unknown,
755  CJGuestNetworkStatus_Online,
756  CJGuestNetworkStatus_Changed,
757  CJGuestNetworkStatus_Offline
758 };
759 
765 - (void)updateNetworkStatus:(CJGuestNetworkStatus) networkStatus;
766 
776 
783 + (NSDictionary *)parseQueryString:(NSString *)query;
784 
789 + (NSArray * )getAllLogs;
790 
797 + (NSString*)stringFromCallState:(CJGuestCallStateType)state;
798 
805 + (NSString*)stringFromMuteState:(CJGuestMuteStateType)state;
806 
807 
812 + (void)setGlobalLoggingEnabled:(BOOL)enabled;
813 
814 @end
The destination was busy.
Definition: CJGuestCall.h:228
CJGuestMuteStateType audioInState
Represents the mute state of the audio being received by the local end point.
Definition: CJGuestCall.h:579
CJGuestVideoStatistics * videoStatistics
Provides access to the video stream statistics.
Definition: CJGuestCall.h:723
CJGuestMuteStateType audioOutState
Represents the mute state of the audio being sent to the remote end point.
Definition: CJGuestCall.h:571
CJGuestMuteStateType
Muting or unmuting a media stream requires some coordination between resources, so the state of the m...
Definition: CJGuestCall.h:545
NSString * callerName
Guest caller name displayed on remote destination.
Definition: CJGuestCall.h:353
NSString *const CJGuestCallErrorKey
The key for the value in the userInfo dictionary of the NSNotification received from the CJGuestCallE...
Definition: CJGuestCall.mm:67
An http error.
Definition: CJGuestCall.h:256
The ICE negotiation failed.
Definition: CJGuestCall.h:220
NSString * fullServerUrl
The whole url including server name, protocol, toURI and also some prefeteched configuration from ser...
Definition: CJGuestCall.h:343
The Jabber Guest server encountered a SIP error.
Definition: CJGuestCall.h:192
An undefined error.
Definition: CJGuestCall.h:265
BOOL videoOutUnmuted
Convenience property for determining whether the video output is unmuted.
Definition: CJGuestCall.h:615
BOOL remotePresoActive
The active state of the remotePreso video stream.
Definition: CJGuestCall.h:398
The URI was invalid.
Definition: CJGuestCall.h:200
void muteVideoOut()
Start the process of muting the video output.
Definition: CJGuestCall.mm:994
The media gateway is not defined.
Definition: CJGuestCall.h:212
The URI was not found.
Definition: CJGuestCall.h:240
The server was busy and could no resource allocation failed.
Definition: CJGuestCall.h:216
void endCall()
After calling startCall() to establish the call with the remote endpoint, call this method to end the...
Definition: CJGuestCall.mm:956
This class holds parameters specific to the audio stream of the call.
Definition: CJGuestMediaStatistics.m:64
An invalid call state.
Definition: CJGuestCall.h:232
There was a network error.
Definition: CJGuestCall.h:261
BOOL videoInUnmuted
Convenience property for determining whether the video input is unmuted.
Definition: CJGuestCall.h:629
CJGuestCall * sharedInstance()
This method returns the active call instance.
Definition: CJGuestCall.mm:331
CJGuestCall is not communicating with any remote endpoints and is ready to establish a new communicat...
Definition: CJGuestCall.h:502
The URI was invalid.
Definition: CJGuestCall.h:208
CJGuestCallStateType
This identifies the progress of the call as the call is established with the remote endpoint...
Definition: CJGuestCall.h:492
BOOL audioInMuted
Convenience property for determining whether the audio input is muted.
Definition: CJGuestCall.h:600
A TURN error.
Definition: CJGuestCall.h:236
NSString *const CJGuestCallRemoteDisplayNameChangedNotification
Register for this event to be notified of the remote participant display name.
Definition: CJGuestCall.mm:65
CGSize selfSize
The size of the self view video image.
Definition: CJGuestCall.h:373
The media stream is muted, no media is passing.
Definition: CJGuestCall.h:549
The URI is not active.
Definition: CJGuestCall.h:244
void stopSelfView()
This will stop capturing video from the local capture device and sending the video to the selfView if...
Definition: CJGuestCall.mm:724
NSString *const CJGuestCallSentDTMFNotification
Register for this event to be notified when a DTMF is sent to the remote endpoint.
Definition: CJGuestCall.mm:63
NSString *const CJGuestCallAudioOutStateNotification
Register for this event to be notified when the audio output mute state changes.
Definition: CJGuestCall.mm:58
NSString *const CJGuestCallErrorNotification
Register for this event to be notified when an error occurs during call processing.
Definition: CJGuestCall.mm:50
void unmuteAudioOut()
Start the process of unmuting the audio output.
Definition: CJGuestCall.mm:990
BOOL ready DEPRECATED_ATTRIBUTE
Indicates the call is ready and active (it is not disconnected).
Definition: CJGuestCall.h:713
NSString * htmlCallStatistics
Provides an HTML formatted view of the audio and video statistics for display in a web view...
Definition: CJGuestCall.h:735
The media stream is unmuted, media is passing.
Definition: CJGuestCall.h:560
CJGuestCall has not been initialized with a valid server name.
Definition: CJGuestCall.h:496
void cancelAutoStartCall()
When a automatic-start call is scheduled, call this to cancel the scheduled call. ...
Definition: CJGuestCall.mm:963
NSString * serverName
The server name through which we will establish this call.
Definition: CJGuestCall.h:331
CJGuestCall instance is currently connected to the called party from the URI that it was given...
Definition: CJGuestCall.h:518
CJGuestMuteStateType videoOutState
Represents the mute state of the video being sent to the remote end point.
Definition: CJGuestCall.h:575
NSArray * getAllLogs()
Returns an array of file names corresponding to the log files that exist on the device.
Definition: CJGuestCall.mm:341
CJGuestErrorCode
The error codes for the Jabber Guest Error Domain.
Definition: CJGuestCall.h:188
NSString *const CJGuestCallRemotePresoVideoStartedNotification
Register for this event to be notified when the first frame of the remotePreso video is received...
Definition: CJGuestCall.mm:56
BOOL selfVideoActive
The active state of the self video stream.
Definition: CJGuestCall.h:403
void switchCamera()
Cycle the local capture device to the next available one.
Definition: CJGuestCall.mm:969
The media stream is transitioning to the muted state and may be passing media.
Definition: CJGuestCall.h:565
id init()
Initializes an instance of CJGuestCall.
Definition: CJGuestCall.mm:372
NSString * remoteDisplayName
The remote participant display name from server.
Definition: CJGuestCall.h:348
NSString *const CJGuestCallStateChangeNotification
Register for this event to be notified when the call state changes.
Definition: CJGuestCall.mm:49
NSString * sentDTMF
Provides a string representation of the last DTMF digit sent.
Definition: CJGuestCall.h:670
The media stream is transitioning to the unmuted state and may not be passing media.
Definition: CJGuestCall.h:555
This class holds parameters specific to the video stream of the call.
Definition: CJGuestMediaStatistics.m:75
BOOL audioOutUnmuted
Convenience property for determining whether the audio output is unmuted.
Definition: CJGuestCall.h:595
There Jabber Guest server encountered an exception.
Definition: CJGuestCall.h:196
BOOL audioOutMuted
Convenience property for determining whether the audio output is muted.
Definition: CJGuestCall.h:590
NSString *const CJGuestCallServerVersionNotification
Register for this event to be notified of the server version.
Definition: CJGuestCall.mm:64
CGSize remoteSize
The size of the remote video image.
Definition: CJGuestCall.h:383
NSString *const CJGuestCallRemotePresoVideoActiveNotification
Register for this event to be notified when the active state of the remotePreso view video changes...
Definition: CJGuestCall.mm:54
BOOL videoOutMuted
Convenience property for determining whether the video output is muted.
Definition: CJGuestCall.h:610
NSString *const CJGuestCallVideoInStateNotification
Register for this event to be notified when the video input mute state changes.
Definition: CJGuestCall.mm:59
NSString *const CJGuestCallOrientationNotification
Register for this event to be notified when the orientation of the remote view video changes...
Definition: CJGuestCall.mm:61
NSString *const CJGuestCallRemotePresoVideoResolutionNotification
Register for this event to be notified when the size of the remotePreso view video changes...
Definition: CJGuestCall.mm:53
BOOL videoInMuted
Convenience property for determining whether the video input is muted.
Definition: CJGuestCall.h:624
NSString *const CJGuestCallSelfVideoActiveNotification
Register for this event to be notified when the active state of the self view video changes...
Definition: CJGuestCall.mm:55
NSString *const CJGuestCallVideoOutStateNotification
Register for this event to be notified when the video output mute state changes.
Definition: CJGuestCall.mm:60
CJGuestCallStateType callState
Indicates the current state of the call.
Definition: CJGuestCall.h:531
IBOutlet UIImageView * selfView
The selfView will be updated with video from the camera on the device, providing feedback so the user...
Definition: CJGuestCall.h:368
The URI has been disabled.
Definition: CJGuestCall.h:252
NSString *const CJGuestCallCameraSwitchedNotification
Register for this event to be notified when the video capture device is changed.
Definition: CJGuestCall.mm:62
NSString *const CJGuestCallAudioInStateNotification
Register for this event to be notified when the audio input mute state changes.
Definition: CJGuestCall.mm:57
NSString * toURI
The URI of the remote end point to which the call should be established.
Definition: CJGuestCall.h:339
CJGuestAudioStatistics * audioStatistics
Provides access to the audio stream statistics.
Definition: CJGuestCall.h:718
void muteAudioOut()
Start the process of muting the audio output.
Definition: CJGuestCall.mm:986
CJGuestVideoStatistics * shareStatistics
Provides access to the share stream statistics.
Definition: CJGuestCall.h:728
IBOutlet id< CJGuestServerConfiguraionCallDelegate > autoStartCallDelegate
This delegate is called when server enable automatically start call feature.
Definition: CJGuestCall.h:708
IBOutlet UIImageView * remotePresoView
This will be updated with video sent from the remotePreso endpoint of the call.
Definition: CJGuestCall.h:388
The URI has expired.
Definition: CJGuestCall.h:248
NSString *const CJGuestCallRemoteVideoResolutionNotification
Register for this event to be notified when the size of the remote view video changes.
Definition: CJGuestCall.mm:52
NSString *const CJGuestCallSelfVideoResolutionNotification
Register for this event to be notified when the size of the self view video changes.
Definition: CJGuestCall.mm:51
IBOutlet id< CJGuestInvalidCertDelegate > invalidCertDelegate
This delegate is called when HTTP requests encounter problems verifying the certificate for a web sit...
Definition: CJGuestCall.h:701
There was a networking error between the device and the server.
Definition: CJGuestCall.h:204
CJGuestMuteStateType videoInState
Represents the mute state of the video being received by the local end point.
Definition: CJGuestCall.h:583
CJGuestCall is trying to connect a call to the called party from the URI that it was given...
Definition: CJGuestCall.h:511
CJGuestCall instance is either attempting to end an active call at the request of the device user...
Definition: CJGuestCall.h:526
BOOL remotePresoStarted
The active state of the remotePreso video stream.
Definition: CJGuestCall.h:408
This is the main class of the Jabber Guest iOS SDK.
Definition: CJGuestCall.mm:321
IBOutlet UIImageView * remoteView
This will be updated with video sent from the remote endpoint of the call.
Definition: CJGuestCall.h:378
BOOL audioInUnmuted
Convenience property for determining whether the audio input is unmuted.
Definition: CJGuestCall.h:605
BOOL videoControlEnabled
Convenience property for determining whether the video ouput control is disabled by policy from serve...
Definition: CJGuestCall.h:619
There was an error in the SIP configuration.
Definition: CJGuestCall.h:224
CGSize remotePresoSize
The size of the remotePreso video image.
Definition: CJGuestCall.h:393
void unmuteVideoOut()
Start the process of unmuting the video output.
Definition: CJGuestCall.mm:998
UIInterfaceOrientation captureOrientation
Indicates the orientation of the device so the video capture can compensate and send the video in the...
Definition: CJGuestCall.h:414