我阅读了以下Twilio PHP API 文档,它是成功的
我继续阅读有关无环语音邮件stackoverflow的信息,它基于拨打一个号码,然后立即再次从同一个号码拨打该号码,然后放弃第一个呼叫,这会将第二个呼叫直接发送到语音邮件
我怎样才能在下面的 try catch 中做到这一点:
try {
// Initiate a new outbound call
$call = $client->account->calls->create(
// Step 4: Change the 'To' number below to whatever number you'd like
// to call.
"+15558675309",
// Step 5: Change the 'From' number below to be a valid Twilio number
// that you've purchased or verified with Twilio.
"+15017250604",
// Step 6: Set the URL Twilio will request when the call is answered.
array("url" => "http://demo.twilio.com/welcome/voice/")
);
echo "Started call: " . $call->sid;
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
我试图抛出一个异常 - throw new Exception('something');
我试过添加 goto secondCall; 在 $call->sid 之后;其次是 secondCall:再次使用 try catch