VIVR 语音留言函数
//★★★★★★★★★★★★语音留言部分★★★★★★★★★★★★
FuncLeaveTone
{
#declare SR cmessage//给数据库网关发送的参数
#declare SR Tonghuabianma//通话编码,用来确定打长途还是市话
:stWait
[Assign cmessage,""]
[STRCAT cmessage,ServerID]
[STRCAT cmessage,"&9&"]
[STRCAT cmessage,Calltelephone1]
[STRCAT cmessage,"$"]
[STRCAT cmessage,quhao]
[STRCAT cmessage,"$"]
[STRCAT cmessage,CallerID]
[Assign Callerid,CallerID]
[STRCAT cmessage,"$"]
[STRCAT cmessage,VMCodify] //功能键编号,存放在全局变量VMCodify
[STRCAT cmessage,"$1"]
[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]
[StrStr SR10,"!"]
[Dec IR0]
[StrSub SR10,IR1,IR0]
[Assign SR21,SR0]
[Add IR0,2]
[Assign IR3,IR0]
[Strlen SR10]
[StrSub SR10,IR3,IR0]
[Assign SR22,SR0]
-> stBillBegin
:stBillBegin
[BillBegin 2,0,Tonghuabianma]
Verify(0) -> stmakecall
Verify(-1) -> stExit
:stmakecall
[Assign cmessage,""]
[Strcat cmessage,SR22]
[MakeCall200 SR21,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 -> stExit
Failed -> stExit
:stBaseError
[SetDTMF "?"]
[Assign SR1,SR29]
[StrCat SR1, "BaseError.vox"] //
[PlayFile SR1]
StopPlayBack -> stExit
DialTerminate -> stExit
Failed -> stExit
:stExit
[Return 0]
}
//★★★★★★★★★★★★语音留言部分结束★★★★★★★★★★★★