Skip to main content
Question

Is it possible to identify if a call went to voicemail with ringcentral-web-phone?

  • 25 August 2020
  • 1 reply
  • 419 views

I was wondering if is it possible to identify if a call went to voicemail with ringcentral-web-phone? If there is a response code that could differentiate from both or another event listener?

If you meant for an outbound call, the answer is NO, not with the embeddable nor with any API.

If you meant for in inbound call, the answer is YES. You can get a message event for a new voicemail when a new voicemail message is available. I am not sure why you need it because the embeddable has the message page and it shows all different types of messages including voicemails.

If you want to receive the email event programmatically, you can add this code to your web page:

window.addEventListener('message', (e) => {
const data = e.data;
if (data) {
switch (data.type) {
case 'rc-call-ring-notify':
// get call when user gets a ringing call
break;
case 'rc-call-init-notify':
// get call when user creates a call from dial
break;
case 'rc-call-start-notify':
// get call when an incoming call is accepted or an outbound call is connected
break;
case 'rc-call-hold-notify':
// get call when user holds a call
break;
case 'rc-call-resume-notify':
// get call when user unholds a call
break;
case 'rc-call-end-notify':
// get call on call end event
break;
case 'rc-call-mute-notify':
// get call on call muted or unmuted event
break;
case 'rc-message-updated-notify':
// get when a new message is available
console.log(data.message.type)
console.log(data.message.uri)
break
/* full message event payload
message:
type: "rc-message-updated-notify"
attachments: [{…}]
availability: "Alive"
creationTime: "2020-08-26T14:25:49.000Z"
direction: "Inbound"
from: {phoneNumber: "+1650xxxxxxx", name: "WIRELESS CALLER", location: "Mountain View, CA"}
id: 1166467800016
lastModifiedTime: "2020-08-26T14:25:53.238Z"
messageStatus: "Received"
priority: "Normal"
readStatus: "Unread"
to: [{…}]
type: "VoiceMail"
uri: "https://platform.ringcentral.com/restapi/v1.0/account/80964xxxx/extension/6228832xxxx/message-store/1166467800016"
vmTranscriptionStatus: "Failed"
*/
default:
break;
}
}
});

Reply