question

Brian Graves avatar image
Brian Graves asked Brian Graves answered

Obtaining caller ID in script

I'm using the RingCX Voice Script Designer. My script displays a URL popup window immediately when someone calls. This works fine. However, I want to obtain the caller ID (phone number) of the person calling so I can pass this as a parameter for my URL. Unfortunately, I'm not finding any documentation about how to access the caller phone number in RC script. It looks like the call detail is accessible by running Cloud reports and Realtime report but this seems like overkill just to get the phone number of the current caller. Does anyone know any easy way to get this in Javascript?

caller id
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Craig Chan avatar image
Craig Chan answered

Hi Brian,

Would this help?
https://support.ringcentral.com/article-v2/Using-the-Scripting-node-in-the-RingCX-IVR-Studio.html?brand=RingCentral&product=RingCX&language=en_US

You are looking for the ANI (Automatic Number Identification) which is the incoming caller number.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Brian Graves avatar image
Brian Graves answered

Found the answer here: https://support.ringcentral.com/ca/en/engagevoice/admin/voice-admin-use-javascript-tool.html

Here's the working code that I put in my script:

var phoneNumber = getData(model.call.ani);
alert("phoneNumber:" + phoneNumber);

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys