Coder Social home page Coder Social logo

stuartlogan82 / geolocator Goto Github PK

View Code? Open in Web Editor NEW
10.0 0.0 10.0 38.47 MB

Need to locate your customers before they are connected to a contact center agent? Here are the bare bones to get it done

Python 36.02% CSS 11.95% HTML 28.08% JavaScript 23.95%
twilio geolocation sms ivr contact-center omni-channel studio flex twilio-flex

geolocator's Introduction

Twilio Live Call Geolocation

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.

Technologies

  1. Twilio Studio
  2. Twilio Sync
  3. Twilio Voice and SMS
  4. Twilio Flex
  5. Server side application using Flask, Twilio REST APIs and Google Maps API
  6. Front end for caller to publish location using Javascript, Google Maps API, Twilio Sync SDK

Call Flow

  1. Caller dials a Twilio number and is directed to a Studio flow
  2. Caller accepts being sent an SMS and is placed in a queue
  3. Caller stays on the phone, taps the link in the SMS
  4. Caller confirms location through mobile browser
  5. Location is written to a Twilio Sync document identifiable by the caller's phone number
  6. A task is created with the callers latitude and longitude; the caller is enqueued to Twilio Flex
  7. Agent accepts the task and is connected to the caller
  8. Flex plugin replaces the CRM container with a Google Maps view showing the callers location

GIF of call flow

Setup

Step 1: Provision a Twilio Flex Instance

Follow the instructions here to get up and going https://www.twilio.com/docs/flex/flex-onboarding-instructions

Step 2: Configure IVR in Studio

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.

Studio Flow

Step 3: Deploy Server Side Application

Deploy

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>"

Step 4: Create a Flex Plugin

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

geolocator's People

Contributors

stuartlogan82 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geolocator's Issues

Not able to deploy heroku app even with valid API keys and secret

I am trying to deploy this heroku app with valid google / twilio API keys and secrets, however, it is failing to deploy.

Given below error during Build app:

There was an issue building your app. This can mean your app.json's project is not a valid Heroku application. Please ensure your app is deployable to Heroku and try again.

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> Using Python version specified in runtime.txt
! Requested runtime (python-3.6.5) is not available for this stack (heroku-20).
! Aborting. More info: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed

I appreciate your work.

Helping with an app

Hi there, I love this and I want to use it to help with an app for this time and the virus. Do you think you would be able to help me to get it done using your code?

I am creating a website / app for users in this time of crisis. I want to be able to make something super simple for the person needing help ideally they would call a number and dial in :

1 for i need items
2 for medication
3 for I need to speak to some
4 its an emergency

The idea would be the call could be tracked by a location and the users signed up to help others get notified and accept to help them using the location piece you have done here we could make something really easy for them to use.

We are doing this to help and hope you will help us do this too as I am part of the vulnerable side being type one diabetic and know how scary this time is.

Do you think this is possible or a good idea as the elderly may not be able to use the website! I really could use extra hands for help on this!

Thanks and sorry I have to put this as an issue!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.