How to Retrieve the Correct Caller Number When a Call is Queued and Transferred to Another User

Can you assist with confirming the scenario of fetching the correct "customer number" for a call in the queue?

Currently, we retrieve the "purpose": "customer" from the participants' details to display the customer number. However, it is displaying the incorrect number "1002001" instead of the correct number "+13202801234".

--Reference part of attached JSON:
{
"id": "53f93cfa-e46b-4bae-92c4-a32cdaeb5655",
"name": "ABC",
"address": "tel:+13202801234",
"startTime": "2024-06-05T15:23:37.501Z",
"connectedTime": "2024-06-05T15:23:37.607Z",
"endTime": "2024-06-05T15:26:28.029Z",
"purpose": "customer",
"state": "terminated",
"direction": "inbound",
"disconnectType": "peer",
"held": false,
"wrapupRequired": false,
"mediaRoles": [
"full"
],
"queue": {
"id": "cb9fef32-573d-4513-ad3e-d8de9722700b",
"selfUri": "/api/v2/routing/queues/cb9fef32-573d-4513-ad3e-d8de9722700b"
},
{
"id": "ed94fc32-5a7c-4657-a683-958c998e6637",
"name": "Omilia OCP number plan",
"address": "tel:1002001",
"startTime": "2024-06-05T15:23:46.023Z",
"connectedTime": "2024-06-05T15:23:46.090Z",
"endTime": "2024-06-05T15:24:08.826Z",
"purpose": "customer",
"state": "terminated",
"direction": "outbound",
"disconnectType": "transfer",
"held": false,
"wrapupRequired": false,
"mediaRoles": [
"full"
],
"attributes": {},
"provider": "Edge",
"externalContact": {
"id": "f3f161dc-b681-462a-abba-4841ffad557e",
"selfUri": "/api/v2/externalcontacts/contacts/f3f161dc-b681-462a-abba-4841ffad557e"
}

Please find the attached JSON console log for reference.
Genesys_Conversation.json (14.2 KB)

Code we use to fetch customer number:

apiInstance.getConversationsCall(conversationId)
.then((data) => {
var phoneAddress = '';
data.participants.map(value => {
if (value.purpose == "customer" || value.purpose == "external") {
if (value.direction == "outbound") {
phoneAddress = value.address;
console.log('participants_phoneNumber_Outbound:', phoneAddress);
} else {
phoneAddress = value.ani;
console.log('participants_phoneNumber_inbound:', phoneAddress);
}
}
})
})

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.