通話の送受信に公式の PHP Twilio ライブラリ コードを使用しています。以下のコード例を使用して SMS を送信できます。
<?php
require('twilio/Twilio.php');
$sid = "AC************";
$token = "2************";
$client = new Services_Twilio($sid, $token);
$message = $client->account->sms_messages->create(
'+1905xxxxxxx', // From a valid Twilio number
'+278xxxxxxxx', // Text this number
"Hello, test SMS message number 001!"
);
?>
ここで、上記のコードにコールバック URL を追加したいと思います。それはできますが、$params の配列を追加する方法がわかりません。
function create($from, $to, $body, array $params = array()) {
return parent::_create(array(
'From' => $from,
'To' => $to,
'Body' => $body
) + $params);
}
助けてくれてありがとう