Call Analytics
The CallAnalytics singleton object provides a unified interface for sending call-related data to Sipfront servers.
Usage: To use CallAnalytics, first invoke the init method and after successful initialization you can use the various send* methods
Android Example:
// In onCreate() of your apps Launcher Activity add this code
override fun onCreate(savedInstanceState: Bundle?) {
if (savedInstanceState == null) {
try {
val initialized = CallAnalytics.init(
// custom Intent arguments provided to app by Sipfront test
SessionParams(intent),
// optional configuration
Config.Builder()
.enableDebugLogs(enable = true)
.build()
)
if(initialized) {
Log.i("CallAnalytics initialized")
}
} catch (e: Exception) {
Log.e("Could not initialise CallAnalytics, cause: ${e.message}")
}
}
}
iOS Example:
// In init() of your SwiftUI.App
struct MyApp: SwiftUI.App {
init() {
do {
let initialized = try CallAnalytics.shared.initialize(
params: SessionParams(),
// optional configuration of Sdk
config: Config.Builder()
.enableDebugLogs(true)
.trustAllCerts(true)
.build()
)
if initialized {
Logger.info("CallAnalytics initialized")
}
} catch {
Logger.notifications.error("CallAnalytics init error: \(error)")
}
}
}
Note: Implementors of the library should ensure proper internet connectivity and necessary permissions before invoking the methods.
Since
1.0.0
Author
Dominik Ridjic
Throws
If any send* methods are used before CallAnalytics has been initialized
If data provided to init methods is invalid
Functions
The data is received on Android as Intent and on iOS as environment variable in ProcessInfo
CallAnalytics will immediately start parsing app logs for SIP messages and transmit them if found
Returns true if CallAnalytics has been initialized
Sends RtcpMessage to Sipfront
Sends SdpMessage to Sipfront
Sends SipMessage to Sipfront
Sends StateMessage to Sipfront
Uploads MediaStream to Sipfront