question

Paul Faix avatar image
Paul Faix asked Embbnux Ji commented

Embeddable Widget - include custom medatata when making a call

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.

call handlingwebhooksembeddable
1 comment
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

@Embbnux Ji could you help with this? Thanks

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered

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.

1 |3000

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

Embbnux Ji avatar image
Embbnux Ji answered Embbnux Ji commented

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

2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

I think what he asked for is a way to inject extra metadata to a telephony session event notification. That is not possible.

But as the question was not very clear because he mentioned the RC embeddable widget so I am not so sure about when (at which point) he wants to inject the extra metadata to the event.

If the extra metadata is injected from his server and passing to the embeddable widget client, then maybe he can host the embeddable code, capture the telephony session events and add extra metadata to the event and pass them to the embeddable widget client. If this is the case, it is possible this way, right?

0 Likes 0 ·
Embbnux Ji avatar image Embbnux Ji Phong Vu ♦♦ commented ·

Yeah, I know Paul wants to pass the metadata to the widget, but the metadata will not be used by the widget. It is still used for his app in widget's call event. So I think Paul can just map telephony session id with metadata in his app.

0 Likes 0 ·

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