TwilioDevEd / voice-javascript-sdk-quickstart-php

MIT License
16 stars 8 forks source link

Popup on every page? #44

Closed gloverconsulting closed 1 year ago

gloverconsulting commented 2 years ago

I am having great success with this project and integrating it with an existing custom CRM. Is there a code sample or an upgrade or something that would allow us to turn this into a popup when calls come in that is visible on every page of the CRM as opposed to only being on a separate page? Also, if we are using this for multiple Twilio numbers can the name associated with the Twilio number also be displayed when a call comes in?

bld010 commented 1 year ago

Hi @gloverconsulting I think it depends on how your CRM works. You need to instantiate a Twilio.Device and invoke device.register() and ideally, you're only doing this once per user session. This would be possible if there were a parent component or wrapper where the Twilio.Device could "live" and not be re-instantiated on each page.

For the phone number, you could show the name of the phone number, but this would need to depend on your own logic on the client side. You can inspect the "To" number for incoming calls within your 'incoming' call handler and display the appropriate name.

gloverconsulting commented 1 year ago

Thank you for your response. Do you have a code example on how to inspect the "To" number for incoming calls within this system?

Patty

From: Brianna DelValle @.*** Sent: October 17, 2022 11:37 AM To: TwilioDevEd/voice-javascript-sdk-quickstart-php Cc: gloverconsulting; Mention Subject: Re: [TwilioDevEd/voice-javascript-sdk-quickstart-php] Popup on every page? (Issue #44)

Hi @gloverconsulting https://github.com/gloverconsulting I think it depends on how your CRM works. You need to instantiate a Twilio.Device and invoke device.register() and ideally, you're only doing this once per user session. This would be possible if there were a parent component or wrapper where the Twilio.Device could "live" and not be re-instantiated on each page.

For the phone number, you could show the name of the phone number, but this would need to depend on your own logic on the client side. You can inspect the "To" number for incoming calls within your 'incoming' call handler and display the appropriate name.

— Reply to this email directly, view it on GitHub https://github.com/TwilioDevEd/voice-javascript-sdk-quickstart-php/issues/44#issuecomment-1281310750 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AYAROUZVTXRVQGRIWAUYIUDWDWMFFANCNFSM5PVQSF3Q . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AYAROU3Q4X6ZYNAQZJLYO73WDWMFFA5CNFSM5PVQSF32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJRPUAHQ.gif Message ID: @. @.> >

bld010 commented 1 year ago

This line is an example of how to check the 'To' number ($_REQUEST['To'])