1

音声が転写されてからテキストに変換されるtwilioアプリに取り組んでいます。転写テキストを取得するまで、すべてが機能します。「sid」がわかれば転写コードを取得できることは承知していますが、その場で転写コードが必要で「sid」がわからない場合はどうすればよいでしょうか。言い換えれば、電話番号「555-555-1212」からの最新のトランスクリプションが欲しいのですが、私が見つけることができるのは以下のコードだけです.

<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "AC1240edf87a1d3b6717472af6deda4ce7";
$token = "{{ auth_token }}";
$client = new Services_Twilio($sid, $token);
$client->account->transcriptions->delete("TR8c61027b709ffb038236612dc5af8723");
?>

前もって感謝します!ディエゴ

4

3 に答える 3

0

通話用の SID を取得する必要がありますが、電話番号と、必要に応じて検索する日付範囲がわかっている場合は、簡単に行うことができます (私の PHP は錆びているため、これを修正する必要がある場合があります)。

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "{{ sid }}"; 
$token = "{{ auth_token }}"; 
$client = new Services_Twilio($sid, $token);

// Get calls to a number on or after a certain date.
foreach ($client->account->calls->getIterator(0, 50, array("Status" => "completed", "To" => "555-555-1212","StartTime" => "2013-10-26")) as $call)  {
    echo $call->sid
    //now use the sid to get the transcription text using a seperate rest call.
    $transcription = $client->account->transcriptions->get($call->sid);
    echo $transcription->transcription_text;    
}
于 2013-10-26T11:17:04.770 に答える
0

Twilio エバンジェリストはこちら。

もう 1 つのオプションは、<Record>動詞 is to を使用している場合、transcribeCallback パラメータを設定することです。

https://www.twilio.com/docs/api/twiml/record#attributes-transcribe-callback

これにより、文字起こしが完了したときに要求する URL を Twilio に与えることができます。

それが役立つことを願っています。

于 2013-11-17T05:56:10.047 に答える