Beispiel #1
0
def voiceVerify(verifyCode,playTimes,to,displayNum,respUrl):
    #初始化REST SDK
    rest = REST(serverIP,serverPort,softVersion)
    rest.setAccount(accountSid,accountToken)
    rest.setAppId(appId)
    
    result = rest.voiceVerify(verifyCode,playTimes,to,displayNum,respUrl)
    print result
    return result
Beispiel #2
0
def voiceVerify(verifyCode,playTimes,to,displayNum,respUrl,lang,userData):
    #初始化REST SDK
    rest = REST(serverIP,serverPort,softVersion)
    rest.setAccount(accountSid,accountToken)
    rest.setAppId(appId)
    
    result = rest.voiceVerify(verifyCode,playTimes,to,displayNum,respUrl,lang,userData)
    for k,v in result.iteritems(): 
        
        if k=='VoiceVerify' :
                for k,s in v.iteritems(): 
                    print '%s:%s' % (k, s)
        else:
            print '%s:%s' % (k, v)
   
   
#voiceVerify('验证码内容','播放次数','接收号码','显示的主叫号码','语音验证码状态通知回调地址','语言类型','第三方私有数据')
def voiceVerify(to,verifyCode):

    rest = REST(serverIP,serverPort,softVersion)
    rest.setAccount(accountSid,accountToken)
    rest.setAppId(appId)

    playTimes	= 2
    respUrl	= ''
    lang	= ''
    userData	= ''

    result = rest.voiceVerify(verifyCode,playTimes,to,displayNum,respUrl,lang,userData)
    for k,v in result.iteritems():

        if k=='VoiceVerify' :
                for k,s in v.iteritems():
                    print '%s:%s' % (k, s)
        else:
            print '%s:%s' % (k, v)
def voiceVerify(to, verifyCode):

    rest = REST(serverIP, serverPort, softVersion)
    rest.setAccount(accountSid, accountToken)
    rest.setAppId(appId)

    playTimes = 2
    respUrl = ''
    lang = ''
    userData = ''

    result = rest.voiceVerify(verifyCode, playTimes, to, displayNum, respUrl,
                              lang, userData)
    for k, v in result.iteritems():

        if k == 'VoiceVerify':
            for k, s in v.iteritems():
                print '%s:%s' % (k, s)
        else:
            print '%s:%s' % (k, v)