Dynamics CRM Soft-Phone Complete Guide

Integrate your VOIP with Dynamics 365 to help your Sales and Support teams.

Recently with Release wave 2 plan (https://docs.microsoft.com/en-us/dynamics365-release-plan/2019wave2/) there are a couple of interesting features that for sure can improve Sales and Support efficiency. One of these features is the so-called Soft-Phone.

For those of you who don’t know what the soft-phone is, basically, it is a virtual phone (VOIP) where all the calls (incoming and outgoing, also SMSs) goes through computer software and not via a physical phone. In my opinion, this saves a lot of time and money.

But anyway, after reviewing the official documentation I’ve decided to try this feature myself. The documentation is very spread around so it requires to refer to multiple sites and pages in order to complete everything, and if you miss something there is a quite long way back to find your mistake.

So I decided to summarize all the steps in one article.

Download and install the required solution:

  • First of all, you will need to download a D365 Channel Integration Framework containing the soft-phone solution.

Dynamics 365 Channel Integration Framework - Sample

Download the sample to integrate a softphone with Dynamics 365 using Channel Integration Framework.

Once done, unzip it on your desktop.

  • Next, you need a Visual Studio to publish the Soft-phone sample app to Azure. In my case, I’ve downloaded VS Community 2019 (free)

Visual Studio IDE, Code Editor, Azure DevOps, & App Center - Visual Studio

Visual Studio dev tools & services make app development easy for any platform & language. Try our Mac & Windows code editor, IDE, or Azure DevOps for free.

No alt text provided for this image

Once VS is installed you can proceed with the next step.

Create free Azure subscription

You will need to publish the soft-phone sample app that is in D365 Channel Integration Framework folder to Azure.

You can get 30days free Azure Subscription with a lot of free services, some of them you can use up to 12 months if you switch after the trial to Pay-as-you-go.

No alt text provided for this image

Note that both, the Azure Account and D365 Instance must be in the same tenant.

During the registration, a valid credit card is required but you won’t be charged (trust me, I’ve done this many times).

Once done you will be in your Azure portal dashboard, if not navigate to https://portal.azure.com

Check in the Subscriptions section to confirm your free subscription is activated.

No alt text provided for this image
No alt text provided for this image

Publish Sof-phone sample app solution to Azure

It is time to upload the sample app to azure so, later on, we can add it to Dynamics 365.

  • Open the solution SampleInteg.sln using Visual Studio 2017.
No alt text provided for this image
No alt text provided for this image
  • In Solution Explorer, right-click on the solution and build the complete solution.
No alt text provided for this image
No alt text provided for this image
  • In Solution Explorer, right-click on the project SampleInteg and select Publish.
No alt text provided for this image
No alt text provided for this image
  • Here since there is already a resource group selected from the previous owner, select New
No alt text provided for this image
  • Chose App Service, select Create New,and click Publish
No alt text provided for this image
  • You might be prompted to log in to Azure to confirm your Subscription.
  • Provide valid subscription, resource group, and hosting plan details.
  • Select Create to create the azure app service, and save the app service URL for future use.
No alt text provided for this image

Once published successfully, your app will open in a new window.

Note: this is just a test app so don’t expect anything special, also do not deploy this on production instances. The app is nothing special, and with the help of a developer can be modified according to your needs.

No alt text provided for this image

Configure Twilio Client Javascript

Next step is to configure the web client which will service our calls (incoming or outgoing).

  • Navigate to https://www.twilio.com and create a free account.
  • You will need to confirm your email and phone number.
  • Once done, you need A Twilio phone number in E.164 format – you can get one here.
  • You have one free phone number in your trial subscription.
No alt text provided for this image
  • Creation is quite straight forward, just select Country and click Search to search for an available phone number to reserve.
No alt text provided for this image
  • Chose any number that you like from the list of available one.

Note: there are prices next to the phones, in your trial account you have 20$, the phone number coast 3$ and the remaining amount can be used for test calls. Prices vary from country to country for details check:

No alt text provided for this image
  • Once ready, your phone will appear in Phone Numbers area.
No alt text provided for this image
  • Next, you’ll need a front end for this Twilio Client for Javascript quickstart – the HTML, CSS, and, of course, Javascript. You’re welcome to use any kind of front end web technology you want for your own application, but we’ve got a pretty simple little set of code for you to use to get started. Go ahead and download a zipped up copy of the Twilio Client for JS source code, or check out the Twilio Client for JS GitHub repo. We’ll use this code a little bit later after we get the Twilio Functions set up. You’ll need to change the location of a URL in public/quickstart.js to point to your function.
  • Create the quick start functions, to get you up and running with this quickstart, you can use a template to create your functions. Start by going to the Functions page in the Twilio Console. You can add new functions with the plus button on that screen.
No alt text provided for this image
  • Click on Twilio Client Quickstart template
No alt text provided for this image
  • A new window will Pop-up with TWIML_APP_SID and the CALLER_ID. that need to be configured.
No alt text provided for this image
  • You can get your TWIML_APP_SID from Phone Numbers Section # > Tools > TwiML Apps
No alt text provided for this image
  • CALLER_ID is the phone number that you had to verify at the beginning of the registration process.
  • Once everything is added, Click Create, and you’ll get two new functions.
No alt text provided for this image

We are almost to the end of this exercise, we have a couple more steps before ready to test.

Now you need to point your TwiML app to your function. We need to tell Twilio what to do with incoming voice requests for that TwiML app. Twilio will fire off a webhook to your function, but we need to supply that URL in the Twilio console before it will work.

  • From Functions section, select Twilio Client Quickstart (Voice calls)and copy your PATH
No alt text provided for this image
  • Once again go to Phone Numbers Section # > Tools > TwiML Apps, and open your App
  • Paste the PATH to your Voice field and Save the changes.
No alt text provided for this image
  • The last configuration step is to set the URL of your capability token in the front end web application. The subdomain that Twilio uses is unique to your account, so go ahead and find this line in quickstart.js:
  • The file is located in the folder client-quickstart-js-master > public > quickstart.js
No alt text provided for this image

$.getJSON(‘https://YOUR_FUNCTION_SUBDOMAIN_HERE.twil.io/capability-token’)

No alt text provided for this image
  • Replace the placeholder (YOUR_FUNCTION_SUBDOMAIN_HERE) with your Twilio Function subdomain, and then save the file. 
  • You can find your Sub-Domain in the Functions section.
No alt text provided for this image
  • Install and Run Local HTTP server to test the service. You can download http-server Node.js module. If you don’t have Node.js installed on your computer, download Node for your operating system first, and follow the directions to set it up – it’s pretty easy!
  • Once you have Node all ready to go, you can install http-server using this command:

npm install http-server -g

  • Now, just run the HTTP server in the directory that has the quickstart sample application:

http-server

No alt text provided for this image

Setup Dynamics CRM for soft-phone.

Finally, it’s time to setup Dynamics CRM with our sample soft-phone application.

First, go to Dynamics Store and Download Dynamics 365 Channel Integration Framework

Dynamics 365 Channel Integration Framework

The Dynamics 365 Channel Integration Framework is a set of APIs (methods, events and protocols) that enables developers and partners to build immersive communication experiences such that third party communication widgets running on channel provider/partner cloud can interact with Dynamics 365.

No alt text provided for this image
No alt text provided for this image
  • Once Successfully installed on the CRM organization, go to Dynamics CRM and select the UCI app called Channel Integration Framework
No alt text provided for this image
  • Create New Channel Provider record and set Name, Label, Channel URL, Enable Outbound Communication, Channel Order, Select Unified Interface App for the Channel (Apps where the soft-phone app will appear, and Security Roles required for the soft-phone app)
  • For Channel URL, provide the URL as <azure_app_service_url>?base=<crm_base_url>&twa=<twilio_capability_token_url>.
  • In this sample, the URL would be “https://twiliosampleinteg.azurewebsites.net?base=https://twiliosampleorg.crm10.dynamics.com&twa=https://twilio-sample.twil.io/capability-token”
No alt text provided for this image

Finally, it’s time to test the app.

Refresh Dynamics CRM and open one of the apps where you decided to have the soft-phone to appear, in my case, this is Sales Hub.

No alt text provided for this image
No alt text provided for this image

If you dial a number that is already associated with existing CRM Contact while dialing the number the Contact will open.

No alt text provided for this image

You can navigate free in CRM while talking on the phone, you can also take notes during the call, you can convert the call into a case.

References:

Hope this can give you a better idea of the new integration of CRM with soft-hone.

More About This Author

Kiril Radoslavov
Hi all, I'm from Sofia, Bulgaria. I've been working with Office 365 and Dynamics 365 for more than 5 years. Started as a Technical Support Engineer and slowly but surely found my way as Dynamics CRM Consultant. Recently I've started my own company in Bulgaria for providing training for Office 365 and Dynamics CRM. Always willing to learn new tips and tricks about Office 365 and Dynamics CRM.

Author: Kiril Radoslavov

Hi all, I'm from Sofia, Bulgaria. I've been working with Office 365 and Dynamics 365 for more than 5 years. Started as a Technical Support Engineer and slowly but surely found my way as Dynamics CRM Consultant. Recently I've started my own company in Bulgaria for providing training for Office 365 and Dynamics CRM. Always willing to learn new tips and tricks about Office 365 and Dynamics CRM.

Share This Post On