⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 外呼.sc

📁 用于收费语音服务的电话充值业务
💻 SC
📖 第 1 页 / 共 2 页
字号:
//IR30 做为子函数返回值变量专用寄存器
//SR30 做一层按键记录专用寄存器
//SR29 做二层按键记录专用寄存器
//SR28 做为接收用户输入字符串的专用寄存器
//SR27 做为专有函数入口参数寄存器
//SR9  做为播报语音专用寄存器,保存语音路径及文件名


#declare IR IfCardUser
#declare SR LocalAreaCode
#declare SR MobileAreaCode
#declare SR SR_ORDERCONTENT       //真实歌曲文件名称
#declare IR IR_TotalTimeBegin
#declare IR IR_BranchTimeBegin
#declare SR SR_SongContent        //央视话单文件里的歌曲编号
#declare SR ANI
#declare SR wsRecord
#declare SR wsSong
#declare SR wsCaller
#declare SR wsSERVICENUM
#declare SR wsFunctionCode
#declare SR wsCreateTime
#declare IR FeeLimited
#iniparam string @VoxPath
#iniparam string @ORDER_PATH
#iniparam string @RecordHost_Path
#iniparam string @RECORD_PATH
#iniparam string @PlayCaller
#iniparam string @SDRPath
#iniparam string @DEFAULTINTERVAL
#iniparam string @REDIALCOUNT



#iniparam int @PWDCount //卡认证的输入次数
#iniparam int @CardLen //卡认证的卡号长度
#iniparam int @PWDLen //卡认证的密码长度
#iniparam string @FeeFile //付费判断文件和路径
#iniparam int @ywdb	//业务数据库站点号

#function Func_PresideBless	//主持人大拜年请按2函数
#function FN_MINGXINGDABAINIAN	//明星大拜年请按3函数
#function FN_Song	//春节祝福歌曲大放送请按4函数
#function FN_PastParty	//历年春节晚会精品节目欣赏请按5函数
#function FN_Zhongjiangchaxun	//中奖信息查询请按6函数
#function FN_funOnStopFlow	//挂机处理函数
#function FuncVerifyUser	//用户认证函数
#function FN_WriteBranchSDR	//写一级菜单话单文件函数
#function FN_WriteTotalSDR	//写总话单文件函数
#function FN_WriteSendSDR	//写点播记录文件函数
#function FN_WRITEPREDIALTASK	//录入预拨号表函数
#function FN_RECORDMESSAGE	//录音函数
#function FN_SendSong		//发送歌曲函数
#function funERASEFILE
#function main

main
{
:stWait
     	Connect(0)->stAllocResource
	Connect ->stAllocResource1
:stAllocResource
	[NowTime]
	[Assign IR_TotalTimeBegin,IR0]
	[OnCallCleared &FN_funOnStopFlow]
	[OnStopFlow &FN_funOnStopFlow]
	[AllocMediaDevice 1]
	AllocResourceOK ->stQueryAreaCode
	AllocResourceFail -> stExit
	[Assign SR29,".\vox\"]
//以下是送歌分支
:stAllocResource1
	[Assign SR29,@VoxPath]
	[AllocMediaDevice 1]
	AllocResourceOK ->stSwitchDBA
	AllocResourceFail->stExit
	TimeOut->stExit
:stSwitchDBA
	[SwitchDBA @ywdb]
	Passed->stAnalyseInput
	Failed->stAnalyseInput
:stAnalyseInput 
	[ParseParam $InputParam,1,"^"]
	[Assign wsRecord,SR0 ]		//录音文件
	[ParseParam $InputParam,2,"^"]
	[Assign wsSong,SR0 ]		//歌曲文件
	[ParseParam $InputParam,3,"^"]
	[Assign wsCaller,SR0 ]		//送歌业务编码
	[ParseParam $InputParam,4,"^"]
	[Assign SR11,SR0]
	[Assign $BillExData,"1&"]
	[StrCat $BillExData,SR11]
	[StrCat $BillExData,"&"]       //歌曲子业务编码
	[ParseParam $InputParam,5,"^"]
	[Assign $AccountTelephone,SR0]   //计费编码(原主叫)
	[ParseParam $InputParam,6,"^"]
	[Assign wsCreateTime,SR0]        //产生时间
	[ParseParam $InputParam,7,"^"]
	[Assign wsFunctionCode,SR0]        //功能码
	[ParseParam $InputParam,8,"^"]
	[Assign wsSERVICENUM,SR0]        //点播节目号码
	[ParseParam $InputParam,9,"^"]   //正规格式的主叫号码
	[Assign ANI,SR0]
	[ParseParam $InputParam,10,"^"]
	[Equal SR0,"1"]                 //是否卡用户点拨
	Passed ->stAssignAccount
	Failed ->stBillBegin
:stAssignAccount
	[ParseParam $InputParam,11,"^"]
	[Assign $AccountID,SR0 ]		//卡用户账号
	[ParseParam $InputParam,12,"^"]
	[Assign $Password,SR0 ]	      //卡用户密码
	[ParseParam $InputParam,13,"^"]
	[SToI SR0]
	[Assign $AccountKind,IR0 ]	      //卡类型
	[Assign $CallerID,$AccountTelephone]	//2004-01-25 16:26
	[VerifyUser $AccountID,-1]
	Verify(0)->stBillBegin
	Verify ->stDelFile
:stBillBegin
	[Assign $ServiceItemNo,"*********"]
	[BillBegin 5,0,$ServiceItemNo]      //原主叫计费
	Verify(0) ->stWelcome
	Verify ->stExit
:stWelcome
	[OnCallCleared &funERASEFILE]
	[OnStopFlow &funERASEFILE]
	[ClearDTMF ]
	[ SetDTMF "?" ]
	[Assign SR1,SR29]
	[StrCat SR1,"D_01.vox"]
	[PlayFile  SR1]		//你好,这里是央视春节晚会热线,您的朋友
	StopPlayBack -> stPlayCaller
	DialTerminate -> stPlayCaller
	Failed -> stPlayCaller
:stPlayCaller
	[ClearDTMF ]
	[SetDTMF "?" ]
	[MixPlay 3,ANI]		//主叫号码
	StopPlayBack -> stPlayThank
	DialTerminate -> stPlayThank
	Failed -> stPlayThank
:stPlayThank
	[ClearDTMF ]
	[SetDTMF "?" ]
	[Assign SR1,SR29]
	[StrCat SR1,"D_02.vox"]
	[PlayFile  SR1]		//为您送上一份新春的祝福,请收听
	StopPlayBack -> stPlayRecord
	DialTerminate -> stPlayRecord
	Failed -> stBillEnd
:stPlayRecord
	[Equal wsRecord,""]
	Passed ->stPlaySong
	Failed ->stPlayWord
:stPlayWord
	[ClearDTMF]
	[SetDTMF "?"]
	[PlayFile  wsRecord]		//留言
	StopPlayBack -> stPlaySong
	DialTerminate -> stPlaySong
	Failed -> stPlaySong
:stPlaySong
	[ClearDTMF]
	[SetDTMF "?"]
	[PlayFile  wsSong]		//歌曲
	StopPlayBack -> stBillEnd
	DialTerminate -> stBillEnd
	Failed -> stBillEnd
:stBillEnd
	[BillEnd]
	Verify(0) ->stCallFunc
	Verify ->stCallFunc
:stCallFunc
	[CallFunc &FN_WRITE_SENTSUCCESS]
	Returned ->stDelFile
:stDelFile
	[EraseFile wsRecord] //删除留言
	->stExit
//----------------------------------------------------------------------
:stQueryAreaCode
	[Mkdir @SDRPath]
	[Assign SR10,"select areacode from tbl_areacode"]
	[ExecSQL SR10]
	Passed->stVerifyUser
	Failed->stExit
//★★用户认证begin
:stVerifyUser
	[Assign LocalAreaCode,FD0]
	[CallFunc &FuncVerifyUser]
	Returned(0)->stSaveItem	//用户认证成功
	Returned(1) -> stExit	//用户认证失败
//★★用户认证end

:stSaveItem
	[NowTime]
	[Assign IR_TotalTimeBegin,IR0]
	[BillBegin 1,0,$ServiceItemNo]
	Verify(0)->stStartFlow
	Verify(108) -> stNotEnoughMoney	//余额不足
	Verify(118) -> stExit	//消息包异常
	Verify(145) -> stNotEnoughMoney	//余额达到限额
	Verify(147) -> stExit	//系统故障
	Verify(148) -> stExit	//此业务不存在
	Verify -> stExit
	Failed -> stExit
:stNotEnoughMoney
	[SetDTMF "?"]
	[Assign SR1,SR29]
	[StrCat SR1, "v022.vox"]
	[PlayFile SR1]	//卡号余额不足,谢谢使用,再见。
	StopPlayBack  -> stExit
	DialTerminate -> stExit
	Failed        -> stExit
:stStartFlow
	[ClearDTMF ]
	[ SetDTMF "?" ]
	[Assign SR9,@VoxPath ]
	[StrCat SR9, "C_Welcome.vox"]
	[PlayFile  SR9]		//(背景音乐、主持人语音录制)欢迎您进入中央电视台春节联欢晚会互动祝福热线!本热线信息费每分钟0.9元。祝您春节愉快、猴年大吉、万事如意!(C_WELCOME.VOX)
	StopPlayBack -> stRandPlay
	DialTerminate -> stRandPlay
	Failed -> stExit
:stRandPlay
	[IntRand 49]
	[Add IR0,10]
	[IToS IR0]
	[ClearDTMF ]
	[SetDTMF "?" ]
	[Assign SR9,@ORDER_PATH ]
	[StrCat SR9, "C_S"]
	[StrCat SR9,SR0]
	[StrCat SR9,".vox"]
	[PlayFile  SR9]		//随机播放主持人拜年内容
	StopPlayBack -> stService
	DialTerminate -> stService
	Failed -> stExit
:stService
	[ClearDTMF]
	[SetDTMF "?" ]
	[Assign SR9,@VoxPath ]
	[StrCat SR9, "C_Service.vox"]
	[PlayFile  SR9]		//给您喜爱的春节晚会节目和演员投票请按1,明星大拜年请按2,春节祝福歌曲大放送请按3,历年春节晚会精品节目欣赏请按4,中奖信息查询请按5,返回请按星号键(C_SERVICE.VOX)
	StopPlayBack -> stGetMyChoice
	DialTerminate -> stGetMyChoice
	Failed -> stExit

:stGetMyChoice
	[Digit 5]
	StopDigits('1')->stVote	//给您喜爱的春节晚会节目和演员投票请按1,
	StopDigits('2')->stPresideBless	//主持人大拜年请按2,
	StopDigits('3')->stMingXing	//明星大拜年请按3,
	StopDigits('4')->stListenMusic	//春节祝福歌曲大放送请按4,
	StopDigits('5')->stPastParty	//历年春节晚会精品节目欣赏请按5,
	StopDigits('6')->stQuery	//中奖信息查询请按6,
	StopDigits('*')->stService	//返回请按星号键
	StopDigits -> stService
	TimeOut -> stService

  //Add user's code
//★★给您喜爱的春节晚会节目和演员投票请按1函数begin
:stVote
	[Assign SR30 , SR0]
	[CallFunc &FN_GUANZHONGTOUPIAO]
	Returned(0)->stService
	Returned ->stExit
//★★给您喜爱的春节晚会节目和演员投票请按1函数end
//★★主持人大拜年请按2函数begin
:stPresideBless
	[Assign SR30 , SR0]
	[CallFunc &Func_PresideBless]
	Returned(0)->stService
	Returned ->stExit
//★★主持人大拜年请按2函数end
//★★明星大拜年请按3函数begin
:stMingXing
	[Assign SR30 , SR0]
	[CallFunc &FN_MINGXINGDABAINIAN]
	Returned(0)->stService
	Returned ->stExit
//★★明星大拜年请按3函数end
//★★春节祝福歌曲大放送请按4函数begin
:stListenMusic
	[Assign SR30 , SR0]
	[CallFunc &FN_Song]
	Returned(0) -> stService
	Returned -> stExit
//★★春节祝福歌曲大放送请按4函数end
//★★历年春节晚会精品节目欣赏请按5函数begin
:stPastParty
        [Assign SR30 , SR0]
	[CallFunc &FN_PastParty]
	Returned(0)->stService
	Returned ->stExit
//★★历年春节晚会精品节目欣赏请按5函数end
//★★中奖信息查询请按6函数begin
:stQuery
	[Assign SR30 , SR0]
	[CallFunc &FN_Zhongjiangchaxun]
	Returned(0)->stService
	Returned ->stExit
//★★中奖信息查询请按6函数end
:stExit
	[Return 0]
}

//挂机删除留言
funERASEFILE
{
:stWait
   connect -> stfEnd
:stfEnd
	[EraseFile wsRecord ]
        [CallFunc &FN_WRITE_SENTSUCCESS]
	Returned(0)->stExit
	Returned->stExit
:stExit
   	[Return 0]
}


//★★央视主持人拜年请按2函数begin
//=======================//
//    2 央视主持人拜年分支  //
//=======================//
Func_PresideBless
{
:stWait
	[NowTime]
	[Assign IR_BranchTimeBegin ,IR0]
        [ClearDTMF]
        [SetDTMF "?"]
        [Assign SR9,@VoxPath]
        [StrCat SR9,"c_2_02.vox"]
	[PlayFile SR9]    // 欢迎你进入央视主持人大拜年。。。。
	StopPlayBack  -> stMingXing
	DialTerminate -> stMingXing
    	Failed        -> stMingXing

:stMingXing
        [ClearDTMF]
        [SetDTMF "?" ]
        [Assign SR9,@VoxPath]
        [StrCat SR9,"c_2_M1.vox"]
        [PlayFile SR9 ]    // 朱军拜年请按1,。。。。
	StopPlayBack  -> stMingXing1
	DialTerminate -> stMingXing1
    	Failed        -> stMingXing1

:stMingXing1
	[Input 1,5]
	StopDigits('*') -> stWriteSDR
        StopDigits('#') -> stMingXingMore
        StopDigits -> stMingXingRecord
	TimeOut         -> stMingXing
	[Assign SR20,"c_s1"]
	[StrCat SR20,SR0]
:stMingXingMore
        [ClearDTMF]
        [SetDTMF "?" ]
        [Assign SR9,@VoxPath]
        [StrCat SR9,"c_2_M2.vox"]
        [PlayFile SR9]    // 袁德旺拜年请按1,。。。。
	StopPlayBack  -> stMingXing2
	DialTerminate -> stMingXing2
    	Failed        -> stMingXing2
:stMingXing2
	[Input 1,5]
	StopDigits('*') -> stWriteSDR
        StopDigits('#') -> stMingXingMore1
        StopDigits -> stMingXingRecord
	TimeOut         -> stMingXingMore
	[Assign SR20,"c_s2"]
	[StrCat SR20,SR0]
:stMingXingMore1
        [ClearDTMF]
        [SetDTMF "?"]
        [Assign SR9,@VoxPath]
        [StrCat SR9,"c_2_M3.vox"]
        [PlayFile SR9]    // 刘路拜年请按1,。。。。
	StopPlayBack  -> stMingXing3
	DialTerminate -> stMingXing3
    	Failed        -> stMingXing3
:stMingXing3
	[Input 1,5]
	StopDigits('*') -> stMingXing
        StopDigits('#') -> stMingXingMore1
        StopDigits -> stMingXingRecord
	TimeOut         -> stMingXingMore1
	[Assign SR20,"c_s3"]
	[StrCat SR20,SR0]
:stMingXingRecord
	[ClearDTMF]
	[Assign SR_SongContent,SR20]       //写入化单文件的歌曲编码
	[Assign SR9,@ORDER_PATH]
	[StrCat SR9,SR20]
	[StrCat SR9,".vox"]
	[Assign SR_ORDERCONTENT,SR9]     //实际的语音文件名(带路径和.vox)
	[PlayFile SR9] //明星主持人的拜年语音内容
	StopPlayBack  -> stMingXingRecord1
	DialTerminate -> stMingXingRecord1
    	Failed        -> stMingXingRecord1
:stMingXingRecord1
        [ClearDTMF]
        [SetDTMF "?"]
	[Assign SR9,@VoxPath]
	[StrCat SR9,"c_2_03.vox"]
	[PlayFile SR9]    //请主持人给亲友拜年请按1。。。。。。。
	StopPlayBack  -> stMingXingPressQuery
	DialTerminate -> stMingXingPressQuery
    	Failed        -> stMingXingPressQuery

:stMingXingPressQuery
	[Input 1,5]
	StopDigits('*') -> stMingXing
        StopDigits('1') -> stMingXingDianSong
        StopDigits      -> stMingXingRecord1
	TimeOut         -> stMingXingRecord1

:stMingXingDianSong
	[CallFunc &FN_SendSong]
	Returned(0)->stSendOk
	Returned ->stMingXing
:stSendOk
        [ClearDTMF]
        [SetDTMF "?"]
	[Assign SR9,@VoxPath]
	[StrCat SR9,"c_2_04.vox"]
	[PlayFile SR9]    //明星拜年成功,继续按1,返回按×。。。。
	StopPlayBack  -> stIfContinue
	DialTerminate -> stIfContinue
    	Failed        -> stWriteSDR
:stIfContinue
	[Digit 5]
	StopDigits('1')-> stMingXingDianSong       	//继续发送
	StopDigits('*')->stWriteSDR       	//返回
	StopDigits -> stSendOk
	TimeOut -> stSendOk
	Failed -> stWriteSDR
:stWriteSDR
	[CallFunc &FN_WriteBranchSDR]
	Returned -> stExit
:stExit
	[Assign SR30,""]
	[Return 0]
}
//★★主持人拜年请按2函数end



//*****************************预拨表插入流程******************************
//入口参数:SR28为被叫电话号码,SR19为点播时间,SR11	包含留言文件,SR27为点播内容文件
//***********************************************************************
FN_WRITEPREDIALTASK
{
:stWait
        [Assign SR15,$CallerID]
        [NowTime]
        [Assign SR12,SR0]
        [StrSub SR12,5,12]
        [StrCat SR15,SR0]
        [Assign FD0,SR15]                  //此部分以上,取主叫号+时间六位赋给预播号表第一字段,作为表的标识.

        [IntRand 9999]                     //取随机数,做为CALLORDER
        [Add IR0,1]
        [IToS IR0]
        [Assign FD1,SR0]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -