setCalledShowNumber("4001112222"); //必填-被叫号码 $request->setCalledNumber($phone); //必填-Tts模板Code $request->setTtsCode("TTS_173425750"); //选填-Tts模板中的变量替换JSON,假如Tts模板中存在变量,则此处必填 // $request->setTtsParam("{\"type\":\"".$content."\"}"); $request->setTtsParam("{\"type\":\"".$type."\",\"gz\":\"".$gz."\",\"bjsj\":\"".$bjsj."\"}"); //选填-音量 $request->setVolume(100); //选填-播放次数 $request->setPlayTimes(3); //选填-外呼流水号 $request->setOutId("1234"); //hint 此处可能会抛出异常,注意catch $response = $acsClient->getAcsResponse($request); return $response->Message; } // 调用示例: //set_time_limit(0); //header("Content-Type: text/plain; charset=utf-8"); // //$response = singleCallByTts(); //echo "文本转语音外呼(singleCallByTts)接口返回的结果:\n"; //print_r($response);