Event: CallStatus


Function:

 

When the call status changes, this event occurs.

Form:
  With VB Codes:
Private Sub VoiceAngel1_CallStatus(ByVal LineIndex As Long, ByVal EventID As Long, ByVal Param1 As Long, ByVal Param2 As String)
With C++ Codes:
void OnCallStatus(long LineIndex, long EventID, long Param1, LPCTSTR Param2)

Parameters:

 

LineIndex(Long)

The index of the line where the event is raised.
EventID(Long)

The identifier of the call status event. It may be the following values:
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
CALLSTATUS_BUSY=3
A busy signal detected after dialing.
cmdDrop.Enabled = True
CALLSTATUS_VOICE_PROMPT_DETECTED=4
A voice prompt like "The subscriber you dialed is busy now,..." is heard after dialing.
The Integer Param1 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.
CALLSTATUS_CALL_REJECTED=6
The call has been rejected by the person you dialed.
CALLSTATUS_CONNECTED=7

The call is connected after dialing, answer or transfer. The Param1 indicates different style of Connected event:
CONNECT_STYLE_OUTBOUND=0
    Line connected after dialing. Now CurrentCall will return                  CURRENT_CALL_ORIGINAL(0)
CONNECT_STYLE_INBOUND=1
     line connected after answering an incoming call. Now CurrentCall will       return  CURRENT_CALL_ORIGINAL(0)
CONNECT_STYLE_CONSULT=2
     Line connected after a consultation transfer made by StartTransfer has       been answered. Now CurrentCall will return      CURRENT_CALL_CONSULT(1).
 CONNECT_STYLE_CONFERENCE=3
      CompleteTransfer has been called to make a conference call, and the conference call is connected. Now CurrentCall will return CURRENT_CALL_CONFERENCE(2).
 CONNECT_STYLE_CONSULT_CANCELED=4
     CancelTransfer has been called and the original call is connected. Now GetCurrentCall        will return CURRENT_CALL_ORIGINAL(0).


CALLSTATUS_COLOR_RING_BACK_TONE_DETECTED=8
CRBT(Color Ring Back Tone) has been detected while dialing.
CALLSTATUS_DIAL_FAILED=9
The call has not been dialed, but it failed.
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.
CALLSTATUS_RINGING= 15
A ring detected. The integer Param1 indicates the number of the rings. Answer method can now be called.
CALLSTATUS_CALLERID =16
CallerID detected in an incoming call. Param1 indicates the telephone number captured.
CALLSTATUS_CALLINFO= 17
Callinfo collected in an incoming call. This is usual used for PBX. Param1 indicates an address of the TAPI structure LINECALLINFO containing call info.
CALLSTATUS_DISCONNECTED= 18
The call is disconnected because the other side has dropped the call.
CALLSTATUS_BLINDTRANSFER_DONE =19
A blind transfer has been completed.
Param1: The integer parameter used by The following events.
CALLSTATUS_RINGING:
Indicates the number of the ring.
CALLSTATUS_RINGBACK:
Indicates the number of the ring back.
CALLSTATUS_CONNECTED:
Indicates the style of the connection.
CALLSTATUS_CALLINFO:
Indicates a pointer to a TAPI structure LINECALLINFO.
CALLSTATUS_VOICE_PROMPT_DETECTED
Indicates the identifier of the voice prompt.
Param2: A string parameter used by The following events.
CALLSTATUS_CALLERID:
Indicates the caller id.
CALLSTATUS_VOICE_PROMPT_DETECTED
Indicates the description of the voice prompt.


     

Description:

 

To know how VoiceAngel judge the status of the outbound call. Please refer to Judging the Telephony Line Status.

     

Raised By:

 

See above.

     

See Also:

 

Judging the Telephony Line Status. Dial ,Answer VoicePromptTrain StartPlaying MonitorCallStatus StartTransfer CancelTransfer CompleteTransfer BlindTransfer

     

Sample Code In Visual Basic:

'The following code plays a wave file after getting a connected event.

Private Sub VoiceAngel1_CallStatus(ByVal LineIndex As Long, ByVal EventID As Long, ByVal Param1 As Long, ByVal Param2 As String)
Dim strCurCall As String

Select Case VoiceAngel1.CurrentCall
Case CURRENT_CALL_ORIGINAL
strCurCall = "Call "
Case CURRENT_CALL_CONSULT
strCurCall = "Consultation call "
End Select

Dim enumEventID As CALLSTATUS_EVENT
enumEventID = EventID

Select Case enumEventID
Case CALLSTATUS_DIALWELLDONE
showMsg "Dial well done"
Case CALLSTATUS_NO_SOUND_AFTER_DIALING
showMsg "No response after dialing."
Case CALLSTATUS_RINGBACK
showMsg "Ring Back " + CStr(Param1)
Case CALLSTATUS_BUSY
showMsg strCurCall + CStr(LineIndex) + "Busy"
cmdDrop.Enabled = True
Case CALLSTATUS_VOICE_PROMPT_DETECTED
showMsg strCurCall + CStr(LineIndex) + "VoicePromptDetected,ID=" + CStr(Param1) + ",Description=" + Param2
ckUseSpeakerphone.Enabled = True
Case CALLSTATUS_FAX_TONE
showMsg "Fax tone detected!"
Case CALLSTATUS_CALL_REJECTED
showMsg "Call rejected"
Case CALLSTATUS_CONNECTED

Select Case Param1

Case CONNECT_STYLE_OUTBOUND
showMsg CStr(LineIndex) + "Line connected after dialing"
Case CONNECT_STYLE_INBOUND
showMsg CStr(LineIndex) + "line connected after answering."
Case CONNECT_STYLE_CONSULT
'This is caused by StartTransfer
showMsg CStr(LineIndex) + "line:Consultation Call connected duration transfering."
cmdCompleteTransfer.Enabled = True
cmdSwapHold.Enabled = True
Case CONNECT_STYLE_CONFERENCE
'This is caused by calling CompleteTransfer method.
showMsg CStr(LineIndex) + "line:Conference Call connected after completing transfering."
Case CONNECT_STYLE_CONSULT_CANCELED
'This is caused by calling CanceTransfer method.
showMsg CStr(LineIndex) + "line:Original Call connected after canceling transfering."
End Select

Case CALLSTATUS_WAIT_CONNECTION_TIMEOUT

showMsg CStr(LineIndex) + "Timout while waiting connection of " + strCurCall
Case CALLSTATUS_MONITOR_CALL_STATUS_TIMEOUT
Case CALLSTATUS_VOICE_PROMPT_TRAINED
showMsg "VoicePrompt Trained"
cmdDrop_Click
Case CALLSTATUS_RINGING
cmdAnswer.Enabled = True
showMsg CStr(Param1) + " Ring"
Case CALLSTATUS_CALLERID
showMsg "CallerID£º" & Param1
Case CALLSTATUS_CALLINFO
showMsg "CallInfo detected, the pointer to the TAPI LINECALLINFO structure is£º" & Param1
Case CALLSTATUS_DISCONNECTED
showMsg "Call Disconnected."
Case CALLSTATUS_BLINDTRANSFER_DONE
showMsg "Blind Transfer completed"
End Select
End Sub