【发布时间】:2019-07-15 09:52:51
【问题描述】:
我只想在我的项目中集成 twilio 可编程语音(android + PHP),所以当我使用 android 应用拨打 VOIP 电话时,接听电话的人会听到 twiml 可编程消息待命。
我已经尝试了很多,VOIP 通话工作正常,但我想在接收者接受呼叫时添加可编程消息。
$callerNumber = '+123456789';
$response = new Twilio\Twiml();
if (!isset($to) || empty($to)) {
$response->say('Congratulations! You have just made your first call! Good bye.');
} else if (is_numeric($to)) {
$dial = $response->dial(
array(
'callerId' => $callerNumber,
));
$dial->number($to);
} else {
$dial = $response->dial(
array(
'callerId' => $callerId,
));
$dial->client($to);
}
print $response;
我在后端使用了上面的代码,我的 VOIP 通话工作正常,但我想在接收者接受呼叫时添加一条可编程消息
【问题讨论】:
标签: php android twilio twilio-api twilio-php