Tropo is part of CiscoLearn More

S3 Recordings, ring detection, and a heap of improvements

Posted on March 7, 2016 by Adam Kalsey

Today’s Tropo release has bunch of improvements and bug fixes in it. You can read the full change log as usual, but I’m going to highlight two new features here: recording upload to Amazon S3, and a new event that lets your code know when an outgoing call is ringing. All these changes are available now in the developer environment so you can start using them in your applications now. They will be promoted to the production environment in a few weeks.

Tropo’s recording feature currently can upload a recording to your server by FTP, SFTP, HTTP post, or HTTP Put. A popular request is the ability to push a recording to an Amazon S3 bucket, and we’ve in the past published sample code and blog posts showing how to do that by using HTTP Post to your own server and then pushing to S3. Today’s release adds the ability for Tropo to push to your own S3 bucket natively – no middle layer required.

In keeping with Tropo’s API design philosophy, we layered this new S3 support into our existing API so instead of giving you any new API calls to learn, we just taught the ones you already know a new trick. To use S3 as your recording storage, you’ll first need to set up an S3 bucket with Amazon. Then, in your Tropo application, set the record method to “s3” and the recording URL to the S3 bucket plus file name you want to use, for example https://s3.amazonaws.com/your_bucket_name/myrecordng.mp3. Use your AWS Access Key ID as the recording username and the AWS Secret as the recording password.

Here’s a Javascript example showing startCallRecording uploading to an S3 bucket. The recording file name is the caller ID.

startCallRecording("https://s3.amazonaws.com/my_bucket_name/" + currentCall.callerID + ".wav", {
recordUser: "AKUIEKEJOEMG8UZKX3HQ",
recordPassword: "apPetuyEqfmc3mIygtjOU812GClNG+Oh0lJbe1meB",
method: "s3"
});
say("This is a recording test!");
say("Thanks for calling");
stopCallRecording();

Tropo’s new onRinging event is available in the call() or transfer() functions. It is triggered when the number you’re calling begins ringing. This allows applications that want to track state changes on a call to track the ring. For example, if you’re building a web interface that lets a person make calls to a list of people, you might show the status of every call on the interface: ringing, answered, no answer, hung up.

Using onRinging is the same as using other Tropo events such as onAnswer or onBusy: define a function and that function will run when a call enters a ringing state. The onRinging event is only available in Tropo’s Scripting API.

Other changes in this release include an updated Ruby version, some SIP interoperability improvements, and lots of small usability improvements on both the web site and in how Tropo behaves in error conditions. Read the full change log if you’re interested in the details.

Leave a Reply