Exemple #1
0
        public override async Task RunExampleAsync()
        {
            NumberContextNotify client = new NumberContextNotify(BASIC_AUTH_CONFIGURATION);

            NumberContextRequest request = new NumberContextRequest
            {
                To        = TO_LIST,
                NotifyUrl = NOTIFY_URL
            };

            NumberContextResponse response = await client.ExecuteAsync(request);

            if (!response.Results.Any())
            {
                Console.WriteLine("No details to display.");
                return;
            }

            foreach (NumberContextResponseDetails details in response.Results)
            {
                Console.WriteLine("-------------------------------");
                Console.WriteLine("Message ID: " + details.MessageId);
                Console.WriteLine("Phone number: " + details.To);
                Console.WriteLine("Message status: " + details.Status.Name);
            }
            Console.WriteLine("-------------------------------");
        }
Exemple #2
0
        public override async Task RunExampleAsync()
        {
            NumberContextQuery client = new NumberContextQuery(BASIC_AUTH_CONFIGURATION);

            NumberContextRequest request = new NumberContextRequest
            {
                To = TO_LIST
            };

            NumberContextResponse response = await client.ExecuteAsync(request);

            if (!response.Results.Any())
            {
                Console.WriteLine("No details to display.");
                return;
            }

            foreach (NumberContextResponseDetails details in response.Results)
            {
                Console.WriteLine("-------------------------------");
                Console.WriteLine("Phone number: " + details.To);
                Console.WriteLine("MccMnc: " + details.MccMnc);
                Console.WriteLine("Original country prefix: " + details.OriginalNetwork.CountryPrefix);
                Console.WriteLine("Original network prefix: " + details.OriginalNetwork.NetworkPrefix);
                Console.WriteLine("Serving MSC: " + details.ServingMSC);
            }
            Console.WriteLine("-------------------------------");
        }