Mobile Elements is a VoIP mobile application which runs on Android, iOS and Universal Windows platforms. This application has been built using Xamarin forms cross platform development environment which is a built-in feature in Visual Studio. The Mobile Elements application supports outbound and inbound calling facility using the Voice Elements server platform and a wifi connection.
Setting up your UWP Device to Receive Inbound Calls
You need to configure your project in the Microsoft developer account for Windows Notification Service.
WNS Configuration with Microsoft Developer Account
- Login to Microsoft Developer and click on DASHBOARD.
- Select Create a new app.
- Create a Product Name.
- After your app is created, select View App Identity details under the the AppManagement Sub heading.
- This information will assist you in linking your application to the Windows Play Store.
- After you setup your application, you need to sign into visual studio with your Microsoft id. Open the solution and right click on the project. Select Store -> Associate App With Store. Here you can select your app from the store and automatically create an association between your application and the store. The following screenshot will assist you.
Making an Inbound Call
- UWP applications use Windows Notification Service to deliver remote push notifications. The client application requests for a channel URI from the WNS during the launch of application and sends it to the server application for future communication. When an inbound call reaches our Voice Elements server application, then the server sends a push notification through WNS services. WNS sends these messages to the intended device.
- When the notification arrives at the end device, the Mobile Elements pops a screen to answer/reject the call.
- Right click on the MobileElements.UWP(Universal Windows) and click on the Properties. Then select the Build tab and set the ENABLE_REGISTRATION in Conditional compilation symbols. This flag will enable inbound call feature in the application.
- Now open the Package.appxmanifest from your UWP project and go to the Packaging tab. Set your Package name and Publisher display name which you must have received during the configuration of your project with the Microsoft Developer Account.
- Open the UserCredentials.cs file and set the URI and host of your server in order to connect through the web socket. You also need to set the URI and host of your server application in order to send your channel URI through the web socket.
- Now you are all set to place an inbound call to your device through GCM push notifications.
- For more understanding on remote push notifications and its configuration, read more in this Microsoft article: Windows Push Notification Services (WNS) Overview