Ussd​Session Ussd​Session Ussd​Session Class

Definition

Represents a session of the USSD network protocol.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

public sealed class UssdSession : IUssdSessionpublic sealed class UssdSession : IUssdSessionPublic NotInheritable Class UssdSession Implements IUssdSession
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

Close() Close() Close()

Closes the USSD session with the network.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

public void Close()public void Close()Public Function Close() As void
Attributes

CreateFromNetworkAccountId(String) CreateFromNetworkAccountId(String) CreateFromNetworkAccountId(String)

Creates a USSD session for the mobile device associated with the supplied network account ID.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

public static UssdSession CreateFromNetworkAccountId(String networkAccountId)public static UssdSession CreateFromNetworkAccountId(String networkAccountId)Public Static Function CreateFromNetworkAccountId(networkAccountId As String) As UssdSession
Parameters
networkAccountId
System.String System.String System.String

The network account ID to use to select the corresponding mobile broadband device to use for the USSD session.

Returns

The USSD session for the mobile device associated with the supplied network account ID.

Attributes

CreateFromNetworkInterfaceId(String) CreateFromNetworkInterfaceId(String) CreateFromNetworkInterfaceId(String)

Creates a USSD session for the mobile device associated with the supplied network interface ID.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

public static UssdSession CreateFromNetworkInterfaceId(String networkInterfaceId)public static UssdSession CreateFromNetworkInterfaceId(String networkInterfaceId)Public Static Function CreateFromNetworkInterfaceId(networkInterfaceId As String) As UssdSession
Parameters
networkInterfaceId
System.String System.String System.String

The network interface ID to use to select the corresponding mobile broadband device to use for the USSD session.

Returns

The USSD session for the mobile device associated with the supplied network interface ID.

Attributes

SendMessageAndGetReplyAsync(UssdMessage) SendMessageAndGetReplyAsync(UssdMessage) SendMessageAndGetReplyAsync(UssdMessage)

Sends a message to a USSD session and returns a handler to retrieve the reply asynchronously.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

public IAsyncOperation<UssdReply> SendMessageAndGetReplyAsync(UssdMessage message)public IAsyncOperation<UssdReply> SendMessageAndGetReplyAsync(UssdMessage message)Public Function SendMessageAndGetReplyAsync(message As UssdMessage) As IAsyncOperation( Of UssdReply )
Parameters
message
UssdMessage UssdMessage UssdMessage

The message to send to the USSD session.

Returns

An asynchronous handler to retrieve the USSD response to the sent message.

Attributes

Remarks

The USSD message being sent can be either a request or a response. The operation is asynchronous and issues a single callback using the IAsyncOperation(UssdReply) interface upon completion. You can cancel the asynchronous operation using the IAsyncOperation(UssdReply) interface.

When an application using the C++ projection of SendMessageAndGetReplyAsync releases its last reference to the UssdSession object from within that callback, SendMessageAndGetReplyAsync may hang. Therefore, applications must ensure that the callback is not released from within SendMessageAndGetReplyAsync. One way of doing this is to create another asynchronous operation (e.g. a timer) from within the callback whose completion callback is used to release the session object by passing it a reference to the session object.

auto timerDelegate = [ussdSession](Windows::System::Threading::ThreadPoolTimer^ timer) {};
Windows::Foundation::TimeSpan delay;
delay.Duration = 1; // non-zero value
Windows::System::Threading::ThreadPoolTimer^ timer = 
Windows::System::Threading::ThreadPoolTimer::CreateTimer(ref new
Windows::System::Threading::TimerElapsedHandler(timerDelegate), delay);