VoIP SIP SDK
High performance VoIP SDK for .Net developers
Search the manual:
Overview Quick start Download Manual How to buy! Support Contact Us
VoIP SIP SDK SIP SDK Home

  Product information
  Online manual
  Introduction
  VoIP Technology
  Ozeki VoIP SDK
  Developers Guide
  Softphone Development
  Webphone Development
  Voice Recording
  IVR Development
  PBX Development
  Call Center Development
  How to build a simple call center server
  Automatic Call Distribution
  Manager
  Operator
  Automation
  DTMF autodialer
  Voice Activation Detection (VAD)
  Predictive dialer
  Multi-site call center
  Remote call center agents
  Secure tunneling
  Facebook webphones
  Web page integration
  VoIP CRM Integration
  Mobile phones and platforms
  Billing
  Further VoIP SIP SDK Example Programs
  Appendix
  Ozeki VoIP Training
  Softphone GUI
  FAQ
  Commercial information
  About us
  Search
 


Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail:  info[at]voip-sip-sdk.com

If you have a technical question, please submit a support request on-line.

Callcenter developers
If you are working on telephone solutions, please check out the Ozeki VoIP SIP SDK.
It can be used to create:

Webphone solutions:
- Adobe Flash video phone
- Silverlight video phone
- Web to web calls
- Web to VoIP calls

Custom SIP clients:
- Silverlight SIP VoIP client
- Flash SIP VoIP client
- C# .net SIP VoIP client
- ASP .net SIP VoIP client
- Web based SIP VoIP client

Custom VoIP solutions:
- VoIP SIP softphones
- VoIP call center clients
- VoIP IVR systems
- VoIP predictive dialer systems
- VoIP auto dialer systems
- VoIP call assistant
- VoIP call recording systems
- VoIP intercom solutions

OZEKI VoIP SDK - Product Guide

Voice Activation Detection (VAD) ContentsMulti-site call center

Home > Developers Guide > Call Center Development > Automation > Predictive dialer

Building a predictive dialer system (detect fax, busy signal, human voice)


Download: 22_AnswerMachineDetector.zip

This article is a brief introduction about predictive dialer systems in relation with Ozeki VoIP SIP SDK. After reading through this page you will be fully familiar with all the essential terms concerning predictive dialing and what you will need for creating your own solution using Ozeki VoIP SIP SDK.

Prerequisites:

Operating system: Windows 8, Windows 7, Windows Vista, Windows 200x, Windows XP
System memory: 512 MB+
Free disk space: 100 MB+
Development environment: Visual Studio 2010 (Recommended), Visual Studio 2008, Visual Studio 2005
Programming language: C#.NET
Supported .NET framework: .NET Framework 4.5, .NET Framework 4.0, .NET Framework 3.5 SP1
Software development kit: Ozeki VoIP SIP SDK(Download)
VoIP connection: 1 SIP account

Jump to the source code explanation >>>

Introduction

In a call center system the communication can be started from inside or outside the system. When an outside communication request is received it usually means that a customer calls the call center for some reason. But there is also a possibility to start calls from inside the call center, for example in case of a callback request.

When a call center agent performs a callback towards a customer, the calling process also goes through the call center server, therefore there is the possibility to implement some checking processes on the server-side. These processes can be used for detecting the fact that the called customer's line is engaged or that a fax machine answered the call.


Figure 1 - VoIP predictive dialer

The call answering can be analyzed by a voice recognition system that should distinguish between the fax machine, a busy signal or the actual human voice. The call will only be literally established between the agent and the customer, when a human voice answers the phone call.

In the following section you will learn how you can extend your Ozeki VoIP SIP softphone application with the support for predictive dialing. For this purpose, you will need to download and install Ozeki VoIP SIP SDK first.

Creating an AudioHandler for voice detection

Ozeki VoIP SIP SDK provides the possibility for extending the existing tools if you have some special purpose to fulfill. In the case of distinguishing between a human and machine answer you need to define a subclass for the Ozeki VoIP SIP SDK provided AudioHandler class (Code 1).

Your DetectorClass instance, as it is an AudioHandler, can be attached to an AudioReceiver object by a MediaConnector.

class DetectorClass : AudioHandler
Code 1 - You need to define a new AudioHandler for audio detection

In this new class you will need to implement the DataReceived() abstract method inherited from the AudioHandler class. This method is called when audio data is received from the AudioReceiver attached to the DetectorClass object (Code 2).

DetectorClass detector = new DetectorClass();
PhoneCallAudioReceiver audioReceiver = new PhoneCallAudioReceiver();
audioReceiver.AttachToCall(call);
MediaConnector.Connect(audioReceiver, detector);
Code 2 - You will need to attach your detector object to the audioReceiver object

The algorithm that needs to be implemented in your detector class' DataReceived() method is detailed in the next section. If you have implemented this detection algorithm, you will be able to distinguish between a human voice and an answering machine with a very good detection rate.

The algorithm for answering machine detection

The detection rate can never be 100% as the answering machines no longer use standard signaling. In fact, you can make a VoIP softphone to behave as an answering machine with only playing a .wav audio file with a single sentence like: "I'm listening to you" and without any indication of a beep noise. Therefore modern answer machine detection algorithms do not operate with the detection of the beep signal but work according to the average human and machine telephoning behavior.

The following algorithm checks the length of the salutation and the silence after the salutation as a basis. It can be stated that an average human answers the phone by saying a simple "Hello" or maximum saying something like "Hello, this is Bob Smith speaking". After this the called person is waiting for an answer that means there will be a given length of silence after the salutation.

In the case of an answering machine the salutation is usually longer like "Hello, you have called the Smith family. We are currently not at home, please leave us a message". After this there can be an actual beep signal but it is not necessary.

If you want to distinguish between the human answer and the answering machine you will need to set some basic variables that define the minimum, maximum and recommended length of a given speech or silence period.

The detection algorithm needs some basic values that are shown in Table 1.

NameRecommended ValueDefault ValueDefinition
MinSilencePeriod375 (ms)608 (ms)Amount of time that the signal must be silent after speech detection to declare a live voice.
AnalysisPeriod2500 (ms)1592 (ms)Amount of time (from the moment the system first detects speech) that analysis will be performed on the input audio.
MaxTimeAnalysis3000 (ms)8000 (ms)The period in which CPAAnalysisPeriod must start and stop or voice will be declared. This timer starts at off-hook.
MinimumValidSpeechTime112 (ms)112 (ms)Amount of time that energy must be active before declared speech. Anything less is considered a glitch.
Table 1 - The key values for the answering machine detection algorithm

In the following examples (Figure 1 and Figure 2) you will see how the algorithm should work for the most effective detection rate.

Figure 1 shows the case when a person answers the phone. After the line is established and the call started, the algorithm waits for the incoming audio data. If the audio stream length exceeds the MinimumValidSpeechTime value, it is considered that some kind of speech is being received.

When the algorithm detects a silence period it measures its length and if this length exceeds the MinSilencePeriod value then the algorithm declares that the call was answered by a person.


Figure 1 - The detection algorithm in case of a human voice

It is essential that the detection only works till the length of the speech does not exceed the AnalysisPeriod. In the other case the algorithm declares that the call was answered by a machine (Figure 2).


Figure 2 - The detection algorithm in case of an answering machine.

Using the AnswerMachineDetector MediaHandler

Ozeki VoIP SIP SDK from version 9.1.0 provides an inbuilt MediaHandler class for answering machine detection that is based on the above mentioned algorithm. The example program you can download from this page shows how you can use an AnswerMachineDetector for your purpose to detect if the call was answered by a human or an answering machine.

As the AnswerMachineDetector is a standard MediaHandler class the usage of it is simple and similar to the other MediaHandler objects.

Code 3 shows how you can initialize an AnswerMachineDetector object. The detector needs to be subscribed to the DetectionCompleted event in order to realize when the detection session is over.

manchineDetector = new AnswerMachineDetector();

manchineDetector.DetectionCompleted += manchineDetector_DetectionCompleted;
Code 3 - The initialization of an AnswerMachineDetector

The event handler method (Code 4) can be really simple. In this example it only pops up a message box with the result of the detection. You can, of course, write more sophisticated event handler method that serves your exact purpose. For example, if you want to stop the call in case an answering machine answered it, you can write that code here.

void manchineDetector_DetectionCompleted(object sender, VoIPEventArgs e)
{
    InvokeOnGUIThread(()=> MessageBox.Show("Detection completed. Result: " + e.Item));

}
Code 4 - The event handler method for the DetectionCompleted event

In order to make the AnswerMachineDetector work in a phone call, you need to connect it to the audio receviver object that will be attached to the call (Code 5).

mediaConnector.Connect(phoneCallAudioReceiver, manchineDetector);
Code 5 - You need to connect the machine detector to the audio receiver object

The machine detector needs to be started when the call started (it is when the call state is InCall). This means that in the phoneCall_CallStateChanged method, you need to start the detector when the call is in InCall state (Code 6);

void phoneCall_CallStateChanged(object sender, VoIPEventArgs<CallState> e)
        {
            if (e.Item.IsInCall())
            {
                phoneCallAudioReceiver.AttachToCall(phoneCall);
                phoneCallAudioSender.AttachToCall(phoneCall);
                manchineDetector.Start();
            }
Code 6 - Starting the detection

The detection can be stopped when the detector is able to produce a result about the remot party but it also needs to be stopped when the call is ended, even if there is no detection result. The end of the call is specified by the Completed call state, therefor you need to stop the detection in the phoneCall_CallStateChanged event handler when the call stet is Completed (Code 7).

else if (e.Item.IsCallEnded())
            {
                phoneCallAudioReceiver.Detach();
                phoneCallAudioSender.Detach();
                manchineDetector.Stop();
                ...
Code 7 - You need to directly end the detection if the call is ended

The other parts of the sample program remains the same as in case of a standard softphone, this means that you can paste the code for the detection into your already existing softphone application and it will be capable of detecting if an answering machine has answered the call.

Further possibilities

If the above mentioned functions have called your attention contact us at info@voip-sip-sdk.com.

You can check licensing information about Ozeki VoIP SIP SDK on Pricing and licensing information page.

Summary

This article introduced you the basic knowledge about predictive dialer system and showed how Ozeki VoIP SIP SDK can help you to fulfill your wishes about this topic. If you have read through this page carefully, you already have all the knowledge you need to start on your own solution.

As you are now familiar with all the terms concerning this topic, now it is time to take a step further and explore what other extraordinary solution Ozeki VoIP SIP SDK can provide to you.

Related Pages

Copyright © 2000 - 2012 Ozeki Systems Ltd.
All rights reserved

    Contact details     |     Privacy policy     |     Terms of use
Please address your inquiries to info[at]voip-sip-sdk.com