Mountain View
Jabber SDK API Documentation

Tutorial: Call Pickup Events

Call Pickup Events

Title User needs to be notified when he can pickup conversation that was intended for another user. User can be notified through "onVisualCallPickupNotification" and "onAudioCallPickupNotification" events. Event handlers for these events must be set, as it is shown in the snippet bellow:

        function onVisualCallPickupNotification(notification)
        {
            // Display notification to user.
        }

        // This event is triggered twice. First it is triggered with isAudioEnabled = true. It indicates audio file should
        // be played. Second time it is triggered with isAudioEnabled = false. It indicates the previously started audio file
        // should be stopped.
        function onAudioCallPickupNotification(isAudioEnabled)
        {
            if(isAudioEnabled)
            {
                // Play audio file
            }
            else
            {
                // Stop playing audio file
            }
        }

        cwic.TelephonyController.addEventHandler("onAudioCallPickupNotification", onAudioCallPickupNotification);
        cwic.TelephonyController.addEventHandler("onVisualCallPickupNotification", onVisualCallPickupNotification);
    
Once any of these events has been received, user can call TelephonyController.callPickup to pickup a conversation, as it is shown in the snippet below:

        // ...
        // Call pickup notification has been received.

        cwic.TelephonyController.callPickup();
    
Once the conversation has been picked up, "onConversationIncoming" event will be fired.

Next

Previous