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. The identifier of the call status event. It may be the following values:Param1: The integer parameter used by The following events. CALLSTATUS_RINGING:Param2: A string parameter used by The following events. CALLSTATUS_CALLERID: |
|
|
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_OUTBOUNDEnd Select
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."
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