Sometimes in a contact centre an agent needs to know exactly where in the world a person is. This is often not an easy task, especially if the person calling is in an emergency situation. What if you could send them an SMS while they're on the call and display their precise location to the agent who answers their call?
Twilio provides all the building blocks to handle this omni-channel interaction and the ability to route the caller and present the information to the agent.
- Twilio Studio
- Twilio Sync
- Twilio Voice and SMS
- Twilio Flex
- Server side application using Flask, Twilio REST APIs and Google Maps API
- Front end for caller to publish location using Javascript, Google Maps API, Twilio Sync SDK
- Caller dials a Twilio number and is directed to a Studio flow
- Caller accepts being sent an SMS and is placed in a queue
- Caller stays on the phone, taps the link in the SMS
- Caller confirms location through mobile browser
- Location is written to a Twilio Sync document identifiable by the caller's phone number
- A task is created with the callers latitude and longitude; the caller is enqueued to Twilio Flex
- Agent accepts the task and is connected to the caller
- Flex plugin replaces the CRM container with a Google Maps view showing the callers location
Follow the instructions here to get up and going https://www.twilio.com/docs/flex/flex-onboarding-instructions
Head to https://www.twilio.com/console/studio/dashboard. Create a new flow. You can either create your own from scratch, or use Studio Flow JSON and paste in the contents using Import from JSON in the template options. Change the configuration of your Flex number to direct to this new flow, or purchase a new number. You could also modify the default Flex flow.
Once deployed, note the URL Heroku creates for you. You can either go to your Heroku Dashboard and add SERVICE_BASE_URL
with your Heroku URL or from CLI heroku config:set SERVICE_BASE_URL="<YOUR_HEROKU_URL>"
Follow the instructions here: https://www.twilio.com/docs/flex/tutorials/building-flex-plugins
When you reach the part about adding the Bing URL, add this instead:
flex.CRMContainer.defaultProps.uriCallback = (task) => {
return task ? `https://www.google.com/maps/embed/v1/place?key=<YOUR_GOOGLE_API_KEY>&q=${task.attributes.lat},${task.attributes.lng}&zoom=17` : "https://bing.com/";
}
Follow the rest of the instructions to test and deploy your plugin