Contacts

First NameLast NameURLPhone
JohnWanghttp://github.com/grokify

Demo Instructions

  1. Ensure that you have Configured this demo app and authorized it to access your RingCentral account.
  2. For RingUri (URI Scheme) and optionally for RingOut, ensure that you are dialed into the RingCentral for Desktop softphone application.
  3. Edit the phone number in the text input field to be a live number.
  4. Click any of the three action buttons, RingOut, RingUri or SMS

Developer Instructions

Install RingCentral softphone (optional)

Installation of the RingCentral softphone or mobile phone app is necessary if you wish to use the URI Scheme click-to-dial functionality described below. You can download these here:

  1. RingCentral for Desktop softphone
  2. RingCentral for Android
  3. RingCentral for iPhone
Installing the RingCentral for Desktop softphone

Download and install the RingCentral for Desktop softphone

The navigate to the MacOS directory which may be /Applications/RingCentral for Mac.app/Contents/MacOS and add a config.ini file with the following contents:

HttpRegServer  = "http://agentconnect.devtest.ringcentral.com"
PlatformServer = "https://platform.devtest.ringcentral.com"

Click-to-Dial via URI Scheme

RingCentral for Desktop can support dialing out using the tel or rcmobile URI schemes as follows:

<!-- rcmobile is only used by RingCentral -->
<a href="rcmobile://call?number=16501112222">1-650-111-2222</a>
<!-- tel can be used by may be used by multiple apps -->
<a href="tel:1-650-111-2222">1-650-111-2222</a>
<a href="tel:16501112222">1-650-111-2222</a>

Additionally, for Google Chrome, it may be necessary to execute a JavaScript redirect as follows:

// Use the following for Google Chrome only
var w = (window.parent)?window.parent:window;
w.location.assign('rcmobile://call?number=16501112222');
// For more info, see http://stackoverflow.com/questions/2330545/

For more inforomation on Google Chrome, please see this Stack Overflow link.

Click-to-Dial via RingOut

function ringOutHelper(rcsdk) {
    var t=this;
    t.rcsdk = rcsdk;
    t.init = function() {
        t.platform = t.rcsdk.platform();
        var helpers = RingCentral.Helpers;
        t.Ringout = helpers.ringout();
        t.Utils = helpers.utils;
        t.timeout = null; // reference to timeout object
        t.ringout = {};
    }
    t.handleError = function(e) {
        console.log("ERROR: " + e);
    }
    t.create = function(unsavedRingout) {
        console.log("CREATE " + JSON.stringify(unsavedRingout));
        t.platform
            .send(t.Ringout.saveRequest(unsavedRingout))
            .then(function(response) {
                console.log('RINGOUT_CALL_SUCCESS');
                //t.Utils.extend(t.ringout, response.data);
                //console.log('Info: First status:', t.ringout.status.callStatus);
                //t.timeout = t.Utils.poll(update, 500, t.timeout);
            })
            .catch(function(e) {
                console.log('RINGOUT_ERROR: ' + e.message);
            });
        }
        t.init();
    }
    t.createRingOut = function(unsavedRingout) {
        var roHelper = new ringOutHelper(t.rcSdk);
        roHelper.create(unsavedRingout);
        return roHelper;
    }
}

SMS

platform.post('/account/~/extension/~/sms', {
    from: {phoneNumber:from}, // Your sms-enabled phone number
    to: [
        {phoneNumber:to} // Second party's phone number
    ],
    text: text
}).then(function(response) {
    console.log('SMS_SEND_Success: ' + response.json().id);
}).catch(function(e) {
    console.log('SMS_SEND_Error: ' + e);
});