Skip to main content
Question

Need get customer details when receive Call

  • January 3, 2022
  • 2 replies
  • 432 views

Hello,

I integrate https://github.com/ringcentral/ringcentral-embeddable in my website and also have live account for call in US

https://service.ringcentral.com/ from here create new contact with all details.

When i get call than i want to show other information like company name & customer nick name in embeddable popup

Please suggest

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • January 7, 2022

If you need to display the customer details inside the embeddable widget, you'll need to clone the embeddable source code and customize it the way you want to and host it in your own server.

If you need to display the customer details in your website, you need to register for the incoming call events notification, then capture the caller phone number and do a lookup to get the customer detailed info then display it.

window.addEventListener('message', (e) => {
  const data = e.data;
  if (data.call && data.call.direction == 'Inbound'){
    switch (data.type) {
      case 'rc-call-ring-notify':
        console.log(`Incoming call from: ${data.call.from.phoneNumber}. Call status: ${data.call.telephonyStatus}`)
      getCustomerDetails(data.call.from.phoneNumber)
      break;
      ...
    }
  }
});

function getCustomerDetails(callerPhoneNumber){
  // do your own look up using the caller phone number
}

  • Author
  • Participating Frequently
  • January 13, 2022

Hello,

According to your suggestion i use below code for get customer data as `data.call.contactMatch.notes` which get details but when i change that details from ringcentral admin than can't get updated value.

Please suggest.