When the original caller is transferred from one extension to another extension(or to any other number), I couldn't find a reliable way to identify, from whom to whom the call was transferred.
From the call log API(/restapi/v1.0/account/~/call-log?&view=Detailed) , Only info related to call transfer is in call leg as given below:
{ "action": "Transfer", "direction": "Outbound", "duration": 21, "extension": { "id": 249697004, "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/249331004/extension/249697004" }, "from": { "extensionId": "249697004", "name": "Nanda Kumar" }, "legType": "TransferCall", "result": "Call connected", "startTime": "2019-07-18T08:46:36.185Z", "to": { "location": "Los Angeles , CA" }, "transport": "PSTN", "type": "Voice" }
Which does not have the proper `to` and `from` values.