Based on your full event logs, the first case and second case are not the same type of call transfer.
It looks like the first case was a blind transfer and the second case was a warm transfer.
For a blind transfer, the first call will get disconnected and the same call session is remained for the second call and the first call is disconnected with the reason below
"status": {
"code": "Disconnected",
"reason": "BlindTransfer",
"rcc": false
},
For a warm transfer, the first call will be on hold while the agent is making a call to the second agent (extension) and this will have a new call session (different session id). When the call is finally "warm" transferred, the first call will be gone with the reason below
"sequence": 11,
"sessionId": "19845820049",
...
"status": {
"code": "Gone",
"reason": "AttendedTransfer",
"peerId": {
"telephonySessionId": "s-a78854117eec0z1804111e726zd9ee980000",
"sessionId": "19845849049",
"partyId": "p-a78854117eec0z1804111e726zd9ee980000-1"
},
"rcc": false
},
Since I don't have a desk phone to check, can you double check if there is an option to perform a blind transfer from your desk phone and make a blind transfer instead of a warm transfer so we can verify if there are differences between RC app and a desk phone in this scenario. If there is no option for blind transfer (weird if it does not support) from your desk phone, you can make a warm transfer in the RC app so we can compare the result.
Yes, you are right. First case is blind transfer, second one is the warm transfer. On deskphone it working similar to first case when it is blind transfer.
There is the problem in warm transfer. In this case events haven't number of original caller, only two extensions in party. Can you please advise the right way how I need to find out the original phone number of the caller when warm transfer is completed?
Here is how to can detect the original caller phone number after a warm transfer using the telephony session events.
Customer inbound call event
...
"sessionId": "19845820049",
....
"parties":[
{
...
"direction": "Inbound",
"to": {
"phoneNumber": "+1325xxxxxxx",
"name": "Pavel Yurkevich",
"extensionId": "363256048"
},
"from": {
"phoneNumber": "+1469xxxxxxx",
"name": "GRAPEVINE TX"
},
"status": {
"code": "Answered",
"rcc": false
},
...
Warm transferred call event
...
// Original call's session id
"sessionId": "19845820049",
...
"parties": :
{
.
"direction": "Inbound",
"to": {
"phoneNumber": "+1325xxxxxxx",
"name": "Pavel Yurkevich",
"extensionId": "363256048"
},
// Original caller phone number
"from": {
"phoneNumber": "+1469xxxxxxx",
"name": "GRAPEVINE TX"
},
"status": {
"code": "Gone",
"reason": "AttendedTransfer",
"peerId": {
...
// Warm transferred call's session Id
"sessionId": "19845849049",
...
},
"rcc": false
},
...
Customer and new agent call event
...
// Warm transferred session id
"sessionId": "19845849049",
...
"parties":
{
...
"direction": "Outbound",
"to": {
"phoneNumber": "704",
"name": "Egor Teplyakov",
"extensionId": "215743048"
},
// Replace the "from.phoneNumber" of the original call as you wish
"from": {
"phoneNumber": "+13258993376",
"name": "Pavel Yurkevich",
"extensionId": "363256048",
"deviceId": "338329048"
},
"status": {
"code": "Gone",
"reason": "AttendedTransfer",
"peerId": {
...
// Original call's session id
"sessionId": "19845820049",
...
},
"rcc": false
},
...
So the logic you should build is to detect an "Inbound" call (original call) with the status == "Gone", parse the reason and the peerId to get the session Id of the warm transferred call. Then detect an "Outbound" call with the status == "Gone", parse the reason and the peerId to get the session Id of the original call. Copy the "from.phoneNumber" of the original call and replace the "from.phoneNumber" of the warm transferred call as you wish.