Closed justsomeofl closed 4 months ago
HI @justsomeofl, Thank you for the heads up! Can you please share more details on this issue? What were the other fields returned as part of the response? Can you share the code snippet used for this, after removing custom details?
Hi @AsabuHere,
here are the other fields:
{
AccountSid: 'AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
ApiVersion: '2010-04-01',
CallSid: 'CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
CallStatus: 'ringing',
Called: '+331XXXXXXXX',
CalledCity: '',
CalledCountry: 'FR',
CalledState: '',
CalledZip: '',
Caller: '+337XXXXXXXX',
CallerCity: '',
CallerCountry: 'FR',
CallerState: '',
CallerZip: '',
Direction: 'inbound',
From: '+337XXXXXXXX',
FromCity: '',
FromCountry: 'FR',
FromState: '',
FromZip: '',
To: '+331XXXXXXXX',
ToCity: '',
ToCountry: 'FR',
ToState: '',
ToZip: ''
}
const call = await client.calls(request.body.CallSid)
.fetch();
console.log("ForwardedFrom", request.body.CallSid, request.body.ForwardedFrom, call?.forwarded_from);
//ForwardedFrom CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX undefined undefined
Thanks
Can you try accessing the attribute from call like this client.calls .create({ url: 'http://demo.twilio.com/docs/voice.xml', to: '+1XXXXXXXXX', from: '+1XXXXXXXXX' }) .then(call => console.log(call.forwardedFrom)); I can access the value like this in the latest version of twilio-node
I am able to access it with the way you mentionned. But when i catch a real call redirected to a webhook, this attribute is missing. Maybe this value is filled only for twilio created calls ?
Hi @justsomeofl! I rechecked it again and I am able to get the forwardedFrom
field in the response of fetch. In my case it is not showing undefined. Can you recheck again?
I will list my steps here:
null
in my case.Please let me know if we are doing something differently. Thanks!
Closing this as no response received
I did set up a webhook on a french phone number (+33). Then I made a call to another phone number that is forwarding to the webhook phone number. But the ForwardedFrom attribute is missing. Is it the expected behavior?