show the notification in the page
Jul 21, 2022 at 10:57pm • 1 replies • 0 likes
Abhishek Babal
i am integrating RC web widget in CRM now i want to show the notification on the CRM page whenever call is active.....so can you tell me how can i do this
1 Answer
Add this Javascript function to your code. Detect the event and do/show whatever you want to do with them,
window.addEventListener('message', (e) => { const data = e.data; if (data.call && data.call.direction == 'Inbound'){ console.log(`Incoming call from: ${data.call.from.phoneNumber}. Call status: ${data.call.telephonyStatus}`) if (data.call.telephonyStatus == 'Ringing') console.log("Incoming call ringing") } if (data) { switch (data.type) { case 'rc-call-ring-notify': // when user gets a ringing call console.log("RINGING...") console.log(data.call); break; case 'rc-call-init-notify': // when user creates a call from dial console.log("SETUP...") console.log(data.call); break; case 'rc-call-start-notify': // when a incoming call is accepted or a outbound call is connected console.log("INCOMING RING...") console.log(data.call); break; case 'rc-call-hold-notify': // when user holds a call console.log(data.call); break; case 'rc-call-resume-notify': // when user unholds call console.log(data.call); break; case 'rc-call-end-notify': // when call ended console.log("TERMINATING...") console.log(data.call); break; case 'rc-call-mute-notify': // when muted or unmuted event console.log(data.call); break; case 'rc-message-updated-notify': console.log("VOICEMAIL?") console.log(data.message.type) console.log(data.message.uri) break default: console.log("OTHERS...") //console.log(data); break; } } });
0
Abhishek Babal on Jul 22, 2022 at 9:21pm • 0 likes
i want to show the message on website not in RC widget.........like when a call is answered on the page it shows (call active from {number} to {number}) so that other users of RC can see that on CRM can see that message
Phong Vu on Jul 23, 2022 at 7:50am • 1 likes
This is the Javascript code on your front end. You get the notification in your code and you show whatever, wherever you want to show. Do I need to show you how to make a popup or display on a page?
Abhishek Babal on Jul 23, 2022 at 8:00am • 0 likes
yes if you can show ........plz help
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder