O'Reilly logo

Asterisk Cookbook by Russell Bryant, Leif Madsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Audio Manipulation

Introduction

The recipes in this chapter are designed to help you with the injection of audio into and the monitoring of channels in your Asterisk environment. Many of the recipes focus on a particular aspect but can be built up or modified using the skills learned in other recipes in this book.

Monitoring and Barging into Live Calls

Problem

As the manager of a call center, you need to be able to listen in on calls to help with training new employees.

Solution

The most simple solution is to simply connect to any active channel using the ChanSpy() application, which then provides you the ability to flip through active channels using DTMF. The b option means to only listen to actively bridged calls:

[CallCenterTraining]
exten => 500,1,Verbose(2,Listening to live agents)
   same => n,ChanSpy(,b)

If you only want to spy on certain channels, you can use the chanprefix option to control which types of channels you want to listen to. So, if we just want to listen to SIP channels involved in bridged calls, we would do this:

[CallCenterTraining]
exten => 500,1,Verbose(2,Listening to live agents)
   same => n,ChanSpy(SIP,b)

Discussion

The default DTMF keys for controlling ChanSpy() are as follows:

#

Cycles through the volume level

*

Stop listening to the current channel and find another one to listen to

There are a lot more options for ChanSpy() and ways to use it in your dialplan. With some creativity, ChanSpy() can be used in many situations it wasn’t necessarily designed for (see ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required