// Blog

Making, Recording and Transcribing Phone Calls from Slack

Originally published on the Clarify.io blog. View archived copy.

Following up on the last in my series of demos where we showed how to use Clarify with WebRTC and how to use Clarify with Dropbox, we thought it would be fun to combine our favorite service these days, Slack, with Clarify to make, record, search and transcribe audio calls.  In this demonstration we’ve used the Twilio Voice APIs to do all of the light lifting of making and recording the call.

slackClarify + Twilio + Slack

In the following video, you’ll see a demonstration of how we used the Slack Slash Command API and Slack Web API to turn the a Slack Channel into a voice communication channel. The goal of the demo project was to show:

  • Integrating with Slack in a simple way, using the Slash Command API
  • Make calls to other Slack users in my Slack instance or to any regular phone number
  • Record the audio and send it to Clarify for indexing
  • Process all of the callbacks from Clarify, Twilio and Slack (phew!)
  • Allow the user to search, transcribe and even index arbitrary media all while never leaving the Slack interface

In a perfect world, we would be able to play the media from within Slack. However, there was no obvious way to embed media players within Slack, so this demonstration shows the media player in a simple Bootstrap interface on top of our NodeJS backend.

This short video shows the app in action.

How It Works

We created a Slack Slash Command Integration that, when invoked, sends the command payload to our NodeJS application.  We called the Slash app ‘Clarifyer.’   When our app receives the Slack command, it processes the contents and takes the appropriate action. The possible commands are:

  • /clarifyer call <@slackusername> or <phone number>
  • /clarifyer search <search text>
  • /clarifyer transcribe <id>
  • /clarifyer index <url>

When a phone call is initiated from Slack, we use the Twilio API to complete a two-legged call and bridge the two legs together. Once the 2nd leg answers, we start recording the audio.  When the call is hung up, we grab the recording url from Twilio and send it to Clarify to get the audio indexed.  Once Clarify finishes indexing, a message is posted to the Slack Channel where the call originated letting the user know that the audio is now searchable.

We also update the DB with cost and duration information.  The user is then able to search the contents of the media and play back.

Technology Stack

  • Node 0.12
  • MongoDB
  • Express JS
  • Twilio API
  • Slack Slash Command API
  • Slack Web API
  • Clarify.IO API
  • Grunt, Bower

Running It For Yourself

To run the demo, download the source code from my clarify-slack Github repository. Inside the project source, check out the detailed README for all of the steps to get the application running on your machine. Don’t forget that that your app will need to be accessible from the outside world in order to receive the Slack, Twilio and Clarify callbacks.

If you have any problems getting things running, you can reach out to me on Twitter. I’ll be happy to help.

I hope you find this demo useful, and that it jumpstarts your development with Clarify and Slack.

scott-barstowAbout the Author

Scott Barstow is a veteran software developer and builder of next-generation business applications based in Raleigh-Durham, NC. When not building Clarify mashups, he stays busy helping startups in RDU and around the US build great technology. You can find him online at ScottBarstow.com or@scottbarstow on most all of the big social platforms.