当前位置: 首页>>代码示例>>PHP>>正文


PHP REST::voiceVerify方法代码示例

本文整理汇总了PHP中REST::voiceVerify方法的典型用法代码示例。如果您正苦于以下问题:PHP REST::voiceVerify方法的具体用法?PHP REST::voiceVerify怎么用?PHP REST::voiceVerify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在REST的用法示例。


在下文中一共展示了REST::voiceVerify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: voiceVerify

function voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl, $lang, $userData)
{
    global $accountSid, $accountToken, $appId, $serverIP, $serverPort, $softVersion;
    $accountSid = 'aaf98f894d`328b13014d566d3eca1b83';
    $accountToken = '37fbd7a853df4704bd5420f22328fffb';
    $appId = '8a48b5514d32a2a8014d56721def1b2b';
    $appToken = 'd96986e70dae11e5ac73ac853d9f54f2';
    $serverIP = 'sandboxapp.cloopen.com';
    $serverPort = '8883';
    $softVersion = '2013-12-26';
    // 初始化REST SDK
    global $accountSid, $accountToken, $appId, $serverIP, $serverPort, $softVersion;
    $rest = new REST($serverIP, $serverPort, $softVersion);
    $rest->setAccount($accountSid, $accountToken);
    $rest->setAppId($appId);
    //调用语音验证码接口
    // echo "Try to make a voiceverify,called is $to <br/>";
    $result = $rest->voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl, $lang, $userData);
    if ($result == NULL) {
        // echo "result error!";
        break;
    }
    if ($result->statusCode != 0) {
        // echo "error code :" . $result->statusCode . "<br>";
        // echo "error msg :" . $result->statusMsg . "<br>";
        //TODO 添加错误处理逻辑
    } else {
        // echo "voiceverify success!<br>";
        // 获取返回信息
        $voiceVerify = $result->VoiceVerify;
        // echo "callSid:".$voiceVerify->callSid."<br/>";
        // echo "dateCreated:".$voiceVerify->dateCreated."<br/>";
        //TODO 添加成功处理逻辑
    }
}
开发者ID:aimreant,项目名称:aniwear_php,代码行数:35,代码来源:SendTemplateSMS.php

示例2: voiceVerify

/**
 * 语音验证码
 * @param verifyCode 验证码内容,为数字和英文字母,不区分大小写,长度4-8位
 * @param playTimes 播放次数,1-3次
 * @param to 接收号码
 * @param displayNum 显示的主叫号码
 * @param respUrl 语音验证码状态通知回调地址,云通讯平台将向该Url地址发送呼叫结果通知
 */
function voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl)
{
    // 初始化REST SDK
    global $accountSid, $accountToken, $appId, $serverIP, $serverPort, $softVersion;
    $rest = new REST($serverIP, $serverPort, $softVersion);
    $rest->setAccount($accountSid, $accountToken);
    $rest->setAppId($appId);
    //调用语音验证码接口
    echo "Try to make a voiceverify,called is {$to} <br/>";
    $result = $rest->voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl);
    if ($result == NULL) {
        echo "result error!";
        break;
    }
    if ($result->statusCode != 0) {
        echo "error code :" . $result->statusCode . "<br>";
        echo "error msg :" . $result->statusMsg . "<br>";
        //TODO 添加错误处理逻辑
    } else {
        echo "voiceverify success!<br>";
        // 获取返回信息
        $voiceVerify = $result->VoiceVerify;
        echo "callSid:" . $voiceVerify->callSid . "<br/>";
        echo "dateCreated:" . $voiceVerify->dateCreated . "<br/>";
        //TODO 添加成功处理逻辑
    }
}
开发者ID:qiuai,项目名称:qieyou,代码行数:35,代码来源:VoiceVerify.php

示例3: voiceVerify

/**
 * 语音验证码
 * @param verifyCode 验证码内容,为数字和英文字母,不区分大小写,长度4-8位
 * @param playTimes 播放次数,1-3次
 * @param to 接收号码
 * @param displayNum 显示的主叫号码
 * @param respUrl 语音验证码状态通知回调地址,云通讯平台将向该Url地址发送呼叫结果通知
 * @param lang 语言类型。取值en(英文)、zh(中文),默认值zh。
 * @param userData 第三方私有数据
 * @param welcomePrompt  欢迎提示音,在播放验证码语音前播放此内容(语音文件格式为wav)           
 * @param playVerifyCode  语音验证码的内容全部播放此节点下的全部语音文件
 */
function voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl, $lang, $userData, $welcomePrompt, $playVerifyCode)
{
    // 初始化REST SDK
    $ci =& get_instance();
    $sms = $ci->config->item('SMSCHANNEL');
    $accountSid = $sms['accountSid'];
    $accountToken = $sms['accountToken'];
    $appId = $sms['appId'];
    $serverIP = $sms['serverIP'];
    $serverPort = $sms['serverPort'];
    $softVersion = $sms['softVersion'];
    // global $accountSid,$accountToken,$appId,$serverIP,$serverPort,$softVersion;
    $rest = new REST($serverIP, $serverPort, $softVersion);
    $rest->setAccount($accountSid, $accountToken);
    $rest->setAppId($appId);
    //调用语音验证码接口
    $result = $rest->voiceVerify($verifyCode, $playTimes, $to, $displayNum, $respUrl, $lang, $userData, $welcomePrompt, $playVerifyCode);
    if ($result->statusCode != 0) {
        //             echo "error code :" . $result->statusCode . "<br>";
        //             echo "error msg :" . $result->statusMsg . "<br>";
        //             //TODO 添加错误处理逻辑
    } else {
        //             echo "voiceverify success!<br>";
        //             // 获取返回信息
        //             $voiceVerify = $result->VoiceVerify;
        //             echo "callSid:".$voiceVerify->callSid."<br/>";
        //             echo "dateCreated:".$voiceVerify->dateCreated."<br/>";
        //TODO 添加成功处理逻辑
    }
}
开发者ID:asmenglei,项目名称:lanxiao,代码行数:42,代码来源:sendvoicesms_helper.php


注:本文中的REST::voiceVerify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。