?? song.sff
字號:
string menukey;
string songkey;
string songfile;
string songmenu;
string sql;
string phone;
string leavefile;
int menutime = 50;
int songtime = 50;
int connid=2;
int sysconnid = 1;
int isbaoyueuser = 0;
string myfile;
string dialoutflow = "1";
#測試是不是聯通號碼
state m_1_callertest
{
init
{
string mystr = getsubstring($sys_caller,0,3);
int myint = stoi(mystr);
if(myint>=130)
{
if(myint<=133)
{
goto m_1_start;
}
else
{
hangup();
}
}
else
{
hangup();
}
}
}
#流程開始
state m_1_start
{
init
{
sql= "select id,flag,mobile,regtime from taga_talkin_song_baoyueuser "
+"where flag = 1 and mobile = '" + $sys_caller+"'";
sqlselect(connid,sql);
int ret = getaffectedrow();
if(ret==0)
{
goto m_1_songbaoyue;
}
else
{
goto m_1_sendsong;
}
}
}
#包月注冊
state m_1_songbaoyue
{
init
{
#1號鍵確定 2號鍵單曲點送
playfile("d:\lgh\bin\trasin\10156\myvoc\songbaoyue.pcm",2);
readdigits(1);
setchantimer(menutime);
}
proc
{
switch($sys_dtmf)
{
case "1":
sql= "select * from taga_talkin_song_baoyueuser where mobile = '"+$sys_caller+"'";
sqlselect(connid,sql);
int ret = getaffectedrow();
#曾經注銷過的用戶
if(ret==1)
{
sql= "update taga_talkin_song_baoyueuser set flag = 1 where mobile = '"
+$sys_caller+"'";
}
else
{
#新用戶包月
sql="insert into taga_talkin_song_baoyueuser(mobile,regtime,type,flag) values ('" +$sys_caller+"', getdate(),1,1)" ;
}
sqlcommand(connid,sql);
isbaoyueuser = 1;
goto m_1_sendsong;
break;
case "2":
isbaoyueuser = 0;
goto m_1_sendsong;
break;
default:
goto m_1_songbaoyue;
break;
}
}
}
state m_1_sendsong
{
init
{
# 1-8號鍵點歌 9號鍵 按編號查詢 0號鍵取消包月
playfile("d:\lgh\bin\trasin\10156\myvoc\songmenu.pcm",2);
readdigits(1);
setchantimer(menutime);
}
proc
{
sf($sys_dtmf=="0")
{
sql= "update taga_talkin_song_baoyueuser set flag = 2 ,logouttime = getdate() where mobile = '"
+$sys_caller+"'";
sqlcommand(connid,sql);
goto m_1_quxiaobaoyue;
}
elsesf($sys_dtmf=="9")
{
goto m_1_singlesong;
}
else
{
menukey=$sys_dtmf;
goto m_1_songmenu;
}
}
}
state m_1_quxiaobaoyue
{
init
{
# 取消包月成功,謝謝你的使用
playfile("d:\lgh\bin\trasin\10156\myvoc\diangequxiaoqueding.pcm",2);
}
proc
{
#掛機
hangup();
}
}
state m_1_singlesong
{
init
{
# 請輸入編號
playfile("d:\lgh\bin\trasin\10156\myvoc\inputbynum.pcm",2);
readdigits(4);
setchantimer(menutime);
}
proc
{
songkey = $sys_dtmf;
myfile = "d:\lgh\bin\trasin\10156\musicfile\song"+songkey+".pcm";
int i = findfile(myfile);
if(i ==1)
{
goto m_2_find;
}
else
{
goto m_2_nofind;
}
}
}
state m_2_nofind
{
init
{
# 您輸入編號未找到,請重新輸入
playfile("d:\lgh\bin\trasin\10156\myvoc\reinputbynum.pcm",2);
readdigits(4);
setchantimer(menutime);
}
proc
{
songkey = $sys_dtmf;
myfile = "d:\lgh\bin\trasin\10156\musicfile\song"+songkey+".pcm";
int i = findfile(myfile);
if(i ==1)
{
goto m_2_find;
}
else
{
goto m_2_nofind;
}
}
}
state m_2_find
{
init
{
playfile(myfile,2);
readdigits(1);
setchantimer(menutime);
}
proc
{
goto m_1_listen;
}
}
state m_1_songmenu
{
init
{
songmenu="d:\lgh\bin\trasin\10156\myvoc\songmenu";
songmenu=songmenu+menukey+".pcm";
playfile(songmenu,2);
readdigits(1);
setchantimer(menutime);
}
proc
{
switch($sys_dtmf)
{
case "*":
goto m_1_sendsong;
break;
default:
songkey=$sys_dtmf;
sql="select songfile from taga_talkin_song_config where menukey = '"+
menukey + "' and songkey = '"
+ songkey +"'";
sqlselect(connid,sql);
int i = getaffectedrow();
songfile = getfieldvalue(0);
if(i==0)
{
goto m_2_nofind;
}
else
{
goto m_1_listen;
}
break;
}
}
}
state m_1_listen
{
init
{
#1 電送2 視聽 ×返回
playfile("d:\lgh\bin\trasin\10156\myvoc\listen.pcm",2);
readdigits(1);
setchantimer(menutime);
}
proc
{
switch($sys_dtmf)
{
case "1":
goto m_1_songsend;
break;
case "*":
goto m_1_songmenu;
break;
default:
goto m_1_listening;
break;
}
}
}
state m_1_listening
{
init
{
#不要放取鍵函數,放songtime秒就跳到proc 如果放了取鍵函數,songtime秒后重新播放
playfile(songfile,2);
setchantimer(songtime);
}
proc
{
goto m_1_listen;
}
}
state m_1_songsend
{
init
{
playfile("d:\lgh\bin\trasin\10156\myvoc\input.pcm",2);
readdigits(13);
}
proc
{
phone = $sys_dtmf;
goto m_1_confirm;
}
}
state m_1_confirm
{
init
{
playfile("d:\lgh\bin\trasin\10156\myvoc\number.pcm",2);
}
proc
{
goto m_1_confirmnext;
}
}
state m_1_confirmnext
{
init
{
playfile(phone,1);
}
proc
{
goto m_1_sure;
}
}
state m_1_sure
{
init
{
playfile("d:\lgh\bin\trasin\10156\myvoc\sure.pcm",2);
readdigits(1);
}
proc
{
switch($sys_dtmf)
{
case "1":
goto m_1_leave;
break;
case "2":
goto m_1_songsend;
break;
default:
goto m_1_sure;
break;
}
}
}
state m_1_leave
{
init
{
#需要給對方留言么,留言請按1,結束點波請按2
playfile("d:\lgh\bin\trasin\10156\myvoc\leave.pcm",2);
readdigits(1);
setchantimer(menutime);
}
proc
{
sf($sys_dtmf=="1")
{
goto m_1_leavep;
}
elsesf($sys_dtmf=="2")
{
sql="insert into taga_talkin_musicsendinfo(callermobile,calledmobile,accessno,companyid,dialoutid,songfile,"
+ "dialtime,dialcount,flag) values('"
+ $sys_caller
+ "' ,'"
+ phone
+ "' ,'"
+ $sys_callee
+ "',1,"
+ dialoutflow
+ ",'"
+ songfile
+ "',getdate(),0,0)";
sqlcommand(sysconnid,sql);
goto m_1_over;
}
else
{
goto m_1_leave;
}
}
}
state m_1_leavep
{
init
{
#滴聲后開始留言,#號鍵結束
playfile("d:\lgh\bin\trasin\10156\myvoc\leavep.pcm",2);
}
proc
{
goto m_1_leaveing;
}
}
state m_1_leaveing
{
init
{
string s = getnowtime();
string t = itos($sys_channo);
leavefile ="d:\lgh\bin\trasin\10156\recfile\" + s + t + ".pcm";
recfile(leavefile,1);
}
proc
{
sql="insert into taga_talkin_musicsendinfo(callermobile,calledmobile,accessno,companyid,dialoutid,songfile,"
+ "dialtime,leaveword,dialcount,flag) values('"
+ $sys_caller
+ "' ,'"
+ phone
+ "' ,'"
+ $sys_callee
+ "',1,"
+ dialoutflow
+ ",'"
+ songfile
+ "',getdate(), '"
+ leavefile
+ "' ,0,0)";
sqlcommand(sysconnid,sql);
sqlcommand(sysconnid,sql);
goto m_1_over;
}
}
state m_1_over
{
init
{
playfile("d:\lgh\bin\trasin\10156\myvoc\success.pcm",2);
}
proc
{
goto m_1_sendsong;
}
}
state hangupproc
{
init
{
sql="insert taga_talkin_log(caller,callee,hanguptime ) values( '"
+ $sys_caller+"','"
+ $sys_callee+"' ,getdate() )";
sqlcommand(connid,sql);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -