<?xml version="1.0" encoding="utf-8"?>
<ivr>
	<flow Name="IVR_Normal" Type="normal" MatchedNum="." MatchedLine="|-1|" Concurrency="1">
		<cell Name="CELL_START" Pos="1" Next="2" Note="开始节点" />
		<!--
			exec P_OptCallRecords 'tel','callid',type,bustype,mydkey,'recfile'
			tel:来电号码%[CallerID]
			callid:中间件定义%[CallID]
			type:执行类型：1.插入通话记录；2.更新挂机时间；3.更新排队开始时间；4.插入留言；5.更新满意度；6.更新值班电话接通
			bustype:业务选择，用于需要有按键选择业务按键值
			mydkey:满意度按键值，1满意，2一般，3不满意
			recfile:留言的录音文件:%[CallID]_%[CallerID]_%[StartTime].wav
			插入通话记录示例：exec P_OptCallRecords '%[CallerID]','%[CallID]',1,0,1,'' 
		-->
		<cell Name="CELL_SQL" Pos="2" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr="exec P_OptCallRecords '%[CallerID]','%[CallID]',1,0,'0','','%[CalleeID]' " 
		IsSaved="no" SuccessPos="3" FailPos="3" Note="插入通话记录" />
		<cell Name="CELL_DEFINEVAR" Pos="3" Next="100" Note="定义变量节点">
			<DefVar VarType="1" VarName="AgentNo" VarVal="0" />
			<DefVar VarType="1" VarName="AgentExtNo" VarVal="0" />
			<DefVar VarType="1" VarName="XLXGroupID" VarVal="0" /><!--心连心坐席组ID-->
			<DefVar VarType="1" VarName="GroupID" VarVal="0" /><!--通过坐席组按键值 获取相应的坐席组ID-->
			<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="zbdh" VarVal="0" />
		</cell>
		<!--20190814 zhengbingbing  客户提出欢迎词太长，暂时取消欢迎词播报-->
		<!--欢迎词-->
		<!--根据被叫播放不同欢迎词-->
		<cell Name="CELL_BRANCH" Pos="100" Var="CalleeID" DefaultPos="101" Note="分支-欢迎词'%[CalleeID]'">
		  <Branch Value="9100" Pos="101" />      <!--心连心尿素-->
		  <Branch Value="9101" Pos="102" />      <!--手拉手-->
		  <Branch Value="9102" Pos="102" />      <!--沃利沃-->
		  <Branch Value="9300" Pos="103" />      <!--新疆-->
		  <Branch Value="9200" Pos="104" />      <!--九江-->
		</cell>

		<cell Name="CELL_AUDIODTMF" Pos="101" PlayType="2" ContentType="1" Content="D:\Midware\wav\welcome-xlx.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="4" FailPos="24" HangupPos="25" Note="放欢迎词-心连心客服中心" />
		<cell Name="CELL_AUDIODTMF" Pos="102" PlayType="2" ContentType="1" Content="D:\Midware\wav\welcome-nx.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="4" FailPos="24" HangupPos="25" Note="放欢迎词-农心公司客服中心" />
		<cell Name="CELL_AUDIODTMF" Pos="103" PlayType="2" ContentType="1" Content="D:\Midware\wav\welcome-xj.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="4" FailPos="24" HangupPos="25" Note="放欢迎词-新疆心连心客服中心" />
		<cell Name="CELL_AUDIODTMF" Pos="104" PlayType="2" ContentType="1" Content="D:\Midware\wav\welcome-jj.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="4" FailPos="24" HangupPos="25" Note="放欢迎词-九江心连心客服中心" />
		
		<!--欢迎词-->
		
		<!--黑名单-->
		<cell Name="CELL_SQL" Pos="4" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr="exec P_GetBlacklist  '%[CallerID]','%[CallID]' " IsSaved="yes" SuccessPos="5" FailPos="5" Note="读取黑名单" />
		<cell Name="CELL_RECORDSET" Pos="5" LPos="6" EPos="6" GPos="6" Note="取黑名单结果">
			<Map Var="BlackListVerify" />
		</cell>
		<cell Name="CELL_COMPARE" Pos="6" Data1Type="2" Data2Type="1" Data3Type="1" Data1="BlackListVerify" Data2="0" Data3="" VarType="1" CompareType="2" TruePos="26" FalsePos="603" Note="判断黑名单" />
		<!--黑名单提示音-->
		<cell Name="CELL_AUDIODTMF" Pos="26" PlayType="2" ContentType="1" Content="D:\Midware\wav\black.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="" SuccessPos="25" FailPos="24" HangupPos="24" Note="黑名单提示音" />
		<!--黑名单提示音-->
		<!--黑名单-->
		<!--获取坐席组-->
		<cell Name="CELL_SQL" Pos="603" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr="exec P_GetSeatGroup '%[CallerID]','%[CalleeID]'" 
		IsSaved="yes" SuccessPos="604" FailPos="24" Note="获取坐席组ID" />
		<cell Name="CELL_RECORDSET" Pos="604" LPos="8" EPos="8" GPos="8" Note="获取坐席组ID结果">
			<Map Var="GroupID" />
			<Map Var="GroupCode" />
			<Map Var="XLXGroupID" />
		</cell>
		<!--获取坐席组-->
		
		<!--节假日-->
		<!--判断是否加班或节假日，是放节假日音后挂机，否转坐席-->
		<cell   Name="CELL_SQL"  Pos="8" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr="EXEC P_GetHolidays '%[GroupCode]'" IsSaved="yes" SuccessPos="9" FailPos="15" IVR_Name="数据库读写" Note="节假日查询" /> 
		<cell   Name="CELL_RECORDSET"  Pos="9" LPos="10" EPos="10" GPos="10" IVR_Name="数据集映射" Note="取节假日结果" > 
			<Map   Var="HolidayVerify" /> 
		</cell>
		<cell   Name="CELL_COMPARE"  Pos="10" Data1Type="2"  Data2Type="1"  Data3Type="1"  Data1="HolidayVerify" Data2="0" Data3="" VarType="1"  CompareType="2"  TruePos="501" FalsePos="11" IVR_Name="数据比较" Note="判断节假日" /> 
		<!--新疆坐席组非工作时间只能留言-->
		<cell Name="CELL_BRANCH" Pos="11" Var="GroupCode" DefaultPos="111" Note="分支-新疆组转留言，九江和心连心组转值班电话">
		  <Branch Value="JJKFZ" Pos="111" />      <!--九江-转值班电话-->
		  <Branch Value="NXKFZ" Pos="111" />      <!--农心-转值班电话-->
		  <Branch Value="XLXKFZ" Pos="111" />      <!--心连心-转值班电话-->
		  <Branch Value="XJKFZ" Pos="112" />      <!--新疆-语音留言-->
		</cell>
		
		<cell Name="CELL_AUDIODTMF" Pos="111" PlayType="1" ContentType="1" Content="D:\Midware\wav\holiday.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="keyh" SuccessPos="110" FailPos="24" HangupPos="24" Note="放节假日音" />
		<cell Name="CELL_BRANCH" Pos="110" Var="keyh" DefaultPos="100" Note="分支-节假日">
		  <Branch Value="1" Pos="29" />      <!--转值班电话-->
		  <Branch Value="2" Pos="20" />      <!--语音留言-->
		</cell>
		
		<cell Name="CELL_AUDIODTMF" Pos="112" PlayType="1" ContentType="1" Content="D:\Midware\wav\holiday_xj.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="keyh_xj" SuccessPos="115" FailPos="24" HangupPos="24" Note="放节假日音-新疆" />
		<cell Name="CELL_BRANCH" Pos="115" Var="keyh_xj" DefaultPos="100" Note="分支-节假日-新疆">
		  <Branch Value="1" Pos="20" />      <!--语音留言-->
		</cell>
		<!--节假日-->
				
		<!--排队，转坐席-->
		
		<cell Name="CELL_SQL" Pos="501" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr=" exec P_OptCallRecords '%[CallerID]','%[CallID]',3,'%[GroupID]','1','','%[CalleeID]' " IsSaved="no" SuccessPos="13" FailPos="13" Note="更新排队开始时间" />
		<!--坐席排队时，没有登录坐席直接转值班电话，无空闲坐席转坐席全忙放音，有空闲坐席继续播报-->
		<cell Name="CELL_QUEUE" Pos="13" Strategy="1" VipLevelType="1" VipLevel="0" GroupType="2" Group="GroupID" AgentVar="AgentNo" ExtenVar="AgentExtNo" NoAgentPos="113" NoFreePos="113" SuccessPos="31" HangupPos="24" Note="排队节点" />
		<!--九江、新疆坐席组 忙/不在线 转向心连心客服组-->
		<cell Name="CELL_QUEUE" Pos="113" Strategy="1" VipLevelType="1" VipLevel="0" GroupType="2" Group="XLXGroupID" AgentVar="AgentNo" ExtenVar="AgentExtNo" NoAgentPos="114" NoFreePos="114" SuccessPos="31" HangupPos="24" Note="二次排队节点" />
		<!--二次排队 坐席组忙/不在线处理：新疆组转留言，九江和心连心组转值班电话-->
		<cell Name="CELL_BRANCH" Pos="114" Var="GroupCode" DefaultPos="14" Note="分支-新疆组转留言，九江和心连心组转值班电话">
		  <Branch Value="JJKFZ" Pos="29" />      <!--九江-转值班电话-->
		  <Branch Value="NXKFZ" Pos="29" />      <!--农心-转值班电话-->
		  <Branch Value="XLXKFZ" Pos="29" />      <!--心连心-转值班电话-->
		  <Branch Value="XJKFZ" Pos="20" />      <!--新疆-语音留言-->
		</cell>
		
		<cell Name="CELL_AUDIODTMF" Pos="14" PlayType="1" ContentType="1" Content="D:\Midware\wav\坐席全忙.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="1" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="Key" SuccessPos="15" FailPos="24" HangupPos="24" Note="坐席全忙放音" />
		<cell Name="CELL_BRANCH" Pos="15" Var="Key" DefaultPos="14" Note="分支节点">
			<Branch Value="1" Pos="16" /><!--1.继续等待-->
			<Branch Value="2" Pos="29" /><!--2.转值班电话-->
			<Branch Value="3" Pos="20" /><!--3.留言-->
		</cell>		
		<cell Name="CELL_CONTINUEQUEUE" Pos="16" Agent="AgentNo" Exten="AgentExtNo" Audio="D:\Midware\wav\保持音.wav" Timeout="60" SuccessPos="31" HangupPos="24" TimeoutPos="14" Note="继续排队节点" />
		<cell Name="CELL_CANCELQUEUE" Pos="17" Reason="等烦了" Next="24" Note="放弃排队节点" />		
		<!--20190814 zhengbingbing  取消欢迎词播报后，取消通话录音提示播报，直接提示工号-->
		<cell Name="CELL_AUDIODTMF" Pos="18" PlayType="2" ContentType="1" Content="D:\Midware\wav\通话录音提示音.wav" TTSNumMode="1" 
		TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="31" FailPos="24" HangupPos="24" Note="转接电话提示录音" />
		<cell Name="CELL_AUDIODTMF" Pos="31" PlayType="2" ContentType="2" Content=" `vs40 您好, `dig`vs30 %[AgentNo] `vs50 号话务员为您服务." TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="19" FailPos="24" HangupPos="24" Note="播报工号" />
		<cell Name="CELL_TURNAGENT" Pos="19" Exten="AgentExtNo" SuccessPos="25" FailPos="17" HangupPos="24" Note="转座席节点">
		  <BandData Var="CallID" />
		</cell>
		<!--排队，转坐席-->
		
		<!--留言-->
		<cell Name="CELL_AUDIODTMF" Pos="20" PlayType="2" ContentType="1" Content="D:\Midware\wav\留言提示音.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" 
		TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="" SuccessPos="21" FailPos="24" HangupPos="24" Note="留言开始放音" />
		<cell Name="CELL_LEAVEWORD" Pos="21" Path="%[CallID]_%[CallerID]_%[StartTime].wav" FinishKey="#" Timeout="60" TimeoutPos="22" HangupPos="23" FinishPos="22" Note="留言节点" />
		<cell Name="CELL_AUDIODTMF" Pos="22" PlayType="2" ContentType="1" Content="D:\Midware\wav\留言结束提示音.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="3" FinishKey="#" KeyVar="" SuccessPos="23" FailPos="23" HangupPos="23" Note="留言结束放音" />
		<cell Name="CELL_SQL" Pos="23" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" 
		SqlStr=" exec P_OptCallRecords '%[CallerID]','%[CallID]',4,'%[GroupID]','1','%[CallID]_%[CallerID]_%[StartTime].wav','%[CalleeID]' " IsSaved="no" 
		SuccessPos="24" FailPos="24" Note="留言入库" />
		
		<!--留言-->
		
		<!--转值班电话-->
		<cell Name="CELL_AUDIODTMF" Pos="29" PlayType="2" ContentType="1" Content="D:\Midware\wav\转值班电话提示.wav" TTSNumMode="1" TTSSpeed="50" TTSVolume="50" TTSEngine="0" StopWhenDtmf="2" MaxKeyCount="1" KeyPressInterval="0" FinishKey="#" KeyVar="" SuccessPos="701" FailPos="24" HangupPos="24" Note="转值班电话提示音" />
		<cell Name="CELL_SQL" Pos="701" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr="EXEC P_GetZBDH '%[CalleeID]','%[CallID]' " IsSaved="yes" SuccessPos="702" FailPos="24" Note="获取值班电话" />
		<cell Name="CELL_RECORDSET" Pos="702" LPos="30" EPos="30" GPos="30" Note="获取值班电话结果">
			<Map Var="zbdh" />
		</cell>
		<!-- <cell Name="CELL_TRANSFEROUT" Pos="30" CalleeNumType="2" CalleeNum="zbdh" Timeout="60" SuccessPos="25" FailPos="24" Note="转值班电话" /> -->
		<cell Name="CELL_TRANSFEROUT" Pos="30" CalleeNumType="2" CalleeNum="zbdh" Timeout="60" SuccessPos="301" FailPos="24" Note="转值班电话" />
		<cell Name="CELL_SQL" Pos="301" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr=" exec P_OptCallRecords '%[CallerID]','%[CallID]',6,,'%[GroupID]','','','%[CalleeID]' " IsSaved="no" SuccessPos="25" FailPos="25" Note="更新转值班接通" />
		<!--转值班电话-->
		
		<!---->
		<cell Name="CELL_SQL" Pos="24" ConnStr="Provider=SQLOLEDB.1;Password=hykj800100;Persist Security Info=True;User ID=sa;Initial Catalog=CallCenter_XinXiangXLX;Data Source=10.11.202.222" SqlStr=" exec P_OptCallRecords '%[CallerID]','%[CallID]',2,'%[GroupID]','1','','%[CalleeID]' " IsSaved="no" 
		SuccessPos="204" FailPos="204" Note="更新挂机时间" />
		<cell Name="CELL_HANGUP" Pos="204" Next="25" Note="挂机节点" />
		<cell Name="CELL_END" Pos="25" Note="结束节点" />	
		<!---->
	</flow>		
</ivr>
