''' 语音流程 '''
eventtype=["振铃","接通","按键","语音结束","语音超时","己方挂机","对方挂机","其他事件"]
Info.IvrResult = -1
try:
    atprint(eventtype[Info.EventType] + ",分机号=" + Info.Ext + "; 外线号码=" + Info.OutCode + "; 电话=" + Info.Tel)
except:
    atprint("收到其他事件="+str(Info.EventType))
''' ///////////////////////////////////////////////////// '''  

if Info.EventType == 0: 
    '''电话响铃代码写在这下面'''
    '''Info.IvrResult = 0
    Pickup(Info.chindex)'''
elif Info.EventType == 1:
    '''Info.IvrResult = 0
    Play(Info.chindex, '1')'''
elif Info.EventType == 2:
    '''按键代码写在这下面'''
    '''Info.IvrResult = 0
    atprint("Info.IvrButton="+Info.IvrButton)
    StopPlay(Info.chindex)
    if Info.IvrButton=='1':
        TransterOut(Info.chindex, "18911300801")
    else:
        Play(Info.chindex, Info.IvrButton)'''
    '''if Info.IvrButton=='1':
        TransterOut(Info.chindex, "18911300801")'''
elif Info.EventType == 3:
    '''语音结束代码写在这下面'''
    '''Info.IvrResult = 0
    Play(Info.chindex, '1')'''
elif Info.EventType == 4:
    '''语音超时代码写在这下面'''
    atprint("")
    
elif Info.EventType == 5:
    '''己方挂机代码写在这下面'''
    '''
    Info.IvrResult = 0'''
elif Info.EventType == 6:
    '''对方挂机代码写在这下面'''
    '''Clear(Info.chindex)
    Info.IvrResult = 0'''
else:
    atprint("")