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 
36 @optional
41 -(void) serverConfiguraionDidRetriveWithScheduledCallInfo:(NSInteger)secs;
46 @end
47 
52 @protocol CJGuestInvalidCertDelegate <NSObject>
53 @optional
65 - (void) onInvalidCert:(NSString*)certFingerprint
66  certSubjectCN:(NSString*)certSubjectCN
67  referenceID:(NSString*)referenceID
68  invalidReason:(NSArray*)invalidReason
69 subjectCertificateData:(NSString*)subjectCertificateData
70 intermediateCACertificateData:(NSArray*)intermediateCACertificateData
71  invalidCertCallback:(id <CJGuestInvalidCertCallback>)invalidCertCallback;
72 @end
73 
74 #pragma mark Notifications
75 
83 extern NSString *const CJGuestCallStateChangeNotification;
89 extern NSString *const CJGuestCallErrorNotification;
94 extern NSString *const CJGuestCallErrorKey;
99 extern NSString *const CJGuestCallSelfVideoResolutionNotification;
104 extern NSString *const CJGuestCallRemoteVideoResolutionNotification;
114 extern NSString *const CJGuestCallRemotePresoVideoActiveNotification;
119 extern NSString *const CJGuestCallSelfVideoActiveNotification;
129 extern NSString *const CJGuestCallAudioInStateNotification;
134 extern NSString *const CJGuestCallAudioOutStateNotification;
139 extern NSString *const CJGuestCallVideoInStateNotification;
144 extern NSString *const CJGuestCallVideoOutStateNotification;
149 extern NSString *const CJGuestCallOrientationNotification;
154 extern NSString *const CJGuestCallSentDTMFNotification;
158 extern NSString *const CJGuestCallCameraSwitchedNotification;
162 extern NSString *const CJGuestCallServerVersionNotification;
163 
168 #pragma mark Errors
169 
176 typedef NS_ENUM(NSInteger, CJGuestErrorCode) {
254  /*
255  * The version of the API reported by the Jabber Guest server was invalid.
256  */
257  CJGuestInvalidApiVersionError,
258  /*
259  * The version of the API reported by the Jabber Guest server is not supported with this version of the SDK.
260  */
261  CJGuestUnsupportedApiVersionError
262 };
268 @class CJGuestCall;
269 
283 @interface CJGuestCall : NSObject
284 
295 - (id)init;
296 
297 
305 - (id)initWithServerName:(NSString *)serverName toURI:(NSString *)toURI;
306 
318 @property (nonatomic, readwrite, strong) NSString *serverName;
326 @property (nonatomic, readwrite, strong) NSString *toURI;
327 
340 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * selfView;
341 
345 @property (nonatomic, readonly) CGSize selfSize;
346 
350 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remoteView;
351 
355 @property (nonatomic, readonly) CGSize remoteSize;
356 
360 @property (nonatomic, readwrite, strong) IBOutlet UIImageView * remotePresoView;
361 
365 @property (nonatomic, readonly) CGSize remotePresoSize;
366 
370 @property (nonatomic, readonly) BOOL remotePresoActive;
371 
375 @property (nonatomic, readonly) BOOL selfVideoActive;
376 
380 @property (nonatomic, readonly) BOOL remotePresoStarted;
381 
386 @property (nonatomic, readwrite) UIInterfaceOrientation captureOrientation;
387 
388 #if 0
389 
394 - (BOOL)startSelfView;
395 #endif
396 
402 - (void)startSelfView:(CJGuestVideoLicenseCompletion) completion;
403 
408 - (void)stopSelfView;
409 
413 - (void)switchCamera;
414 
424 #if 0
425 
430 - (BOOL)startCall;
431 #endif
432 
438 - (void)startCall:(CJGuestVideoLicenseCompletion) completion;
439 
445 - (void)endCall;
446 
450 - (void)cancelAutoStartCall;
451 
464 typedef NS_ENUM(NSInteger, CJGuestCallStateType) {
469 
475 
484 
491 
499 };
503 @property (nonatomic, readonly) CJGuestCallStateType callState;
504 
517 typedef NS_ENUM(NSInteger, CJGuestMuteStateType) {
522 
528 
533 
538 };
539 
543 @property (nonatomic, readonly) CJGuestMuteStateType audioOutState;
547 @property (nonatomic, readonly) CJGuestMuteStateType videoOutState;
551 @property (nonatomic, readonly) CJGuestMuteStateType audioInState;
555 @property (nonatomic, readonly) CJGuestMuteStateType videoInState;
556 
557 
562 @property (nonatomic, readonly, getter = isAudioOutMuted) BOOL audioOutMuted;
567 @property (nonatomic, readonly, getter = isAudioOutUnmuted) BOOL audioOutUnmuted;
572 @property (nonatomic, readonly, getter = isAudioInMuted) BOOL audioInMuted;
577 @property (nonatomic, readonly, getter = isAudioInUnmuted) BOOL audioInUnmuted;
582 @property (nonatomic, readonly, getter = isVideoOutMuted) BOOL videoOutMuted;
587 @property (nonatomic, readonly, getter = isVideoOutUnmuted) BOOL videoOutUnmuted;
591 @property (nonatomic, readonly, getter = isVideoControlEnabled) BOOL videoControlEnabled;
596 @property (nonatomic, readonly, getter = isVideoInMuted) BOOL videoInMuted;
601 @property (nonatomic, readonly, getter = isVideoInUnmuted) BOOL videoInUnmuted;
602 
608 - (void)muteAudioOut;
609 
615 - (void)unmuteAudioOut;
616 
622 - (void)muteVideoOut;
623 
629 - (void)unmuteVideoOut;
630 
642 @property (nonatomic, readonly) NSString *sentDTMF;
643 
649 - (void)sendDTMF:(char)dtmf;
650 
658 - (void)sendDTMFString:(NSString *)dtmfString;
659 
673 @property (nonatomic, readwrite, weak) IBOutlet id <CJGuestInvalidCertDelegate> invalidCertDelegate;
674 
680 @property (nonatomic, readwrite, weak) IBOutlet id <CJGuestServerConfiguraionCallDelegate> autoStartCallDelegate;
681 
685 @property (nonatomic, readonly, getter = isReady) BOOL ready DEPRECATED_ATTRIBUTE;
686 
690 @property (nonatomic, readonly, weak) CJGuestAudioStatistics * audioStatistics;
691 
695 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * videoStatistics;
696 
700 @property (nonatomic, readonly, weak) CJGuestVideoStatistics * shareStatistics;
701 
702 
707 @property (nonatomic, readonly, weak) NSString * htmlCallStatistics;
708 
718 - (void)audioSetActive:(BOOL) active;
719 
720 
725 typedef NS_ENUM(NSInteger, CJGuestNetworkStatus) {
726  CJGuestNetworkStatus_Unknown,
727  CJGuestNetworkStatus_Online,
728  CJGuestNetworkStatus_Changed,
729  CJGuestNetworkStatus_Offline
730 };
731 
737 - (void)updateNetworkStatus:(CJGuestNetworkStatus) networkStatus;
738 
748 
755 + (NSDictionary *)parseQueryString:(NSString *)query;
756 
761 + (NSArray * )getAllLogs;
762 
769 + (NSString*)stringFromCallState:(CJGuestCallStateType)state;
770 
777 + (NSString*)stringFromMuteState:(CJGuestMuteStateType)state;
778 
779 @end
The destination was busy.
Definition: CJGuestCall.h:216
CJGuestMuteStateType audioInState
Represents the mute state of the audio being received by the local end point.
Definition: CJGuestCall.h:551
CJGuestVideoStatistics * videoStatistics
Provides access to the video stream statistics.
Definition: CJGuestCall.h:695
CJGuestMuteStateType audioOutState
Represents the mute state of the audio being sent to the remote end point.
Definition: CJGuestCall.h:543
CJGuestMuteStateType
Muting or unmuting a media stream requires some coordination between resources, so the state of the m...
Definition: CJGuestCall.h:517
NSString *const CJGuestCallErrorKey
The key for the value in the userInfo dictionary of the NSNotification received from the CJGuestCallE...
Definition: CJGuestCall.mm:66
An http error.
Definition: CJGuestCall.h:244
The ICE negotiation failed.
Definition: CJGuestCall.h:208
The Jabber Guest server encountered a SIP error.
Definition: CJGuestCall.h:180
An undefined error.
Definition: CJGuestCall.h:253
BOOL videoOutUnmuted
Convenience property for determining whether the video output is unmuted.
Definition: CJGuestCall.h:587
BOOL remotePresoActive
The active state of the remotePreso video stream.
Definition: CJGuestCall.h:370
The URI was invalid.
Definition: CJGuestCall.h:188
void muteVideoOut()
Start the process of muting the video output.
Definition: CJGuestCall.mm:945
The media gateway is not defined.
Definition: CJGuestCall.h:200
The URI was not found.
Definition: CJGuestCall.h:228
The server was busy and could no resource allocation failed.
Definition: CJGuestCall.h:204
void endCall()
After calling startCall() to establish the call with the remote endpoint, call this method to end the...
Definition: CJGuestCall.mm:907
void accept()
The delegate calls this to accept the invalid certificate.
This class holds parameters specific to the audio stream of the call.
Definition: CJGuestMediaStatistics.m:64
An invalid call state.
Definition: CJGuestCall.h:220
There was a network error.
Definition: CJGuestCall.h:249
BOOL videoInUnmuted
Convenience property for determining whether the video input is unmuted.
Definition: CJGuestCall.h:601
CJGuestCall * sharedInstance()
This method returns the active call instance.
Definition: CJGuestCall.mm:327
CJGuestCall is not communicating with any remote endpoints and is ready to establish a new communicat...
Definition: CJGuestCall.h:474
The URI was invalid.
Definition: CJGuestCall.h:196
CJGuestCallStateType
This identifies the progress of the call as the call is established with the remote endpoint...
Definition: CJGuestCall.h:464
BOOL audioInMuted
Convenience property for determining whether the audio input is muted.
Definition: CJGuestCall.h:572
A TURN error.
Definition: CJGuestCall.h:224
CGSize selfSize
The size of the self view video image.
Definition: CJGuestCall.h:345
The media stream is muted, no media is passing.
Definition: CJGuestCall.h:521
The URI is not active.
Definition: CJGuestCall.h:232
An object implementing this potocol is passed to CJGuestServerConfiguraionCallDelegate.
Definition: CJGuestCall.h:35
void stopSelfView()
This will stop capturing video from the local capture device and sending the video to the selfView if...
Definition: CJGuestCall.mm:689
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:941
This protocol provides a notification if any of the HTTP requests performed by CJGuestCall encounter ...
Definition: CJGuestCall.h:52
BOOL ready DEPRECATED_ATTRIBUTE
Indicates the call is ready and active (it is not disconnected).
Definition: CJGuestCall.h:685
NSString * htmlCallStatistics
Provides an HTML formatted view of the audio and video statistics for display in a web view...
Definition: CJGuestCall.h:707
The media stream is unmuted, media is passing.
Definition: CJGuestCall.h:532
CJGuestCall has not been initialized with a valid server name.
Definition: CJGuestCall.h:468
void cancelAutoStartCall()
When a automatic-start call is scheduled, call this to cancel the scheduled call. ...
Definition: CJGuestCall.mm:914
NSString * serverName
The server name through which we will establish this call.
Definition: CJGuestCall.h:318
CJGuestCall instance is currently connected to the called party from the URI that it was given...
Definition: CJGuestCall.h:490
CJGuestMuteStateType videoOutState
Represents the mute state of the video being sent to the remote end point.
Definition: CJGuestCall.h:547
NSArray * getAllLogs()
Returns an array of file names corresponding to the log files that exist on the device.
Definition: CJGuestCall.mm:337
CJGuestErrorCode
The error codes for the Jabber Guest Error Domain.
Definition: CJGuestCall.h:176
NSString *const CJGuestCallRemotePresoVideoStartedNotification
Register for this event to be notified when the first frame of the remotePreso video is received...
Definition: CJGuestCall.mm:56
An object implementing this protocol is passed to the CJGuestInvalidCertDelegate. ...
Definition: CJGuestCall.h:19
BOOL selfVideoActive
The active state of the self video stream.
Definition: CJGuestCall.h:375
void switchCamera()
Cycle the local capture device to the next available one.
Definition: CJGuestCall.mm:920
The media stream is transitioning to the muted state and may be passing media.
Definition: CJGuestCall.h:537
id init()
Initializes an instance of CJGuestCall.
Definition: CJGuestCall.mm:358
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:642
The media stream is transitioning to the unmuted state and may not be passing media.
Definition: CJGuestCall.h:527
This class holds parameters specific to the video stream of the call.
Definition: CJGuestMediaStatistics.m:75
void scheduledCallDidExecute()
This is called when the scheduled automatic-start call is executed.
BOOL audioOutUnmuted
Convenience property for determining whether the audio output is unmuted.
Definition: CJGuestCall.h:567
There Jabber Guest server encountered an exception.
Definition: CJGuestCall.h:184
BOOL audioOutMuted
Convenience property for determining whether the audio output is muted.
Definition: CJGuestCall.h:562
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:355
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:582
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:596
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:503
IBOutlet UIImageView * selfView
The selfView will be updated with video from the camera on the device, providing feedback so the user...
Definition: CJGuestCall.h:340
The URI has been disabled.
Definition: CJGuestCall.h:240
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:326
CJGuestAudioStatistics * audioStatistics
Provides access to the audio stream statistics.
Definition: CJGuestCall.h:690
void muteAudioOut()
Start the process of muting the audio output.
Definition: CJGuestCall.mm:937
CJGuestVideoStatistics * shareStatistics
Provides access to the share stream statistics.
Definition: CJGuestCall.h:700
IBOutlet id< CJGuestServerConfiguraionCallDelegate > autoStartCallDelegate
This delegate is called when server enable automatically start call feature.
Definition: CJGuestCall.h:680
IBOutlet UIImageView * remotePresoView
This will be updated with video sent from the remotePreso endpoint of the call.
Definition: CJGuestCall.h:360
The URI has expired.
Definition: CJGuestCall.h:236
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:673
There was a networking error between the device and the server.
Definition: CJGuestCall.h:192
CJGuestMuteStateType videoInState
Represents the mute state of the video being received by the local end point.
Definition: CJGuestCall.h:555
CJGuestCall is trying to connect a call to the called party from the URI that it was given...
Definition: CJGuestCall.h:483
CJGuestCall instance is either attempting to end an active call at the request of the device user...
Definition: CJGuestCall.h:498
BOOL remotePresoStarted
The active state of the remotePreso video stream.
Definition: CJGuestCall.h:380
This is the main class of the Jabber Guest iOS SDK.
Definition: CJGuestCall.mm:317
IBOutlet UIImageView * remoteView
This will be updated with video sent from the remote endpoint of the call.
Definition: CJGuestCall.h:350
BOOL audioInUnmuted
Convenience property for determining whether the audio input is unmuted.
Definition: CJGuestCall.h:577
BOOL videoControlEnabled
Convenience property for determining whether the video ouput control is disabled by policy from serve...
Definition: CJGuestCall.h:591
There was an error in the SIP configuration.
Definition: CJGuestCall.h:212
CGSize remotePresoSize
The size of the remotePreso video image.
Definition: CJGuestCall.h:365
void reject()
The delegate calls this to reject the invalid certificate.
void unmuteVideoOut()
Start the process of unmuting the video output.
Definition: CJGuestCall.mm:949
UIInterfaceOrientation captureOrientation
Indicates the orientation of the device so the video capture can compensate and send the video in the...
Definition: CJGuestCall.h:386