Windows Dev Center

CallControl.AudioTransferRequested | audiotransferrequested event

Occurs when the device receives a request for an audio transfer.

Syntax


function onAudioTransferRequested(eventArgs) { /* Your code */ }
 
// addEventListener syntax
callControl.addEventListener("audiotransferrequested", onAudioTransferRequested);
callControl.removeEventListener("audiotransferrequested", onAudioTransferRequested);
 
- or -

callControl.onaudiotransferrequested = onAudioTransferRequested;


Event information

Delegate CallControlEventHandler

Remarks

This class provides access to events that can be monitored and used for modifying the behavior of your telephony-aware app. The following JavaScript code snippet shows how to add event listeners to the CallControl class, and then to respond to one of the events, AudioTransferRequested.


// Define the user-defined valriables
var callControls = null;
var audioTag;

// Add code to initialize your user-defined variables as needed
<code goes here>

// Initialize the telephony device
    function initDevice() {
        if (!callControls) {
            try {
                callControls = Windows.Media.Devices.CallControl.getDefault();

                if (callControls) {
                    // Add the event listener to listen for the various button presses
                    callControls.addEventListener("answerrequested", answerButton, false);
                    callControls.addEventListener("hanguprequested", hangupButton, false);
                    callControls.addEventListener("audiotransferrequested", audiotransferButton, false);
                    callControls.addEventListener("redialrequested", redialButton, false);
                    callControls.addEventListener("dialrequested", dialButton, false);

                    sdkSample.displayStatus("Call Controls Initialized");
                    id("scenario1Ring").disabled = false;
                } else {
                    sdkSample.displayError("No Bluetooth device detected.");
                }
            }
            catch (e) {                
                sdkSample.displayError("No Bluetooth device detected.");
            }
        }

// Event handler code to respond to the AudioTransferRequested event
    function audiotransferButton() {
        // Handle the audio transfer request here
        sdkSample.displayStatus("Audio Transfer requested");
    }


For the complete listing of this sample see How to manage calls on the default Bluetooth communications device.

Requirements (Windows 10 device family)

Device family

Desktop

API contract

Windows.Media.Devices.CallControlContract, introduced version 1.0

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.Media.Devices.CallControlContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.winmd

See also

CallControl
CallControlEventHandler
How to manage calls on the default Bluetooth communications device

 

 

Show:
© 2015 Microsoft