<?xml version="1.0" encoding="utf-8"?>
  <ivr>
    <flow Name="鹤壁IVR流程" Type="normal" MatchedNum="." MatchedLine="|-1|" Concurrency="1" >
      <cell Name="CELL_START"  Pos="1" Next="2"  X="215" Y="40" Note="开始节点"  />
      <cell Name="CELL_SQL"  Pos="2" SuccessPos="3" FailPos="3"  X="390" Y="40" Note="插入通话记录" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="INSERT INTO T_Call_CallRecords(CallId,CallNumber,CallType,CallState,DealType,BeginTime,IvrStartTime,IvrEndTime,EndTime,LongTime,IsDeal,OperateType,MYD) VALUES('%[CallID]','%[CallerID]',0,0,0,GETDATE(),GETDATE(),GETDATE(),GETDATE(),0,0,0,0)" IsSaved="no"  />
      <cell Name="CELL_DEFINEVAR"  Pos="3" Next="4"  X="590" Y="40" Note="定义变量节点"  >
        <DefVar VarType="1" VarName="AgentNo" VarVal="0"  />
        <DefVar VarType="1" VarName="AgentExtNo" VarVal="0"  />
        <DefVar VarType="1" VarName="KeyGroup" VarVal="0"  />
        <DefVar VarType="1" VarName="GroupID" VarVal="0"  />
        <DefVar VarType="1" VarName="Key" VarVal="0"  />
        <DefVar VarType="1" VarName="BlackListVerify" VarVal="0"  />
        <DefVar VarType="1" VarName="HolidayVerify" VarVal="0"  />
		<DefVar VarType="1" VarName="vipinfo" VarVal="0" />
      </cell>
      <cell Name="CELL_SQL"  Pos="4" SuccessPos="5" FailPos="5"  X="790" Y="40" Note="读取黑名单" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="select COUNT(*) FROM T_Call_Blacklist where (F_TelPhone='%[CallerID]' or F_TelPhone=right('%[CallerID]',LEN ('%[CallerID]')-1)) and GETDATE()&gt;=F_SetTime and GETDATE()&lt;=F_RemoveTime" IsSaved="yes"  />
      <cell Name="CELL_RECORDSET"  Pos="5" LPos="6" EPos="6" GPos="6"  X="990" Y="40" Note="取黑名单结果"  >
        <Map Var="BlackListVerify"  />
      </cell>
      <cell Name="CELL_COMPARE"  Pos="6" TruePos="7" FalsePos="28"  X="990" Y="173" Note="判断黑名单" Data1Type="2" Data1="BlackListVerify" Data2Type="1" Data2="0" Data3Type="1" Data3="" CompareType="2" VarType="1"  />
      <cell Name="CELL_SQL"  Pos="7" SuccessPos="23" FailPos="23"  X="1221" Y="173" Note="黑名单通话记录" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="update T_Call_CallRecords set CallState=2,DealType=1,IsDeal=1 where CallId='%[CallID]'" IsSaved="no"  />
	  
	   <cell Name="CELL_SQL" Pos="28" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=HB12345;Data Source=10.0.38.107" 
		SqlStr="select case when (select COUNT(1) from T_Cus_VipInfo where F_Phone='%[CallerID]' and F_IsDelete =0 and F_State=0)>0 then 2 else 1 end " IsSaved="yes" SuccessPos="132" FailPos="132" Note="获取vip" />
		<cell Name="CELL_RECORDSET" Pos="132" LPos="8" EPos="8" GPos="8" Note="取vip结果">
			<Map Var="vipinfo" />
		</cell>
	  
      <cell Name="CELL_AUDIODTMF"  Pos="8" SuccessPos="9" FailPos="23" HangupPos="23"  X="590" Y="173" Note="放欢迎词" PlayType="2" ContentType="1" Content="D:\Midware\wav\welcome.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar=""  />
	  
      <cell Name="CELL_AUDIODTMF"  Pos="9" SuccessPos="10" FailPos="23" HangupPos="23"  X="190" Y="173" Note="依据按键值转人工接听或者语音留言" PlayType="1" ContentType="1" Content="D:\Midware\wav\group.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="KeyGroup"  />
      <cell Name="CELL_BRANCH"  Pos="10" DefaultPos="9"  X="215" Y="340" Note="依据按键值转人工接听或者语音留言-比较按键值" Var="KeyGroup"  >
        <Branch Value="1"  Pos="25"  />
        <Branch Value="2"  Pos="18"  />
        <Branch Value="3"  Pos="25"  />
        <Branch Value="9"  Pos="26"  />
      </cell>

 <cell Name="CELL_SQL"  Pos="26" SuccessPos="27" FailPos="27"  X="357" Y="340" Note="更新业务类型" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="update T_Call_CallRecords set BusinessType='%[KeyGroup]' where CallId='%[CallID]'" IsSaved="no"  />
 

 
   <cell Name="CELL_QUEUE"  Pos="27" NoAgentPos="18" NoFreePos="12" SuccessPos="16" HangupPos="23"  X="520" Y="340" Note="排队节点" Strategy="1" VipLevelType="2" VipLevel="vipinfo" GroupType="1" Group="11" AgentVar="AgentNo" ExtenVar="AgentExtNo"  />







      <cell Name="CELL_QUEUE"  Pos="11" NoAgentPos="18" NoFreePos="12" SuccessPos="16" HangupPos="23"  X="520" Y="340" Note="排队节点" Strategy="1" VipLevelType="2" VipLevel="vipinfo" GroupType="1" Group="1" AgentVar="AgentNo" ExtenVar="AgentExtNo"  />



      <cell Name="CELL_AUDIODTMF"  Pos="12" SuccessPos="13" FailPos="23" HangupPos="23"  X="466" Y="490" Note="坐席全忙放音" PlayType="1" ContentType="1" Content="D:\Midware\wav\BusyWait.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="Key"  />
      <cell Name="CELL_BRANCH"  Pos="13" DefaultPos="12"  X="682" Y="406" Note="分支节点" Var="Key"  >
        <Branch Value="1"  Pos="14"  />
      </cell>
      <cell Name="CELL_CONTINUEQUEUE"  Pos="14" SuccessPos="16" TimeoutPos="12" HangupPos="23"  X="800" Y="490" Note="继续排队节点" Agent="AgentNo" Exten="AgentExtNo" Audio="D:\Midware\wav\Queue.wav" Timeout="60"  />
      <cell Name="CELL_CANCELQUEUE"  Pos="15" Next="23"  X="1221" Y="340" Note="放弃排队节点" Reason="等烦了"  />
      <cell Name="CELL_AUDIODTMF"  Pos="16" SuccessPos="17" FailPos="23" HangupPos="23"  X="790" Y="340" Note="播报工号" PlayType="2" ContentType="2" Content=" `vs40 您好, `dig`vs30 %[AgentNo] `vs50 号话务员为您服务." TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="2" FinishKey="#" KeyVar=""  />
      <cell Name="CELL_TURNAGENT"  Pos="17" SuccessPos="24" FailPos="15" HangupPos="15"  X="990" Y="340" Note="转座席节点" Exten="AgentExtNo"  >
        <BandData Var="CallID"  />
      </cell>
      <cell Name="CELL_AUDIODTMF"  Pos="18" SuccessPos="19" FailPos="23" HangupPos="23"  X="190" Y="490" Note="留言开始放音" PlayType="2" ContentType="1" Content="D:\Midware\wav\BeginTapo.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar=""  />
      <cell Name="CELL_SQL"  Pos="19" SuccessPos="20" FailPos="20"  X="190" Y="640" Note="留言入库" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="INSERT INTO T_Call_LeaveRecord(F_CallId,F_Phone,F_LeaveTime,F_Status,F_StartTime) VALUES('%[CallID]','%[CallerID]',GETDATE(),0,GETDATE())" IsSaved="no"  />
      <cell Name="CELL_LEAVEWORD"  Pos="20" TimeoutPos="21" FinishPos="21" HangupPos="22"  X="190" Y="768" Note="留言节点" Path="%[CallID]_%[CallerID]_%[StartTime].wav" FinishKey="#" Timeout="60"  />
      <cell Name="CELL_AUDIODTMF"  Pos="21" SuccessPos="22" FailPos="22" HangupPos="22"  X="190" Y="884" Note="留言结束放音" PlayType="2" ContentType="1" Content="D:\Midware\wav\OverTapo.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar=""  />
      <cell Name="CELL_SQL"  Pos="22" SuccessPos="23" FailPos="23"  X="357" Y="884" Note="留言更新" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="update T_Call_LeaveRecord set F_RecFileUrl= CONVERT (varchar(10),GETDATE(),112 )+'/'+ '%[CallID]_%[CallerID]_%[StartTime].wav',F_EndTime=GETDATE(),F_LongTime=DATEDIFF(SECOND,F_StartTime,GETDATE()) where F_CallId='%[CallID]'" IsSaved="no"  />
      <cell Name="CELL_HANGUP"  Pos="23" Next="24"  X="590" Y="884" Note="挂机节点"  />
      <cell Name="CELL_END"  Pos="24"  X="1015" Y="884" Note="结束节点"  />
      <cell Name="CELL_SQL"  Pos="25" SuccessPos="11" FailPos="11"  X="357" Y="340" Note="更新业务类型" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog= HB12345;Data Source=10.0.38.107" SqlStr="update T_Call_CallRecords set BusinessType='%[KeyGroup]' where CallId='%[CallID]'" IsSaved="no"  />
    </flow>
  </ivr>
