Php 使用recordingStatusCallback将twilio录制保存到数据库

Php 使用recordingStatusCallback将twilio录制保存到数据库,php,twilio,twilio-api,twilio-php,Php,Twilio,Twilio Api,Twilio Php,我需要保存通话记录的详细信息,包括音频文件到数据库,同时进行通话 这是我的twiML文件 <Response> <Dial record="record-from-ringing-dual" recordingStatusCallback="https://example.com/record_data.php" action="https://example.com/test.php" callerId="xxxxxxxxxx"> xxxxx

我需要保存通话记录的详细信息,包括音频文件到数据库,同时进行通话

这是我的twiML文件

<Response>
    <Dial record="record-from-ringing-dual" recordingStatusCallback="https://example.com/record_data.php" action="https://example.com/test.php" callerId="xxxxxxxxxx">
          xxxxxxxxxx
    </Dial>
</Response>

XXXXXXXXX
在record_data.php文件中,我应该如何将记录的详细信息保存到数据库中


有人能帮我吗?提前感谢。

这里是Twilio开发者福音传道者

当您收到
recordingStatusCallback
webhook时,Twilio将发送

AccountSid负责此录制的帐户的唯一标识符。
CallSid与录制关联的呼叫的唯一标识符。这将始终引用两段式调用的父段。
RecordingSid记录的唯一标识符。
RecordingUrl录制音频的URL。
RecordingStatus记录的状态。可能的值为:已完成。
录制持续时间录制的长度,以秒为单位。
RecordingChannels最终录制文件中作为整数的通道数。可能的值是1,2。
RecordingSource创建此录制的调用类型。对于当record设置为on时启动的录制,将返回DialVerb。
RecordingUrl
是您可以从中下载录音并存储在自己的服务器上的地方


如果有帮助,请告诉我。

@philnash..我正在从浏览器打电话到我的手机,正在录制并在中列出。我如何使用
recordingStatusCallback
url访问录制的通话?是的,但是你试过用PHP保存文件吗?你试过用谷歌搜索吗?是的..我只知道这一点;我们可以使用
recordingStatusCallback
获取一个webhook,其中包含可供访问的所有录制详细信息。在
recordingStatusCallback
页面中找不到任何关于如何访问这些详细信息的示例。@Jenz:你找到了吗Jenz?因为这几天来我一直在为这个头痛。Twilio文档不是很清楚。如何使用PHP检索调用记录?你能帮个忙吗?@philnash..我刚刚在recordingStatusCallback页面中尝试了打印($\请求)。但它没有打印任何东西。我可以在存储到服务器之前查看数据吗?它根本没有显示任何内容?这是Twilio提出请求的结果吗?你能试着将你的recordingStatusCallback URL指向并检查结果吗?试过了。在这里,我得到了记录的详细信息。好的,这就是Twilio在制作webhook时将发送给您的服务器的内容。我不知道我还能在这里做些什么。
AccountSid          The unique identifier of the Account responsible for this recording.
CallSid             A unique identifier for the call associated with the recording. This will always refer to the parent leg of a two leg call.
RecordingSid        The unique identifier for the recording.
RecordingUrl        The URL of the recorded audio.
RecordingStatus     The status of the recording. Possible values are: completed.
RecordingDuration   The length of the recording, in seconds.
RecordingChannels   The number of channels in the final recording file as an integer. Possible values are 1, 2.
RecordingSource     The type of call that created this recording. For recordings initiated when record is set on <Dial>, DialVerb is returned.