您的位置:首页 > 运维架构

翻译语音天使 voiceangel 控件 关于判断呼叫状态部分的说明

2008-08-04 11:41 996 查看
大致翻译了一下,如有不对的地方请指教
原文如下:
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.

 

Track outgoing call status  跟踪呼叫状态
voiceangel通过监听线路来判断呼叫状态,callstatus 事件报道线路状态。
通常,线路质量,不同语音modem,语音卡对软件的判断有影响,但可以调整。
如果voiceangel不能准确判断线路状态,你必须根据你的硬件做出相应的调整。
voiceangel通过dial方法的bAnalyzeRingBackTone参数用不同的方式来判断线路状态
1,如果使用语音modem,
  a,bAnalyzeRingBackTone = false
   拨号出去即认为接通线路,产生 CALLSTATUS_CONNECTED 事件
  b,bAnalyzeRingBackTone = true
   波形分析将分析回铃音,直到产生以下事件:
   CALLSTATUS_NO_SOUND_AFTER_DIALING(拨号后没有音频)
   CALLSTATUS_BUSY(忙音),
   CALLSTATUS_VOICE_PROMPT_DETECTED  (根据语音参数,如彩铃音,语音提示)
   CALLSTATUS_FAX_TONE,(得到传真信号)  
   CALLSTATUS_CALL_REJECTED,(客户拒接)
   CALLSTATUS_CONNECTED,  (摘机接通电话)                            
CALLSTATUS_WAIT_CONNECTION_TIMEOUT(超时)
语音卡(省略)
     voiceangel 怎么通过回铃音判断通话状态
判断线路状态的几个重要属性
   SignalUpperFrequency
   SignalLowerFrequency,
   SilenceSwing
   RingBackSignalUpperDuration
   RingBackSignalLowerDuration
   RingBackSilenceUpperDuration
   RingBackSilenceLowerDuration
   BusySignalUpperDuration
   BusySignalLowerDuration
   BusySilenceUpperDuration
   BusySilenceLowerDuration
voiceangel 通过监听线路声音来判断线路状态,他依靠以下三种声音状态来判断
 1,silence  静音
 2,Non_signal tone  非信号音
 3, signal tone  信号音
 voiceangel 通过设置SignalUpperFrequency and SignalLowerFrequency两个参数来判断信号音,
中国的信号音一般为 450hz,通过音频分析,超过这个频率的声音即认为非信号音。
  国内回铃音一般为1秒振铃音,4秒静音循环,直到被摘机。
  忙音为0.4秒振铃音,0.4静音循环
  voiceangel 认为低于SilenceSwing 设置的音为静音,当线路噪音比较大时,SilenceSwing 设置要大一点,可以通过显示WaveForm音频曲线来得到参数
  VoiceAngel 增加了几个呼叫事件
  CALLSTATUS_DIALWELLDONE=0
     号码拨号完毕
  CALLSTATUS_NO_SOUND_AFTER_DIALING=1
    拨号后没有声音,时间参数为NoResponseAfterDialingTimeout
  CALLSTATUS_RINGBACK=2
    振铃音  Param1为振铃次数.
   CALLSTATUS_BUSY=3
   忙音:
  当两个信号音之间的静音短于BusySilenceUpperDuration及长于BusySilenceLowerDuration,认为是
  一个忙音循环,当检测到三个忙音信号,产生本事件。
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
传真信号. 如果接听的声音频率为1600-3000hz,则认为是传真信号。
CALLSTATUS_CALL_REJECTED=6
被叫用户拒接电话,先听到回铃音,然后听到忙音,则产生本事件
CALLSTATUS_CONNECTED=7
电话接通,有以下几个情况
 a,先听到回铃音,然后没有回铃音,则认为接通电话,这种情况不是很准确,比如手机挂机,会有语音提示,但voiceangel无法判断是提示音还是人声。一样会产生联通事件
 b,彩铃音,
 当音乐播放完成,则产生接通事件。
CALLSTATUS_WAIT_CONNECTION_TIMEOUT= 12
当设定的时间没人接听,则产生本事件,默认是30秒
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

9296
The Voice Prompt has been trained, and it can recognize the specified voice prompt later. This is caused by VoicePromptTrain method.
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息