Search code examples
dynamics-crm

Click-To-Call feature for Dynamics CRM (like Lync/Skype)


Advance warning: Im an absolute newbie to Dynamics CRM!

Intention

I want to have a feature like Lync/Skype integration but use my own URL. (Click on any telephone number inside CRM and call it).

For eg. assuming I have a web service which can initiate a call per URL: http://telephony.com/call?nr=012345678. Now, whenever a CRM user clicks onto a telephone number field (in forms and views) inside the CRM my web service should be called instead of Skype/Lync.

In fact I'm trying to reproduce sth. like the InGenius Connecter.

Attempts

I already tried to inject a JS web resource to a specific formular (in my case it was the default contact form) and override the Mscrm.ReadFormUtilities.openPhoneClient callback (which seems to handle the Lync/Skype integration).

function load() {
    // override integrated CTC (Lync/Skype)
    Mscrm.ReadFormUtilities.openPhoneClient = function (telephoneNr) {
        // redirect user to my web service
        window.location.replace("http://telephony.com/call?nr="+telephoneNr);
        return; 
    }
}

Found this method at: Disable Lync completely

This does work well in forms of Dynamics 2015 (my custom link pops up instead of Skype/Lync). However, this does only work on entity forms since I can't inject web resources into an entity view.

My other ideas how to implement such a feature are:

  1. Inject global JS resource which disables Lync/Skype and encapsulate every telephone number with link to my custom URL.
  2. Extend/Manipulate Lync/Skype integration to use my custom URL instead of Lync/Skype.
  3. Write plugin which encapsulate telephone numbers server side.

Question

Since I have a grasp understanding of Dynamics and no experience in plugin/resource development, I'm left a bit confused with these questions.

  1. Is it possible to achieve any of the three ideas above ?
  2. If not, any idea how InGenius solved this problem ?
  3. Do you have any other idea/resources about this topic ?

Solution

  • Currently I found two options available to achieve a custom CTC feature. (Both has the downside of not being officialy supported by the dynamics crm.)

    Global Ribbon

    Pretty simple: Add a Click-To-Call button to global ribbon which is only enabled on specific grids when one row is selected. This button refers to an JS-Action which retrieves the telephone number via ODATA and then launches the dial process.

    Global Ribbon CustomRule injection

    Add a global button to ribbon which refers to a JS resource per <CustomRule>. The JScript then unbinds all actions from links with .ms-crm-Phone classes and replaces its href-attribute.

    This would be useful if one want to override the integrated "Skype / Lync - Click to Dial" feature with his own logic.

    I didn't test this method until now, so I can't guarentee it's working !

    Note: I will include example scripts as soon I got the time.