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

if Info.EventType == 0: 
    '''电话响铃代码写在这下面'''
    Info.IvrResult = 0
    Pickup(Info.chindex)
    PlayStr(Info.chindex, "你按的是妈妈的电话，按键正确")
elif Info.EventType == 1:
    PlayStr(Info.chindex, "你按的是妈妈的电话，按键正确")
    Info.IvrResult = 0
elif Info.EventType == 2:
    '''按键代码写在这下面'''
    StopPlay(Info.chindex)
    PlayStr(Info.chindex, Info.IvrButton)
elif Info.EventType == 3:
    '''语音结束代码写在这下面'''
    '''i = GetInt(Info.chindex, 'i', 't')
    Play(Info.chindex, str(i))
    i = i+1
    if i>9:
        i=0
    SetInt(Info.chindex, 'i', 't', i)'''
elif Info.EventType == 4:
    '''语音超时代码写在这下面'''
    atprint("")
    
elif Info.EventType == 5:
    '''己方挂机代码写在这下面'''
    atprint("")
    
elif Info.EventType == 6:
    '''对方挂机代码写在这下面'''
    atprint("")
    
else:
    atprint("")

