1 回答
TA贡献1802条经验 获得超6个赞
您可以参考下面的 PHP 代码示例来添加自定义参数,我现在在本地系统上测试了此代码。
require_once './vendor/autoload.php';
use Twilio\TwiML\VoiceResponse;
$response = new VoiceResponse();
$dial = $response->dial('');
$client = $dial->client();
$identity = $client->Identity('user-jane');
$client->parameter([
"name" => "firstname",
"value" => "Test Firstname",
]);
$client->parameter([
"name" => "lastname",
"value" => "Test lastname",
]);
echo $response;
回复如下
<Response>
<Dial>
<Client>
<Identity>user-jane</Identity>
<Parameter name="firstname" value="Test Firstname" />
<Parameter name="lastname" value="Test lastname" />
</Client>
</Dial>
- 1 回答
- 0 关注
- 110 浏览
添加回答
举报