Track outgoing call status



VoiceAngel can "listens" to the line to assess what is happening. A number of factors can affect how it interprets what it "hears". CallStatus event is used to report the status of the line.

Typically, line quality, exchange technology, and type of voice modems or voice boards, are factors that software cannot do much about. But there are factors that CAN be adjusted.

If you find that your VoiceAngel application fails to recognize the line condition accurately, you should make some adjustment according to your hardware.

How many means does voiceangel offer to track call status.
A.Using voice modems
B.Using voice boards

Judging call status by analyzing waveform of ring back tones.
A.How does VoiceAngel analyze the ring back tone?
B.What cause problems?
C.Setting Parameters for Judgement
D.Ofen met problems



How many means does voiceangel offer to track call status


VoiceAngel offer two means to track call status. This is determined by one of the parameter of Dial method: bAnalyzeRingBackTone. There are several cases while using Dial method.
1. If you are using a voice modem:
    A. bAnalyzeRingBackTone=false
       CALLSTATUS_CONNECTED message will occur immediately in CallStatus event after dialing without the waveform analysis process.
    B. bAnalyzeRingBackTone=true
       A waveform analysis process will be begin after dialing until events CALLSTATUS_NO_SOUND_AFTER_DIALING CALLSTATUS_BUSY, CALLSTATUS_VOICE_PROMPT_DETECTED CALLSTATUS_FAX_TONE, CALLSTATUS_CALL_REJECTED, CALLSTATUS_CONNECTED,                         CALLSTATUS_WAIT_CONNECTION_TIMEOUT messages occurs.

2. If you are using an advanced TAPI device like a voice boards.
    A. bAnalyzeRingBackTone=false
       VoiceAngel will not make any wave form analysis, but directly get the call status events from TAPI. CALLSTATUS_CONNECTED, CALLSTATUS_BUSY, or CALLSTATUS_WAIT_CONNECTION_TIMEOUT messages may occurs after dialing.
       Note:In this case, the TSP parameters of the boards should be properly configured to get accurate status reports.
For dialgic boards, please reference to

Installing Dialogic Boards

Setting call parameters to judge status of outbound call.


    B. bAnalyzeRingBackTone=true
       Same as voice modems does. Only different is that if the telephone line is not plug in the board, CALLSTATUS_NO_SOUND_AFTER_DIALING will not occurs.
      
Note:In this case, you should configure the TSP to get a TAPI CONNECTED message immediately after dialing, just as what a modem does. If it has been peoperly configured, Dialing with bAnalyzeRingBackTone set ting false will get a CALLSTATUS_CONNECTED message immediately, and dialing with bAnalyzeRingBackTone setting false will get a CALL_STATUS_DIALWELLDONE message immediately.

 

Judging call status by analyzing waveform of ring back tones

 

How can VoiceAngel judge the call status with a voice modem

There are useful properties when judging the telephony line status.

They are SignalUpperFrequency ,SignalLowerFrequency, SilenceSwing .RingBackSignalUpperDuration
RingBackSignalLowerDuration, RingBackSilenceUpperDuration,RingBackSilenceLowerDuration
BusySignalUpperDuration,BusySignalLowerDuration,BusySilenceUpperDuration,BusySilenceLowerDuration 

VoiceAngel judges the line status by listening to the sounds on the line just as we do.

If VoiceAngel hears low noise on the line, it indicates that the quality of recording from the modem will be good.However, VoiceAngel does not have the discriminatory powers of a Human Being.

It distinguishes only 3 states:

1. Silence

2. Non-signal tone.

3. Signal tone

Signal tone is recognized by VoiceAngel as sound within the frequency bounds defined by SignalUpperFrequency and SignalLowerFrequency. The frequency of signal tone is usually around 450HZ in China. Any sound with frequency beyond the bounds, will be taken as non-signal tone. VoiceAngel detects the frequency by analyzing the incoming waveform.

With the ring back tone, signal tone lasts about 1 second, followed by about 4 seconds of silence. The cycle continues until the called person has picked up the phone.

With the busy tone ,a cycle consists of around 0.4 seconds of signal tone and around 0.4 seconds of silence.

VoiceAngel recognizes sound with swing lower than the SilenceSwing as silence. So, on a very noisy line, SilenceSwing should be set bigger than the actual swing of noise is likely to be. (You can measure the actual noise by using the WaveForm showing fuction provided in VoiceAngel (see below))

VoiceAngel will raise CallStatus event during the call progress. Possible messages in CallStatus event during an outgoing call progress might be:
CALLSTATUS_DIALWELLDONE=0
The number has been dialed.
CALLSTATUS_NO_SOUND_AFTER_DIALING=1
No sound like ring back, busy or voice prompt heard in some time after dialing."
The time is limited by NoResponseAfterDialingTimeout property.
CALLSTATUS_RINGBACK=2
A ring back occurs after dialing, the number the the ring back is Param1. If a singal sound has a duration between RingBackSignalLowerDuration and RingBackSignalUpperDuratioin is heard, this message will occur.
CALLSTATUS_BUSY=3
If the a period of silence between signal tones is shorter than BusySilenceUpperDuration and longer than BusySilenceLowerDuration, it is considered a busy signal cycle. If three busy signal cycles was detected, this message will occur. 
CALLSTATUS_VOICE_PROMPT_DETECTED=4
Sometimes non-signal sound is heard but the line does not get connected. For example, if you are calling a shut down mobile phone or a busy mobile phone, VoiceAngel will hear a  voice prompt directly, without any preceding signal tone. In this case, it gives this message.
The Integer parameter Param1 of the event indicates the identifier of the voice prompt. The string Param2 indicates the description of the voice prompt. It might be "CDMA Busy" or "GSM Poweroff". The default value for Param1 is 0, and Param2 is "". Which indicates unrecognized voice prompt. To make them have other values, you should train voiceangel to recognize different voice prompts. VoicePromptTrain method can be used to do this.

CALLSTATUS_FAX_TONE=5
A Fax tone has been detected after dialing. If a period of non-signal sound with the frequency between 1600-3000hz is heard. It will give this message.
CALLSTATUS_CALL_REJECTED=6
The call has been rejected by the person you dialed. If ring back tones are heard by voiceangel, but then some busy tones appears, it will give this message.
CALLSTATUS_CONNECTED=7
There are several case:
A. The number has an common ring back tone
If a non-signal tone is detected after a signal tone, VoiceAngel will think that someone has picked up the phone and has said something. So, a connected event will be raised. But this is not always accurate; if the called party drops his mobile telephone just after you dialed, a voice prompt will be heard, and VoiceAngel can not recognize whether the voice is from a human or from a machine, so it still gives a connected event.
B. The number has an CRBT(Color Ring Back Tone)
The message will be giving when the music is finished.
CALLSTATUS_WAIT_CONNECTION_TIMEOUT= 12
A special duration passed, but the call made by Dial or StartTransfer has not been answered yet. The timeout duration is specified in dial method. Default value is 30s.
CALLSTATUS_MONITOR_CALL_STATUS_TIMEOUT =13
A special duration passed after MonitorCallStatus method called, but no status event has not been detected.
CALLSTATUS_VOICE_PROMPT_TRAINED= 14
The Voice Prompt has been trained, and it can recognize the specified voice prompt later. This is caused by VoicePromptTrain method.

What cause problems

 

Default values of properties can usually make a good quality of judgment. But there are two cases where the judgment is not accurate.

The first case is that the swing of the actual noise is bigger than the SilenceSwing. This may be caused by a bad capability of the voice modem on recording, or by a noisy telephony line.

VoiceAngel will take the noise as non-signal tone, so the VoicePromptDetected or Connected events will occur by mistake.

The second case is that the frequency of the actual signal tone is beyond the default bounds defined by SignalUpperFrequency and SignalLowerFrequency. Frequency of signal tone varies according to the telephone office where the called party is domiciled. VoiceAngel will take the signal tone as non-signal tone so VoicePromptDetected or Connected will also occur by mistake.

The three case is that the actual duration of silence or signal is beyond the bounds defined by RingBackSignalUpperDuration,RingBackSignalLowerDuration, RingBackSilenceUpperDuration, RingBackSilenceLowerDuration,BusySignalUpperDuration, BusySignalLowerDuration, BusySilenceUpperDuration, BusySilenceLowerDuration 

 

Setting Parameters for Judgement

The parameters can be observed from the wave shape shown on the ocx control. When dialing, if ShowWaveForm is set true, and lineForShowWave is set to the current line, wave shapes of the signal tones will be shown on the ocx control. But once the CALLSTATUS_NO_SOUND_AFTER_DIALING, CALLSTATUS_BUSY, CALLSTATUS_VOICE_PROMPT_DETECTED, CALLSTATUS_CONNECTED, CALLSTATUS_REJECTED or CALLSTATUS_WAIT_CONNECTION_TIMEOUT messages occurs, the recording process will stop. To continue showing the wave, please set the last parameter of Dial method to an name of a wave file. A wave file will be created to record the ring back tone and the recording process will not stop when any call status messages appears.

The wave shapes shown on the control, update approximately 8 times per second. The average frequency of the period is shown on the control as Frequency:xxx, and the max swing of the samples during the period is shown as Max Swing:xxx .They are both shown at the top left corner of the control. You can observe the max swing during the silence time so as to determine the value of SilenceSwing.You can also observe the actual frequency change during the signal tone period so as to determine the boundaries of the frequency for signal tone.

 

Often met problems

If you can not get messages except CALLSTATUS_NO_SOUND_AFTER_DIALING, CALLSTATUS_WAIT_CONNECTION_TIMEOUT in CallStatus event. Please follow these step to check out the reason for the problem.

1.Set ShowWaveForm true to enable the wave curve showing fuction, and set the LineForShowWave to the index of the line you are using. For instance, if you use the first line, you should set LineForShowWave 0. LineForShowWave can be set at design time or run time.
2.Run your application and dial a number, please watch the surface of the control duration the dialing session.

a.I see nothing on the control.
This mean that your modem are not capable of recording. Possible reason are

.Driver are not installed properly.

Please reinstall the driver shipped by modem manufacturer. If you can not found the original driver CD, you can also find the driver for the type of your modem from Internet. If you still can not find the driver, please find driver for the chip of your modem.

If you are using Windows XP, it will often immediately install the driver for you after the modem is plugged into your PC. But the driver is common for data communication, but not for voice funtion. To reinstall the driver, do as following.

Right click on My computer,click Property in the popup menu. System Property dialog appears. In the Hardware tab, click Device Manager. Click the modem driver with right button, an click Update Driver in the popup menu. The Update Device Wizard appears. In the first step, it offer two options:
    1. Intall Automaticly
    2. Install from a specified location or from the list.
Select the second option, click Next Step.
In this step, it offer two options:
    1.Search optimal driver from the following loaction.
    2.Do not search, I will select the driver myself.
Select the second option, click Next Step.
In this step, click Install from disk.

.Your modem does not support record.
Note data modem do not support voice features. Voice modems are usually claimed supporting voice feature in the wrapper. But some voice modems do not action as what they are claimed. To select a modem with capability of voice feature, please refer to Recommand Modems.

b.You can see waving shapes like regular sine curves on the control for about 1 second, then a horizontal line , sometime with very slight wave.
It indicates that you are using a voice modem with capability of recording. VoiceAngel are listening through the line and analyzing the characteristic of the sound on the line. The regular waving curves are made up by samples of ringback sound lasting for , the horizontal line indicate a 4 seconds silence.

Waveing curves are made up by a lot of samples of the sound on the line. The horizontal orientation indicates time. And the vertical orientation indicates value of samples. The time between two neighboring samples is determined by the wave format, voice modems use wave format 8000Samples/Second, 16bit/Sample, 1Channel. It means that it offer a sample every 1/8000 second. VoiceAngel use 3 buffers to receive the samples. It draw the wave curves each time a buffer is filled. The buffer with default size contain 1024 samples, hence every 1024/8000 second, waving curves with be drawn. Two parameter, Freq and Swing are also displayed on the control. They are average frequency of the waving shapes and the max value of the samples during the 1024/8000 second.

What's the your problem?

1. I get CALLSTATUS_CONNECTED message, but the the called party has not picked up the phone yet.

Please RingBackSilenceUpperDuration, which has the default value 5200ms. If the silence duration last longer than RingBackSilenceUpperDuration, it will raise a connected event. Variant PBXs may have different silence duration for ring back. In this case, you can set RingBackSilenceUpperDuration bigger.

2. The called party has picked up the phone, but CALLSTATUS_CONNECTED message was not raised.

After picking up the phone, please say "Hello", as most people does. This can help VoiceAngel to judge the connection quickly. Otherwise, voiceangel will raise the Connected event after a period of silence time lasting for RingBackSilenceUpperDuration(ms) has been monitored.

3. CALLSTATUS_VOICE_PROMPT_DETECTED message was raised immediately after dialing.

If voiceangel hears a voice prompt before any ringback sound, it will give the event. Please set the Awake property false, this make the country not raise any event and not stop showing waving shapes on the control. Thus, you can observe the characteristic, frequency and swing of the waving curves. If the there is any noise on the line, it will cause inaccuracy on frequency computing. Hence, ringback sound may be considered as a voice prompt. In this case, you can set SilenceSwing bigger to filter the noise samples.

4.CALLSTATUS_BUSY message was raised while dialing, but the called party has not picked up the phone.

If the silence time of ringback are between BusySilenceLowerDuration and BusySilenceUpperDuration, this will occur. Please adjust the BusySilenceLowerDuration and BusySilenceUpperDuration smaller.

5.CALLSTATUS_RINGBACK message was raised while the called party are actually busy.

This occured if the RingBackSignalLowerDuration was set smaller than the actual signal time duration of the busy sound. It consider busy as a ringback.

5.Can not get the CALLSTATUS_RINGBACK message.

If a ringback last a time longer than RingBackSignalLowerDuration, it will give the event. If RingBackSignalLowerDuration are larger than the actual value, this case will occur.