CloudonixSDKClient
The CloudonixSDKClient
class is the main API for the Cloudonix Mobile SDK. It is used for initialization, setup and control of the SDK activities.
Properties
NSString* currentIp
The public IP address used by the Cloudonix Mobile SDK for the SIP protocol implementation - i.e. to register and/or issue calls.
IPVersion ipVersion
The IP version for currentIp
- can be one of IPv4
if the current IP is an IPv4 address, IPv6
if the current IP is an IPv6 address or IPvNone
if there is no valid current IP address.
BOOL isStarted
A boolean value specifying whether Cloudonix Mobile SDK initialization was completed.
Methods
sharedInstance
[static]
Access the CloudonixSDKClient
singleton instance.
initializeWithKey:(NSString *), completion:(void (^)(bool, NSError*))
Initialize the Cloudonix Mobile SDK with a specified license key, having the completion block called with the result of the licensing operation. When the completion block is called with true
as the first parameter, then the application should continue to configure the Cloudonix Mobile SDK by calling setConfig
and setConfiguration
.
addListener:(CloudonixSDKClientListener *)
Register an application callback receiver to receive events from the Cloudonix SDK.
removeListener:(CloudonixSDKClientListener *)
Unregister an application callback receiver that was previously registered.
setConfig:(NSString*) value:(NSString*)
Set a configuration parameter, using one of the configuration flags documented in Configuration Flags.
setConfiguration:(CloudonixRegistrationData*)
Configure the Cloudonix SDK to use the specified account details for SIP communications.
isRegistered
Checks whether the Cloudonix SDK SIP service is currently registered with the SIP server.
registerAccount
Start maintaining an active SIP registration with the SIP server.
unregister()
Stop maintaining an active SIP registration with the SIP server.
dial:(NSString*)
Start a call to the specified destination.
dial:(NSString*) headerList:(NSDictionary*)
Start a call to the specified destination, with the specified headers added to the SIP INVITE
message.
dialRegistrationFree:(NSString*) session:(NSString*)
Start a call to the specified destination, with the specified Cloudonix session authorization token.
dialRegistrationFree:(NSString*) session:(NSString*) headerList:(NSDictionary*)
Start a call to the specified destination, with the specified Cloudonix session authorization token and the specified headers added to the SIP INVITE
message.
answer:(NSString*)
Answer the active call specified by the call ID. Calling this method with a call ID for which there was no onCallState
event received, or that the last onCallState
event did not have the status CallState_Ringing
, is an error.
reject:(NSString*)
Rejects the active call specified by the call ID. Calling this method with a call ID for which there was no onCallState
event received, or that the last onCallState
event did not have the status CallState_Ringing
, is an error.
mute:(bool)
Mute or unmute all active calls.
localHold:(NSString*), enable:(bool)
Move the active call specified by the call ID to hold or out of hold.
hangup:(NSString*)
Hangup a call identified by the specified call id.
hangupByUrl:(NSString*)
Hangup a call identified by the destination.
dtmf:(NSString*) digit:(char)
Sends the specified DTMF signal to the active call specified by its call ID. It is an error to send a digit
parameter that isn't one of the supported DTMF signals, i.e. a decimal digit or the characters “#
” and “*
”.
(NSString*)getCallState:(NSString*)
Return the state of an active call identified by the call ID.
(NSString*)getCallUrl:(NSString*)
Return the destination of the call identified by the call ID.
(long)getCallStartTime:(NSString*)
Return the start time of an active call identified by the call ID, in seconds from the UNIX epoch.
(NSArray*)getCalls
Return a list of active call as VoipCall
POJOs, each specifying a call’s ID, destination, call state, start time in seconds since the UNIX epoch, whether it is muted or not, and the SIP call identifier.
(CloudonixChannelStatistics*)getStatistics:(NSString*)
Get media statistics for an active call identified by the call id. See the CloudonixChannelStatistics
interface documentation below for a description of the data made available by this method.
dumpStatisticsToLog:(bool)
Sets whether the Cloudonix SDK will periodically send a media statistics report to the log, during an active call. The default behavior is to not perform periodic statistics reporting.
(NSString*)getIPAddress
Scan network interfaces and return the IP address that should be used for SIP communication. This may be the same as the currentIp
property but may be different if there was a recent network change and the currentIp
field had not been updated yet.
setLogLevel:(int)
Set the verbosity level of the Cloudonix SDK. The higher the level, the more events will be sent to the onLog()
callback. The parameter should one of the values: 0
(off), 1
(error), 2
(warning), 3
(debug), 4
(info), 5
(verbose), or 6
(all).
stop
Remove the SIP account from the service and stop maintaining an active SIP registration.
shutdown
Causes the Cloudonix SDK SIP service to stop processing events and get into an unrecoverable state. The application should only call this method just before exiting.
(NSString*)getSDKVersion
Return the SDK version and build numbers for the current build, as a 4-part version string.
Deprecated Methods
reregister()
[deprecated]
Instructs the Cloudonix SDK SIP service to register with the SIP server if not currently registered. Do not use.
getNumberOfCalls()
[deprecated]
Return the number of current active calls. Use getCalls
instead.
getCallIdForIndex(int index)
[deprecated]
Return the call ID (key) of the call by its 0-based index in the list of active calls. It is an error to send an index that is equal to or larger than the number of active calls. Use getCalls
instead.
commitConfig()
[deprecated]
Synchronizes the Cloudonix SDK configuration with the SIP service, meant for internal use only. Do not use.