Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Callstats
CallstatsTests
Pods
callstats-ios.xcodeproj
callstats-ios.xcworkspace
demo
demoTests
.gitignore
Callstats.podspec
Podfile
Podfile.lock
README.md

README.md

CallStats for iOS

Callstats WebRTC analytic library for iOS.

Getting started

Cocoapods

pod 'Callstats'

Create Callstats object

callstats = Callstats(
    appID: appID, // Application ID from Callstats
    localID: localID, // current user ID
    deviceID: deviceID, // unique device ID
    jwt: jwt, // jwt from server for authentication
    username: username) // (Optional) user alias

Send events

When starting the call, call startSession with room identifier

callstats.startSession(confID: room)

These events need to be forwarded to the library in order to start tracking the call. Add followings into your WebRTC RTCPeerConnectionDelegate For example:

func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceConnectionState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSIceConnectionChangeEvent(state: newState))
}

func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceGatheringState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSIceGatheringChangeEvent(state: newState))
}

func peerConnection(_ peerConnection: RTCPeerConnection, didChange stateChanged: RTCSignalingState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSSignalingChangeEvent(state: stateChanged))
}

And when call finished

callstats.stopSession()

You can take a look at how to send more events in demo application.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.