Author Topic: [MITEL 3300] how to initiate a call from an external application?  (Read 17381 times)

Offline acraig00

  • Contributer
  • *
  • Posts: 29
  • Karma: +3/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #15 on: April 05, 2013, 01:53:32 PM »
We do this with our web based CRM.

I push a registry entry to all our PCs that associates callto links (skype) to UCA via group policy.

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\callto\shell\open\command]
@="\"C:\\Program Files (x86)\\Mitel\\Unified Communicator Advanced 4.1\\ucadialer.exe\" \"%1\""


From there, you can alter the webapp to format phone number links to look like "callto:+18005555555" (we do this in our CRM)

or

i also use a google chrome extension that uses a regex to change all phone numbers in webpages to callto links.
Code: [Select]
// Modified from: Skype Linkify (http://www.questar.it/blog/developer/skypelinkify.user.js)
// Match these patterns:
//  800-555-1212
//  (800) 555-1212
//  (800)555-1212
//  800-555-1212
//  800-555-1212
//  800 555 1212
//  800.555.1212
//  800/555/1212
//  8005551212
//  +1 (number)
//  + (international number)
//
// Link to "callto:<formatted number>"
//
// ==UserScript==
// @name           Make Phone Numbers Callto: Links
// ==/UserScript==

//default prefix
const defaultPrefix= '+';

(function () {
  const trackRegex = /(\+\d\d?)?[\-\s\/\.]?[\(]?(\d){2,4}[\)]?[\-\s\/\.]?\d\d\d[\-\s\/\.]?(\d){3,5}\b/ig;

function trackUrl(t) {

if (String(t).charAt(0)!= '+') t= defaultPrefix + String(t);
return "callto:" + (String(t).replace(/[\-\s\/\(\)\.]/g, ""));
}

    // tags to scan looking for un-hyperlinked urls
    var allowedParents = [
        "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "body",
        "caption", "center", "cite", "code", "dd", "del", "div", "dfn", "dt", "em",
        "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", "i", "iframe",
        "ins", "kdb", "li", "nobr", "object", "pre", "p", "q", "samp", "small", "span", "strike",
        "s", "strong", "sub", "sup", "td", "th", "tt", "u", "var"
        ];
   
    var xpath = "//text()[(parent::" + allowedParents.join(" or parent::") + ")" + "]";

    var candidates = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

    for (var cand = null, i = 0; (cand = candidates.snapshotItem(i)); i++) {
        if (trackRegex.test(cand.nodeValue)) {
            var span = document.createElement("span");
            var source = cand.nodeValue;
           
            cand.parentNode.replaceChild(span, cand);

            trackRegex.lastIndex = 0;
            for (var match = null, lastLastIndex = 0; (match = trackRegex.exec(source)); ) {
                span.appendChild(document.createTextNode(source.substring(lastLastIndex, match.index)));
               
                var a = document.createElement("a");
                a.setAttribute("href", trackUrl(match[0]));
                a.appendChild(document.createTextNode(match[0]));
                span.appendChild(a);

                lastLastIndex = trackRegex.lastIndex;
            }

            span.appendChild(document.createTextNode(source.substring(lastLastIndex)));
            span.normalize();
        }
    }

})();

This works great for us. I know its not exactly what you asked for, but should have the same results. Hope it helps.


Offline ralph

  • Mitel Forums Admin
  • Hero Member
  • *****
  • Posts: 5767
  • Country: us
  • Karma: +469/-0
  • Published Author: http://amzn.to/2dcYSY5
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #16 on: April 05, 2013, 03:20:42 PM »
Wow!  Cool info.   This may be worth setting up a special page just to explain this.
Can you tell us how to set up Chrome with the extension?

Ralph

Offline serop

  • Contributer
  • *
  • Posts: 9
  • Country: ca
  • Karma: +0/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #17 on: April 05, 2013, 05:06:22 PM »
We do this with our web based CRM.
...
This works great for us. I know its not exactly what you asked for, but should have the same results. Hope it helps.
WOW! Looks good!

So, according to this we have to install ucadialer.exe on each user PC, right? And configure it properly for each user's post extension?
« Last Edit: April 05, 2013, 05:08:03 PM by serop »

Offline acraig00

  • Contributer
  • *
  • Posts: 29
  • Karma: +3/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #18 on: April 05, 2013, 05:49:46 PM »
Wow!  Cool info.   This may be worth setting up a special page just to explain this.
Can you tell us how to set up Chrome with the extension?

Ralph
It looks like Google has changed the process for creating extensions. Previously, i think i only had to change the file extension to .crx on a text file of the script, but that doesnt work now.

This one looks like it can provide the same functionality: https://chrome.google.com/webstore/detail/skype-links/epbmllnadbdnppblcebkkmapkinkdchd

Offline acraig00

  • Contributer
  • *
  • Posts: 29
  • Karma: +3/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #19 on: April 05, 2013, 05:58:30 PM »
WOW! Looks good!

So, according to this we have to install ucadialer.exe on each user PC, right? And configure it properly for each user's post extension?
ucadialer.exe is part of the Unified Communicator Advanced install (at least on our system), so i don't have to do anything except install the UCA software and log the user in.

This has worked for us with all versions from 4.0 to 5.0.

Make sure and put the correct version number in your reg key. I just noticed i pasted the 4.1 version in my previous post.

Offline johnp

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2202
  • Country: us
  • Karma: +66/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #20 on: April 05, 2013, 06:14:46 PM »
It looks like UCX uses ipdial.exe with parameters callto:XXXX. I played with it a little at the end of the day.

Offline serop

  • Contributer
  • *
  • Posts: 9
  • Country: ca
  • Karma: +0/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #21 on: April 05, 2013, 06:38:39 PM »
ok, I see where it all is going: it needs special installation/configuration on each user PC :(

Well, in my case there are not many users indeed but the solution does not scale and I cannot get anything extra as I would using API.
Anyway, I guess it's acceptable as a short term limited solution.  ::)
I'll give it a try. Thanks!

Offline johnp

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2202
  • Country: us
  • Karma: +66/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #22 on: April 05, 2013, 08:50:50 PM »
If you wan't anything more, you can always spend the money to become an approved Mitel software developer.

Unified Communicator Express is free Unifed Communicator Advanced who be purchased.

Offline acraig00

  • Contributer
  • *
  • Posts: 29
  • Karma: +3/-0
    • View Profile
Re: [MITEL 3300] how to initiate a call from an external application?
« Reply #23 on: April 08, 2013, 10:50:25 AM »
ok, I see where it all is going: it needs special installation/configuration on each user PC :(

Well, in my case there are not many users indeed but the solution does not scale and I cannot get anything extra as I would using API.
Anyway, I guess it's acceptable as a short term limited solution.  ::)
I'll give it a try. Thanks!

Your setup may be different, but for the sake of clarity, I do not have to touch the PCs. UCA is installed as part of our standard image (MDT/WDS/PXE), the callto links are programmed into our webapp, and the reg key gets pushed via GPO.


 

Sitemap 1 2 3 4 5 6 7 8 9 10