CallEventListener

Callback interface for handling VoIP call lifecycle events.

Implement this interface to integrate your VoIP calling solution (WebRTC, Twilio, Agora, etc.) with Pushwoosh VoIP push notifications. The SDK invokes these callbacks when users interact with incoming calls or when system events occur.

Registration:

Register your implementation in AndroidManifest.xml:

<application>
<meta-data
android:name="com.pushwoosh.CALL_EVENT_LISTENER"
android:value="com.yourapp.YourCallEventListener" />
</application>

Typical Implementation:

class YourCallEventListener : CallEventListener {
override fun onAnswer(voIPMessage: PushwooshVoIPMessage, videoState: Int) {
// User answered - start your VoIP connection and navigate to call screen
}

override fun onReject(voIPMessage: PushwooshVoIPMessage) {
// User rejected - notify your backend if needed
}

override fun onDisconnect(voIPMessage: PushwooshVoIPMessage) {
// Call ended - cleanup resources and close call UI
}

// Implement other methods as needed for your use case
}

Note: All callbacks run on the main thread. The default implementation logs events only.

See also

Functions

Link copied to clipboard
abstract fun onAnswer(voIPMessage: PushwooshVoIPMessage, videoState: Int)

Called when the user answers an incoming call.

Link copied to clipboard
abstract fun onCallAdded(voIPMessage: PushwooshVoIPMessage)

Called when the call is added to Android InCallService.

Link copied to clipboard
abstract fun onCallCancellationFailed(callId: String?, reason: String)

Called when call cancellation fails.

Link copied to clipboard
abstract fun onCallCancelled(voIPMessage: PushwooshVoIPMessage)

Called when the remote party cancels the call before it's answered.

Link copied to clipboard
abstract fun onCallRemoved(voIPMessage: PushwooshVoIPMessage)

Called when the call is removed from Android InCallService.

Link copied to clipboard
abstract fun onCreateIncomingConnection(payload: Bundle?)

Called when Android Telecom creates an incoming connection.

Link copied to clipboard
abstract fun onDisconnect(voIPMessage: PushwooshVoIPMessage)

Called when the call is disconnected (by user or remote party).

Link copied to clipboard
abstract fun onReject(voIPMessage: PushwooshVoIPMessage)

Called when the user rejects an incoming call.