我需要在本地保存拨出电话录音,为了做到这一点,我需要从“发送”和“收听”进行录音。
我正在使用本指南创建示例应用程序:https://www.twilio.com/docs/voice/client/javascript/quickstart
唯一的区别是下一个处理程序以便记录调用:
exports.handler = function(context, event, callback) {
let twiml = new Twilio.twiml.VoiceResponse();
// Wrap the phone number or client name in the appropriate TwiML verb
// if is a valid phone number
const attr = isAValidPhoneNumber(event.To) ? 'number' : 'client';
const dial = twiml.dial({
callerId: context.CALLER_ID,
record: 'record-from-ringing-dual',
recordingStatusCallback: 'https://hooks.mydomain.com/twilio/recording'
});
dial[attr]({}, event.To);
callback(null, twiml);
};
通话结束后,我成功收到通知:
{
"AccountSid": "AC****",
"CallSid": "CA****",
"RecordingChannels": 2,
"RecordingDuration": 24,
"RecordingSid": "RE***",
"RecordingSource": "DialVerb",
"RecordingStatus": "completed",
"RecordingUrl": "https://api.twilio.com/2010-04-01/Accounts/****"
}
但是,当我使用API接收呼叫和录制详细信息时,没有“发件人”和“收件人”信息:
TwilioClient.Init(accountSid, authToken);
var call = CallResource.Fetch(
pathAccountSid: accountSid,
pathSid: "CA****"
);
//Console.WriteLine(call.From);
var recording = RecordingResource.Fetch(pathAccountSid: accountSid,
pathSid: "RE****");
我在家长电话上录音,但是来自和来电给孩子打电话。
现在,知道父ID我无法取得儿童电话。
有什么建议吗?
答案 0 :(得分:1)
Twilio开发者传道者在这里。
您可以使用父呼叫sid获取子呼叫。您可以将其用作Calls list resource上的过滤器。在C#中看起来像:
TwilioClient.Init(accountSid, authToken);
var calls = CallResource.Read(
parentCallSid: parentCallSid,
pathAccountSid: accountSid
);