How I Became a Rockstar at TADHack (Part 1)

17 Apr How I Became a Rockstar at TADHack (Part 1)

I walked in the 2015 TADHack London hackathon with the only goal in mind to create something using a Voxbone (the company I work for) product and Telestax’s Restcomm AMI. I ended up winning a prize and became a “telco dev rockstar” for a day, all thanks to these two main technologies I used for this hack.

This 4-to-5 parts series will cover how I built this hack with close-ups on each technology and API I used. I’ll try to keep it short!

 

Smart Dispatch

The idea behind the hack was to build an intelligent click-to-call for webpages (embeddable with a small script) that directs the call to the appropriate sales agent based on context. When the call is over, the information (context) gathered from the call is forwarded to the agent’s email/sms along with a link to the voice recording of the call. I called it Smart Dispatch.

How did I get information about the caller? In order to place the call, the client has to log in with LinkedIn and the information on profile is used as the context and sent over the email and sms when the call is over.

How is the call properly dispatched? I created a management platform for the companies embedding the click to call to link their agents to a particular segment pulled from LinkedIn. For example, if the user calling in has ‘Spanish’ as a language (on its LinkedIn profile), then the agent linked to the ‘Spanish’ segment will receive the call. This can be done for country, industry, or even particular companies (for account managers that want to receive calls only from their customers.)

Please find below the video presentation

Here’s a link to my slides:

 

Here’s a link to a demo of SmartDispatch (coming soon)

 

Below I break down the app with the different technologies I used as an overview. Tutorials for each of them will follow in the next parts.

[gravityform id=”11″ title=”true” description=”true”]

  1. Creating the click-to-call with the Voxbone WebRTC-SIP SDK

Voxbone is a SIP trunk provider and sells DIDs (phone numbers) from all over the world. They provide a WebRTC-to-SIP service by sending a WebRTC browser-initated call to a SIP trunk (through one of their phone numbers). The interesting part here is that the Restcomm platform works by receiving SIP call invites so this was the perfect match!

To get this working:

– I used a free iNum from Voxbone and linked it to a SIP URI for testing (later to be replaced by the Restcomm URI).

– Downloaded the Voxbone WebRTC Node.js library and remodeled it as an embeddable script.

– Placed a call!

More info on how to get started with the Voxbone WebRTC-SIP SDK here.

 

  1. Gathering information with the Linkedin API and passing the context in the call

The Voxbone WebRTC-SIP SDK has a very useful SIP header called ‘X-Voxbone-Context’ which is passed along in the SIP invite. I used this to place any JSON object I wanted. In this case: information pull from the user’s LinkedIn profile.

When the user logged in, I placed all the useful info from his profile in a JSON object and put it in the context header to be passed along with the call.

More info on how to get started with LinkedIn authentication here (I used OAuth Passport for Node.js)

click2call

 

  1. Figuring out who to send the call to with the management tool

In order to get the dispatching dynamic, I created a management tool for the agents to be configured to a particular segment. From this management tool, I created a small API for the click to call to pull this information from. Now, every time someone logs in via LinkedIn on the click2call, I know which segment he’s in and can know dynamically who to call.

 

dashboard

I also use this platform/API to configure the agent’s phone number and email address to send the info at the end of the call.

 

  1. Forwarding and recording the call with Restcomm

Half of the application is done. I have all the info I need, and know which agent to send the call to. Now I need to send the call to Restcomm to forward it to the agent’s SIP client and record the call.

Since this is a hack, I made the dynamic dispatch on my end before reaching Restcomm. Ideally, I would use Restcomm as the dispatcher based on this info I sent it.

The great thing was that Restcomm was able to read my X-Voxbone-Context header with all the information I placed in it. This way, I could build anything from an IVR to a call-forward(er) based on the info I passed.

My Restcomm flow will be covered in more details later. Below is the overview:

  1. When call is launched, pass the context header to Restcomm
  2. IVR reads name and asks to wait for call to be placed
  3. Sends to call to agent’s SIP phone (this is where I’d like the intelligent dispatch to happen in the future)
  4. Starts recording the call
  5. When call ends, it sends me a link to the recording of the call (back to my REST service). So I can process it in my emails/sms

Here it is, working in action!

click2call

 

  1. Returning info and recording to agent with Nexmo and Mailgun

The hard part is all done now. I’ve got an intelligent call dispatcher that records the call. I can now send an SMS and an email with all the info:

– Profile info of the caller

– URL the caller was looking at

– URL of the voice recording of the call.

– And more!

 

Since I have my own database with the agents’ information configured, I know where to send all that info. I used Nexmo and Mailgun for that – they are pretty good APIs and were easy to use for the little time I had left to implement these features!

 

Here’s the info sent over sms to the agent:

sms (1)

 

Here’s the info sent over email to the agent (with a link to the recording of the call):

 

email

Conclusion

 

The next iteration of Smart Dispatch will see speech-to-text integration and more modularity with external services (Facebook, Act-On, Zoho, Salesforce). However, stay tuned for the next steps of this tutorial!

TADHack was a wonderful experience as I was able to work closely with the Restcomm team and get my application up and running very quickly. Alan Quayle pulled off a fantastic event filled with passionate developers eager to see WebRTC evolve in something bigger. Thank you for everything Alan!

Restcomm has the potential to do many more great things, like sending SMS or email from its own platform. All API/SDK I used were very flexible – remember this was all done in under 20 hours!

Here is the second iteration of Smart Dispatch and to the following parts of the tutorial.

Look out on twitter @SachaNacar for a LOT more code is coming soon!

No Comments

Post A Comment