Question

Embeddable Widget - include custom medatata when making a call

  • 10 March 2023
  • 3 replies
  • 360 views

Hi,

I am integrating the RingCentral Embeddable widget to our web app. We want to make & receive calls using the widget. Is there any way to include custom metadata when making a call?

According to docs, these are 2 ways how to make a call (working OK for us):

1)

document.querySelector("#rc-widget-adapter-frame").contentWindow.postMessage({
  type: 'rc-adapter-new-call',
  phoneNumber: `phoneNumber`,
  toCall: true,
}, '*');

2)

RCAdapter.clickToCall('phoneNumber')


We are listening to call events this way:

window.addEventListener('message', (e) => {
  // process e.data
});


When certain events are received from the widget, we do an AJAX call to our server an register the call (ID of the call, caller, callee, etc.) However, we would like to extend the event's data with some custom data (e.g. some internal IDs, referrer from where the call was made, etc.) so we are able to link the call with proper entities in our system.

Is this possible?

Thank you.


3 replies

Userlevel 1

@Embbnux Ji could you help with this? Thanks

Userlevel 1

No, you cannot add extra metadata to the telephony session event. You cannot add extra data to call via the RingCentral embeddable nor via the RC app.

You have to rely on the caller id and implement a look up from your db or a table to map that caller id to an internal id.

Hi @Paul Faix Every call in RingCentral has a unique telephonySessionId. You can save this in your system to map other data.

Reply