Skip to main content

IVoipObserver

The IVoipObserver interface should be implemented by the application to receive events from the Cloudonix Mobile SDK - such as call progression events. The application must register at least one such implementation using the CldouonixSDKClient.addListener() method. The Cloudonix Mobile SDK will then call methods on the IVoipObserver implementation to notify the Application on events that the application may wish to take action on, such as an incoming call.

Please see the DefaultVoipObserver class below for a simple alternative to implementing this interface.

Events

onLicense(LicensingState state, String description)

Called after initialization of the Cloudonix Mobile SDK to let the application know if the license is valid or not.

onSipStarted()

Called when the SIP stack has been successfully started following a call to setConfiguration().

onSipStartFailed(String error)

Called if the SIP stack failed to start due to some unexpected error - the error message is provided as the first argument of the event handler.

onSipStartFailed()

Called if the SIP stack failed to start due to some unexpected error (consult the logs for the error details). This event handler is only called if the onSipStartFailed(String error) is not implemented.

onSipStopped()

Called when the SIP stack has stopped, possibly after a call to CloudonixSDKClient.unbind().

onRegisterState(RegisterState state, int expirySeconds)

Called when the registration state of the SIP stack has changed (when using the “SIP Registration” workflow). If the state provided is REGISTRATION_SUCCESS, then the second parameter will be set to how long is the registration expected to be maintained by the server before needing to be renewed (the SIP registration will be automatically renewed by the Cloudonix Mobile SDK SIP service).

onCallState(String callKey, CallState state, String remoteUri)

Called when a new call starts (either from a local or remote dial) and whenever an active call state changes. Please see the Call Status Reference for a list of possible call states.

onAudioRouteChange(AudioRoute route)

Called when the audio route of the currently active call changes.

onLog(int level, String message)

Called when the Cloudonix SDK generates a log message. The application is expected to output the generated log (possibly after discarding events with too high logging level) to some storage or reporting mechanism such as ADB.

onBluetoothState(BluetoothState state)

Called when the state of a Bluetooth connected headset changes.

onBluetoothBtnState(BluetoothButtonsState state, String command, String event, Integer button, Integer mode)

Called when a Bluetooth connected headset has posted a vendor specific event (such as pressing the headset call/answer button).

onNetworkLost()

Called when the Cloudonix SDK detected that IP connectivity was lost.

onNetworkChanged()

Called when the Cloudonix SDK detected that the device IP address has changed.

onNetworkRegained()

Called when the Cloudonix SDK detected that IP connectivity was regained after it was lost.

onNATTypeDetected(NATType type)

Called when the Cloudonix SDK finishes NAT detection after detecting a network IP change.

onDestroyMediaSession()

Called after a call is disconnected and its media session is disconnected and closed.

onShutdown()

Called after the Cloudonix Mobile SDK has finished shutting down and releasing all resources, in response to the application calling CloudonixSDKClient.shutdown() or otherwise the Android operating system shutting down the Cloudonix Mobile SDK service.

After this event is received, all the application's event handlers have been automatically unregistered and the application is expected to stop using it's copy of the CloudonixSDKClient instance and release it, as any method call on that instance will have undefined behavior.