VIVR 转人工函数
//★★★★★★★★★★★★转人工部分★★★★★★★★★★★★
FuncZhrg
{
#declare SR cmessage//给数据库网关发送的参数
#declare SR Tonghuabianma//通话编码,用来确定打长途还是市话
:stWait
[Assign cmessage,""]
[STRCAT cmessage,ServerID]
[STRCAT cmessage,"&2&"]
[STRCAT cmessage,Calltelephone1]
[STRCAT cmessage,"$"]
[STRCAT cmessage,quhao]
[STRCAT cmessage,"$"]
[STRCAT cmessage,CallerID]
[Assign Callerid,CallerID]
[STRCAT cmessage,"$"]
[STRCAT cmessage,zhrgnum]
[STRCAT cmessage,"$"]
[STRCAT cmessage,zhrgbignum]
[STRCAT cmessage,"$"]
[STRCAT cmessage,T_AreaCode]
[ASSIGN SR1,cmessage]
[directrequestdata NETW,1020,SR1]
DataReceived -> stRecievedData
TimeOut -> stBaseError
GatewayNotExist->stBaseError//注意别丢了这一行
Failed->stBaseError//注意别丢了这一行
:stRecievedData
[Assign SR10,FD0]
[StrLen SR10]
[Great IR0,3]
Passed -> stJudgeMessage
Failed -> stJudgereason_1
:stJudgereason_1
[StrSub SR10,1,2]
[Assign SR10,SR0]
[Equal SR10,"-1"]
Passed -> stBaseerror //数据库错误,谢谢使用,再见
Failed -> stJudgereason0
:stBaseerror
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"Baseerror.vox"]
[PlayFile SR1] //数据库错误,谢谢使用,再见
StopPlayBack->stExit
DialTerminate-> stBaseerror
Failed->stExit
:stJudgereason0
[StrSub SR10,1,1]
[Assign SR10,SR0]
[Equal SR10,"0"]
Passed -> stRemainMoney //余额不足,谢谢使用
Failed ->stJudgereason1
:stRemainMoney
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"RemainMoney.vox"]
[PlayFile SR1] //余额不足,谢谢使用,再见
StopPlayBack->stExit
DialTerminate-> stBaseerror
Failed->stExit
:stJudgereason1
[Equal SR10,"1"]
Passed -> stNoAccess
Failed -> stJudgeMessage
:stNoAccess
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"NoAccess.vox"]
[PlayFile SR1] //没有空闲通道,谢谢使用,再见
StopPlayBack->stWait
DialTerminate-> stWait
Failed->stExit
:stJudgeMessage
[STRSTR SR10,";"]
[Dec IR0]
[StrSub SR10,1,IR0]
[Assign Seatdataid,SR0]
[Add IR0,2]
[Add IR2,IR0]
[Add IR2,9]
[StrSub SR10,IR0,IR2]
[Assign Tonghuabianma,SR0]
[STRSTR SR10,"*"]
[Inc IR0]
[Assign IR1,IR0]
[StrLen SR10]
[StrSub SR10,IR1,IR0]
[Assign SR10,SR0]
-> stBillBegin
:stBillBegin
[BillBegin 2,0,Tonghuabianma]
Verify(0) -> stmakecall
Verify(-1) -> stExit
:stmakecall
[Assign cmessage,""]
[Strcat cmessage,quhao]
[Strcat cmessage,CallerID]
[MakeCall200 SR10,cmessage,""]
callterm(1)->stNoPerson
callterm(2)->stBusyPhone
callterm(3)->stBusyPhone
callterm(5)->stNoNum
callterm(0)->stDirect1
:stDirect1
[Assign cmessage,""]
[STRCAT cmessage,ServerID]
[STRCAT cmessage,"&3&"]
[STRCAT cmessage,Calltelephone1]
[STRCAT cmessage,"$"]
[STRCAT cmessage,quhao]
[STRCAT cmessage,"$"]
[STRCAT cmessage,Callerid]
[STRCAT cmessage,"$"]
[STRCAT cmessage,Seatdataid]
[ASSIGN SR1,cmessage]
[directrequestdata NETW,1020,SR1]
DataReceived -> sttimer
TimeOut -> stBaseError
GatewayNotExist->stBaseError//注意别丢了这一行
Failed->stBaseError//注意别丢了这一行
:stNoPerson
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"NoPerson.vox"]
[PlayFile SR1] //无人接听,请您稍候,结束请挂机,按任意键继续拨打
StopPlayBack->stmakecall
DialTerminate-> stmakecall
Failed->stExit
:stBusyPhone
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"BusyPhone.vox"]
[PlayFile SR1] //用户繁忙,继续等待请您稍候,结束请挂机
StopPlayBack->stmakecall
DialTerminate-> stBusyPhone
Failed->stExit
:stNoNum
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1,"NoNum.vox"]
[PlayFile SR1] //客户号码为空,请查证再拨
StopPlayBack->stExit
DialTerminate->stExit
Failed->stExit
:sttimer
[TIMER 999]
timeout -> stBillEnd
:stBillEnd
[BillEnd]
Verify(0)->stExit
Verify(-1)->stExit
:stBaseError
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1, "BaseError.vox"] //
[PlayFile SR1]
StopPlayBack -> stExit
DialTerminate -> stExit
Failed -> stExit
:stExit
[Return 0]
}
AlarmTimeOff0
{
:stWait
[Callfunc &AlarmTimeOff1]
returned->stExit
// OppositeDisconnect->stExit
:stExit
[return 0]
}
AlarmTimeOff1
{
:stWait
[ReconnectCall]
passed->stdelay
failed ->stExit
:stdelay
[timer 10]
timeout->stplay5
:stplay5
[SETDTMF ""]
[PROMPT 1019]
StopPlayBack -> stExit
DialTerminate ->stExit
Failed -> stExit
:stExit
[ Return 0 ]
}
AlarmTimeOff2
{
#declare SR cmessage
:stWait
Connect->stEndBill
:stEndBill
[BillEnd]
Verify(0)->stDirect4
Verify(-1)->stDirect4
:stDirect4
[Assign cmessage,""]
[STRCAT cmessage,ServerID]
[STRCAT cmessage,"&4&"]
[STRCAT cmessage,Calltelephone1]
[STRCAT cmessage,"$"]
[STRCAT cmessage,quhao]
[STRCAT cmessage,"$"]
[STRCAT cmessage,CallerID]
[STRCAT cmessage,"$"]
[STRCAT cmessage,Seatdataid]
[ASSIGN SR1,cmessage]
[directrequestdata NETW,1020,SR1]
DataReceived -> stExit
TimeOut -> stExit
GatewayNotExist->stExit//注意别丢了这一行
Failed->stExit//注意别丢了这一行
:stExit
[RETURN 0]
}
//★★★★★★★★★★★★转人工结束★★★★★★★★★★★★