CJGuestCall Class Reference

This is the main class of the Jabber Guest iOS SDK. More...

#import <JabberGuest/JabberGuest.h>

Inherits NSObject.

Class Methods

(CJGuestCall *) + sharedInstance
 This method returns the active call instance. More...
 
(NSDictionary *) + parseQueryString:
 This is a utility method that can be used to parse a Jabber Guest formatted URI passed to the iOS app on start-up. More...
 
(NSArray *) + getAllLogs
 Returns an array of file names corresponding to the log files that exist on the device. More...
 
(NSString *) + stringFromCallState:
 This will convert the call state enumeration to a string representation for diagnostics or troubleshooting. More...
 
(NSString *) + stringFromMuteState:
 This will convert the mute state enumeration to a string representation for diagnostics or troubleshooting. More...
 
(void) + setGlobalLoggingEnabled:
 Call this method anytime to stop or restart logging to console and disk file. More...
 

Initializers

Although the initializers are accessible, the CJGuestCall object should be accessed through the sharedInstance (CJGuestCall) method.

(id) - init
 Initializes an instance of CJGuestCall. More...
 
(id) - initWithServerName:toURI:callerName:
 Initializes an instance of CJGuestCall with the serverName and toURI. More...
 

Configuration

NSString * serverName
 The server name through which we will establish this call.
 
NSString * toURI
 The URI of the remote end point to which the call should be established. More...
 
NSString * fullServerUrl
 The whole url including server name, protocol, toURI and also some prefeteched configuration from server response.
 
NSString * remoteDisplayName
 The remote participant display name from server.
 
NSString * callerName
 Guest caller name displayed on remote destination.
 

Video Control

IBOutlet UIImageView * selfView
 The selfView will be updated with video from the camera on the device, providing feedback so the user can see what is being sent to the remote party in the call.
 
CGSize selfSize
 The size of the self view video image.
 
IBOutlet UIImageView * remoteView
 This will be updated with video sent from the remote endpoint of the call.
 
CGSize remoteSize
 The size of the remote video image.
 
IBOutlet UIImageView * remotePresoView
 This will be updated with video sent from the remotePreso endpoint of the call.
 
CGSize remotePresoSize
 The size of the remotePreso video image.
 
BOOL remotePresoActive
 The active state of the remotePreso video stream.
 
BOOL selfVideoActive
 The active state of the self video stream.
 
BOOL remotePresoStarted
 The active state of the remotePreso video stream.
 
UIInterfaceOrientation captureOrientation
 Indicates the orientation of the device so the video capture can compensate and send the video in the correct orientation.
 
(void) - startSelfView:
 This will begin capturing video from the local capture device and sending the video to the selfView if it was set. More...
 
(void) - stopSelfView
 This will stop capturing video from the local capture device and sending the video to the selfView if it was set.
 
(void) - switchCamera
 Cycle the local capture device to the next available one.
 

Call Control

(void) - startCall:
 After setting the serverName and toURI properties, call this method to establish a call with the remote endpoint. More...
 
(void) - endCall
 After calling startCall() to establish the call with the remote endpoint, call this method to end the call and stop any media transmission between the local and remote endpoint.
 
(void) - cancelAutoStartCall
 When a automatic-start call is scheduled, call this to cancel the scheduled call.
 

Call State

enum  CJGuestCallStateType {
  GuestCallStateNotInitialized, GuestCallStateDisconnected, GuestCallStateConnecting, GuestCallStateConnected,
  GuestCallStateDisconnecting
}
 This identifies the progress of the call as the call is established with the remote endpoint. More...
 
CJGuestCallStateType callState
 Indicates the current state of the call.
 

Mute State

enum  CJGuestMuteStateType { GuestMuteStateMuted, GuestMuteStateUnmuting, GuestMuteStateUnmuted, GuestMuteStateMuting }
 Muting or unmuting a media stream requires some coordination between resources, so the state of the media stream will transition between these values. More...
 
CJGuestMuteStateType audioOutState
 Represents the mute state of the audio being sent to the remote end point.
 
CJGuestMuteStateType videoOutState
 Represents the mute state of the video being sent to the remote end point.
 
CJGuestMuteStateType audioInState
 Represents the mute state of the audio being received by the local end point.
 
CJGuestMuteStateType videoInState
 Represents the mute state of the video being received by the local end point.
 
BOOL audioOutMuted
 Convenience property for determining whether the audio output is muted. More...
 
BOOL audioOutUnmuted
 Convenience property for determining whether the audio output is unmuted. More...
 
BOOL audioInMuted
 Convenience property for determining whether the audio input is muted. More...
 
BOOL audioInUnmuted
 Convenience property for determining whether the audio input is unmuted. More...
 
BOOL videoOutMuted
 Convenience property for determining whether the video output is muted. More...
 
BOOL videoOutUnmuted
 Convenience property for determining whether the video output is unmuted. More...
 
BOOL videoControlEnabled
 Convenience property for determining whether the video ouput control is disabled by policy from server.
 
BOOL videoInMuted
 Convenience property for determining whether the video input is muted. More...
 
BOOL videoInUnmuted
 Convenience property for determining whether the video input is unmuted. More...
 
(void) - muteAudioOut
 Start the process of muting the audio output. More...
 
(void) - unmuteAudioOut
 Start the process of unmuting the audio output. More...
 
(void) - muteVideoOut
 Start the process of muting the video output. More...
 
(void) - unmuteVideoOut
 Start the process of unmuting the video output. More...
 

DTMF Control

NSString * sentDTMF
 Provides a string representation of the last DTMF digit sent.
 
(void) - sendDTMF:
 Add a single digit to the queue of digits being sent to the remote endpoint. More...
 
(void) - sendDTMFString:
 Add a sequence of DTMF (0-9, *, #) to the queue of digits being sent to the remote endpoint. More...
 

Miscellaneous

IBOutlet id< CJGuestInvalidCertDelegateinvalidCertDelegate
 This delegate is called when HTTP requests encounter problems verifying the certificate for a web site. More...
 
IBOutlet id< CJGuestServerConfiguraionCallDelegateautoStartCallDelegate
 This delegate is called when server enable automatically start call feature. More...
 
BOOL ready DEPRECATED_ATTRIBUTE
 Indicates the call is ready and active (it is not disconnected).
 
CJGuestAudioStatisticsaudioStatistics
 Provides access to the audio stream statistics.
 
CJGuestVideoStatisticsvideoStatistics
 Provides access to the video stream statistics.
 
CJGuestVideoStatisticsshareStatistics
 Provides access to the share stream statistics.
 
NSString * htmlCallStatistics
 Provides an HTML formatted view of the audio and video statistics for display in a web view, or web browser.
 
(void) - audioSetActive:
 Changes the state of the audio session, giving or removing control over the audio inputs to the application. More...
 

Network Status

enum  CJGuestNetworkStatus
 
(void) - updateNetworkStatus:
 Notify that network status has changed. More...
 

Detailed Description

This is the main class of the Jabber Guest iOS SDK.

CJGuestCall represents the lifecycle of a single entire call. Only one instance of this class exists, and that instance is accessed through the sharedInstance (CJGuestCall) static method.

CJGuestCall will also send out notifications via NSNotificationCenter whenever specific events occur, like the call state changed, or a DTMF was sent on the call. Any component interested in responding to these notifications should register for them by adding an observer through the NSNotificationCenter.

Member Enumeration Documentation

This identifies the progress of the call as the call is established with the remote endpoint.

Enumerator
GuestCallStateNotInitialized 

CJGuestCall has not been initialized with a valid server name.

GuestCallStateDisconnected 

CJGuestCall is not communicating with any remote endpoints and is ready to establish a new communication session.

GuestCallStateConnecting 

CJGuestCall is trying to connect a call to the called party from the URI that it was given.

During this time, the CJGuestCall instance is attempting to connect to the called party, negotiate audio and/or video via SDP, and setup the multimedia streams as appropriate.

GuestCallStateConnected 

CJGuestCall instance is currently connected to the called party from the URI that it was given.

All applicable audio and/or video streams are established and an active call is in progress.

GuestCallStateDisconnecting 

CJGuestCall instance is either attempting to end an active call at the request of the device user, or the called party has ended the active call.

During this state, the CJGuestCall instance will begin cleaning up all resources related to the previous call as appropriate.

Muting or unmuting a media stream requires some coordination between resources, so the state of the media stream will transition between these values.

Enumerator
GuestMuteStateMuted 

The media stream is muted, no media is passing.

GuestMuteStateUnmuting 

The media stream is transitioning to the unmuted state and may not be passing media.

GuestMuteStateUnmuted 

The media stream is unmuted, media is passing.

GuestMuteStateMuting 

The media stream is transitioning to the muted state and may be passing media.

Method Documentation

- (void) audioSetActive: (BOOL)  active

Changes the state of the audio session, giving or removing control over the audio inputs to the application.

It also allows the application to use a bluetooth device for audio input.

Parameters
active
  • true - Activate the audio session for the application.
  • false - Deactivate the audio session for the application, allowing other applications to gain control over the audio session.
+ (NSArray *) getAllLogs

Returns an array of file names corresponding to the log files that exist on the device.

Returns
A list of file names corresponding to the log files.
- (id) init

Initializes an instance of CJGuestCall.

Returns
The initialized instance of CJGuestCall.
- (id) initWithServerName: (NSString *)  serverName
toURI: (NSString *)  toURI
callerName: (NSString*)  callerName 

Initializes an instance of CJGuestCall with the serverName and toURI.

Parameters
serverNameThe name of the server through which we will connected with the remote endpoint.
toURIThe URI of the endpoint to which we would like to connect.
callerNameGuest caller name displayed on remote destination
Returns
The initialized instance of CJGuestCall
See also
serverName, toURI
- (void) muteAudioOut

Start the process of muting the audio output.

The audio output will not be muted immediately, but audioOutState will transition from unmuted to muting and then to muted.

- (void) muteVideoOut

Start the process of muting the video output.

The video output will not be muted immediately, but videoOutState will transition from unmuted to muting and then to muted.

+ (NSDictionary *) parseQueryString: (NSString *)  query

This is a utility method that can be used to parse a Jabber Guest formatted URI passed to the iOS app on start-up.

Parameters
queryThe query string to parse for name value pairs.
Returns
A dictionary containing the key value pairs from the passed query string.
- (void) sendDTMF: (char)  dtmf

Add a single digit to the queue of digits being sent to the remote endpoint.

Parameters
dtmfThe DTMF (0-9, *, #) to add to the queue.
See also
- sendDTMFString:
- (void) sendDTMFString: (NSString *)  dtmfString

Add a sequence of DTMF (0-9, *, #) to the queue of digits being sent to the remote endpoint.

Once you've added the DTMF to the queue, they will be sent to the remote endpoint with specific timing. Use the sentDTMF property and CJGuestCallSentDTMFNotification to determine which DTMF was last sent.

Parameters
dtmfStringthe sequence of DTMF to add to the queue.
+ (void) setGlobalLoggingEnabled: (BOOL)  enabled

Call this method anytime to stop or restart logging to console and disk file.

Parameters
enabledEnable the logger or not.
+ (CJGuestCall *) sharedInstance

This method returns the active call instance.

Returns
The active call instance.
- (void) startCall: (CJGuestVideoLicenseCompletion)  completion

After setting the serverName and toURI properties, call this method to establish a call with the remote endpoint.

Parameters
completionblock to be executed upon completion
- (void) startSelfView: (CJGuestVideoLicenseCompletion)  completion

This will begin capturing video from the local capture device and sending the video to the selfView if it was set.

Parameters
completionblock to be executed upon completion
+ (NSString *) stringFromCallState: (CJGuestCallStateType state

This will convert the call state enumeration to a string representation for diagnostics or troubleshooting.

Parameters
stateThe call state for which you would like the string representation.
Returns
The string representation of the state value.
+ (NSString *) stringFromMuteState: (CJGuestMuteStateType state

This will convert the mute state enumeration to a string representation for diagnostics or troubleshooting.

Parameters
stateThe mute state for which you would like the string representation.
Returns
The string representation of the state value.
- (void) unmuteAudioOut

Start the process of unmuting the audio output.

The audio output will not be unmuted immediately, but audioOutState will transition from muted to unmuting and then to unmuted.

- (void) unmuteVideoOut

Start the process of unmuting the video output.

The video output will not be unmuted immediately, but videoOutState will transition from muted to unmuting and then to unmuted.

- (void) updateNetworkStatus: (CJGuestNetworkStatus)  networkStatus

Notify that network status has changed.

Parameters
networkStatus
  • see above

Property Documentation

- (BOOL) audioInMuted
readnonatomicassign

Convenience property for determining whether the audio input is muted.

See also
audioInState
- (BOOL) audioInUnmuted
readnonatomicassign

Convenience property for determining whether the audio input is unmuted.

See also
audioInState
- (BOOL) audioOutMuted
readnonatomicassign

Convenience property for determining whether the audio output is muted.

See also
audioOutState
- (BOOL) audioOutUnmuted
readnonatomicassign

Convenience property for determining whether the audio output is unmuted.

See also
audioOutState
- (IBOutlet id<CJGuestServerConfiguraionCallDelegate>) autoStartCallDelegate
readwritenonatomicweak

This delegate is called when server enable automatically start call feature.

Implementing this delegate gives information about scheduled automatic-start call. Ignore it or set nil value to it will disable the automatic-start call featrue despite the server configuration and safely fall back to the original behavior. This property must be set before serverName, which will trigger the retrive of configuration.

- (IBOutlet id<CJGuestInvalidCertDelegate>) invalidCertDelegate
readwritenonatomicweak

This delegate is called when HTTP requests encounter problems verifying the certificate for a web site.

Implementing this delegate gives control over accepting or rejecting the certificate being verified.

- (NSString*) toURI
readwritenonatomicstrong

The URI of the remote end point to which the call should be established.

Examples:

- (BOOL) videoInMuted
readnonatomicassign

Convenience property for determining whether the video input is muted.

See also
videoInState
- (BOOL) videoInUnmuted
readnonatomicassign

Convenience property for determining whether the video input is unmuted.

See also
videoInState
- (BOOL) videoOutMuted
readnonatomicassign

Convenience property for determining whether the video output is muted.

See also
videoOutState
- (BOOL) videoOutUnmuted
readnonatomicassign

Convenience property for determining whether the video output is unmuted.

See also
videoOutState