如何解决您尝试向您帐户中未启用的电话号码发起出站电话呼叫
我已经使用 PHP 实现了调用 future 的 twilio 客户端。但有时呼叫在振铃后断开。当我查看 twilio 中的错误日志时,我可以看到消息“您试图向您的帐户中未启用的电话号码发起出站电话呼叫。”。我从浏览器调用到浏览器,从浏览器调用到移动应用程序,为什么会显示此消息?。
我不确定这是呼叫方还是接收方的问题。
Twiml 代码 例如:$to = 'CLIENT3150'
function get_voice_response($to,$from,$name,$image,$group) {
$response = new VoiceResponse();
if (!empty($to) && strlen($to) > 0) {
$number = htmlspecialchars($to);
$dial = $response->dial('',['callerId' => $from]);
// wrap the phone number or client name in the appropriate TwiML verb
// by checking if the number given has only digits and format symbols
if (preg_match("/^[\d\+\-\(\) ]+$/",$number)) {
$dial->number($number);
} else {
$client = $dial->client($number);
$client->parameter(['name' => 'FirstName','value' => $name]);
$client->parameter(['name' => 'Image','value' => $image]);
$client->parameter(['name' => 'Group','value' => $group]);
}
} else {
$response->say("Thanks for calling!");
}
return (string)$response;
}
谢谢
解决方法
这里是 Twilio 开发者布道者。
看起来你是making a call to another client and trying to pass parameters along with the call。执行此操作时,您需要将客户端名称作为 <Identity>
中的 <Client>
元素与 <Parameter>
元素一起传递。
在 PHP 中,这看起来像:
$client = $dial->client();
$client->identity($number);
$client->parameter(['name' => 'FirstName','value' => $name]);
$client->parameter(['name' => 'Image','value' => $image]);
$client->parameter(['name' => 'Group','value' => $group]);
让我知道这是否有帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。