PhoneLine PhoneLine PhoneLine PhoneLine Class

Definition

Represents a phone line.

public : sealed class PhoneLine : IPhoneLinepublic sealed class PhoneLine : IPhoneLinePublic NotInheritable Class PhoneLine Implements IPhoneLine// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.ApplicationModel.Calls.CallsPhoneContract (introduced v1)

Remarks

A phone line is a line on a device that can either receive incoming calls or place outgoing calls, depending on whether the line is configured to support dialing out. For example, a single SIM device has 1 cellular line while a dual SIM device has 2 cellular lines. The system will automatically create new lines for VoIP applications that allow initiating an outgoing call.

Each PhoneLine instance has properties specific to that line.

Properties

CanDial CanDial CanDial CanDial

Gets a boolean value which indicates if the phone line can be used to place outgoing calls.

public : PlatForm::Boolean CanDial { get; }public bool CanDial { get; }Public ReadOnly Property CanDial As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the phone line can place outgoing calls; otherwise false.

CellularDetails CellularDetails CellularDetails CellularDetails

Gets details for the cellular component specific components for the PhoneLine instance. This property is NULL for VoIP phone lines.

public : PhoneLineCellularDetails CellularDetails { get; }public PhoneLineCellularDetails CellularDetails { get; }Public ReadOnly Property CellularDetails As PhoneLineCellularDetails// You can use this property in JavaScript.

DisplayColor DisplayColor DisplayColor DisplayColor

Gets the preferred display color of the phone line.

public : Color DisplayColor { get; }public Color DisplayColor { get; }Public ReadOnly Property DisplayColor As Color// You can use this property in JavaScript.
Value
Color Color Color Color

The preferred display color of the phone line.

DisplayName DisplayName DisplayName DisplayName

Gets the user assigned friendly name for the phone line.

public : PlatForm::String DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The user assigned friendly name for the phone line.

Id Id Id Id

Gets the ID of the phone line. The ID is persistent across devices and reboots.

public : PlatForm::Guid Id { get; }public Guid Id { get; }Public ReadOnly Property Id As Guid// You can use this property in JavaScript.
Value
PlatForm::Guid Guid Guid Guid

The ID of the phone line.

LineConfiguration LineConfiguration LineConfiguration LineConfiguration

Gets extra configuration information about this PhoneLine instance.

public : PhoneLineConfiguration LineConfiguration { get; }public PhoneLineConfiguration LineConfiguration { get; }Public ReadOnly Property LineConfiguration As PhoneLineConfiguration// You can use this property in JavaScript.

NetworkName NetworkName NetworkName NetworkName

Gets the name of the current network that is being used by the phone line.

public : PlatForm::String NetworkName { get; }public string NetworkName { get; }Public ReadOnly Property NetworkName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the current network that is being used by the phone line.

NetworkState NetworkState NetworkState NetworkState

Gets the current network status of the phone line.

public : PhoneNetworkState NetworkState { get; }public PhoneNetworkState NetworkState { get; }Public ReadOnly Property NetworkState As PhoneNetworkState// You can use this property in JavaScript.
Value
PhoneNetworkState PhoneNetworkState PhoneNetworkState PhoneNetworkState

The current network status of the phone line.

SupportsTile SupportsTile SupportsTile SupportsTile

Gets a value that indicates if the phone line supports being pinned as a live tile.

public : PlatForm::Boolean SupportsTile { get; }public bool SupportsTile { get; }Public ReadOnly Property SupportsTile As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the phone line supports being pinned as a live tile; otherwise false.

Transport Transport Transport Transport

Gets the transport for the phone line.

public : PhoneLineTransport Transport { get; }public PhoneLineTransport Transport { get; }Public ReadOnly Property Transport As PhoneLineTransport// You can use this property in JavaScript.

VideoCallingCapabilities VideoCallingCapabilities VideoCallingCapabilities VideoCallingCapabilities

Gets whether video calling is supported over this phone line.

public : PhoneCallVideoCapabilities VideoCallingCapabilities { get; }public PhoneCallVideoCapabilities VideoCallingCapabilities { get; }Public ReadOnly Property VideoCallingCapabilities As PhoneCallVideoCapabilities// You can use this property in JavaScript.

Voicemail Voicemail Voicemail Voicemail

Gets the voice mail data associated with the PhoneLine instance.

public : PhoneVoicemail Voicemail { get; }public PhoneVoicemail Voicemail { get; }Public ReadOnly Property Voicemail As PhoneVoicemail// You can use this property in JavaScript.

Methods

Dial(String, String) Dial(String, String) Dial(String, String) Dial(String, String)

Place a phone call on the phone line. The caller must be in the foreground.

public : void Dial(PlatForm::String number, PlatForm::String displayName)public void Dial(String number, String displayName)Public Function Dial(number As String, displayName As String) As void// You can use this method in JavaScript.
Parameters
number
PlatForm::String String String String

The number to dial.

displayName
PlatForm::String String String String

The display name of the party receiving the phone call. This parameter is optional.

Remarks

In order to use this method, the PhoneLine instance needs to support outbound calls. Use CanDial to verify whether or not that is supported.

DialWithOptions(PhoneDialOptions) DialWithOptions(PhoneDialOptions) DialWithOptions(PhoneDialOptions) DialWithOptions(PhoneDialOptions)

Place a phone call on the phone line, allowing the caller to specify additional dial options. The caller must be in the foreground.

public : void DialWithOptions(PhoneDialOptions options)public void DialWithOptions(PhoneDialOptions options)Public Function DialWithOptions(options As PhoneDialOptions) As void// You can use this method in JavaScript.
Parameters
options
PhoneDialOptions PhoneDialOptions PhoneDialOptions PhoneDialOptions

The additional dial options for the phone call.

FromIdAsync(Guid) FromIdAsync(Guid) FromIdAsync(Guid) FromIdAsync(Guid)

This static method asynchronously retrieves a PhoneLine object that represents a specific phone line on the device based on the line ID.

public : static IAsyncOperation<PhoneLine> FromIdAsync(PlatForm::Guid lineId)public static IAsyncOperation<PhoneLine> FromIdAsync(Guid lineId)Public Static Function FromIdAsync(lineId As Guid) As IAsyncOperation( Of PhoneLine )// You can use this method in JavaScript.
Parameters
lineId
PlatForm::Guid Guid Guid Guid

The line ID of the phone line to retrieve.

Returns

An asynchronous operation that returns a PhoneLine object that represents a specific phone line on the device based on the line ID.

Remarks

The following example shows how to get the default PhoneLine.

private async Task<PhoneLine> GetDefaultPhoneLineAsync()
{
    PhoneCallStore phoneCallStore = await PhoneCallManager.RequestStoreAsync();
    Guid lineId = await phoneCallStore.GetDefaultLineAsync();
    return await PhoneLine.FromIdAsync(lineId);
}

IsImmediateDialNumberAsync(String) IsImmediateDialNumberAsync(String) IsImmediateDialNumberAsync(String) IsImmediateDialNumberAsync(String)

Check if a number should be dialed immediately from the dialer without requiring the user to press the call button.

public : IAsyncOperation<PlatForm::Boolean> IsImmediateDialNumberAsync(PlatForm::String number)public IAsyncOperation<bool> IsImmediateDialNumberAsync(String number)Public Function IsImmediateDialNumberAsync(number As String) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Parameters
number
PlatForm::String String String String

The phone number to check for immediate dialing.

Returns

An asynchronous boolean response. True indicates that the number should be dialed immediately.

Events

LineChanged LineChanged LineChanged LineChanged

Occurs when and properties for the associated PhoneLine instance change. This can occur when meta data changes like the voice mail count, the network state, or the cellular details.

public : event TypedEventHandler LineChanged<PhoneLine,  object>public event TypedEventHandler LineChanged<PhoneLine,  object>Public Event LineChanged<PhoneLine,  object>// You can use this event in JavaScript.

Remarks

The following example demonstrates how to monitor for and update the network state.

private async void MonitorLineChanges(Guid lineId)
{
    // Get the PhoneLine instance
    PhoneLine line = await PhoneLine.FromIdAsync(lineId);

    PhoneNetworkState updatedNetworkState;
    string updatedNetworkName;

    line.LineChanged += (o, args) =>
    {
        updatedNetworkState = line.NetworkState;
        updatedNetworkName = line.NetworkName;
    };
}