End Of Call Report - Pin Pointing thedynamicDestin...
# support
s
I am having an issue pin pointing the value of the dynamicDestinationTransferCall number. The only place I can see the number within the End-of-call-report is within the Messages > Artifact > Inside one of the collections. Pinpointing this is proving difficult, as there's a different number of messages each time. How can I extract the number the caller was transferred to, within the end-of-call-report. https://cdn.discordapp.com/attachments/1375540638962942015/1375540639491559546/image.png?ex=68320f8c&is=6830be0c&hm=557aa1dca652990b0ab8fba3c3375bd2e399a07151b2601d3b57077ceea33c9f&
v
To reliably extract the number the caller was transferred to in a Vapi end-of-call report, use the top-level
destination
field, not the nested tool call arguments. For example, in your JSON:
Copy code
json
"destination": {
  "type": "number",
  "number": "+441925559"
}
This field gives you the actual transfer destination, regardless of how many tool calls or messages are present. Sources: - [Vapi API Reference: Get Call](https://docs.vapi.ai/api-reference/calls/get-call) - [Vapi Dynamic Call Transfers Documentation](https://docs.vapi.ai/calls/call-dynamic-transfers)
To clarify: When there are multiple dynamicDestinationTransferCall numbers in the report, do you want to extract the first, last, or only the successful transfer destination? If you have access to timestamps or status fields for each tool call, that could help pinpoint the correct number. Source: - [Dynamic Call Transfers documentation](https://docs.vapi.ai/calls/call-dynamic-transfers)
s
There is only one number in the report, but this is dynamically retrieved from a 'getNumber' tool. I can't see an option for 'destination' in the end-of-call-report.
What server messages do I need to have enabled?
k
Loop through messages[].toolCalls[].function.arguments.location, and return the first value that starts with + to reliably extract the transferred phone number from the end-of-call report.
v
To reliably extract the transferred number, make sure your assistant's
serverMessages
include both
"transfer-destination-request"
and
"end-of-call-report"
. Here’s how you can configure it:
Copy code
json
"serverMessages": [
  "transfer-destination-request",
  "end-of-call-report"
]
This ensures your server receives the necessary events to track dynamic transfers and extract the number from the end-of-call report payload. Reference: [Dynamic Call Transfers documentation](https://docs.vapi.ai/calls/call-dynamic-transfers) Sources: - [Dynamic Call Transfers documentation](https://docs.vapi.ai/calls/call-dynamic-transfers) - [Server Events documentation](https://docs.vapi.ai/server-url/events)
s
Thanks, got it working. Used an iterator to loop through the arrays until I found the toolcall with the transfer number: https://cdn.discordapp.com/attachments/1375540638962942015/1378721568380686446/image.png?ex=683da205&is=683c5085&hm=7f887396577f10b7cfc8c6293fefb2703e2fcfcbfecbcff1576cda5e7a3fbee9&
v
Glad it's solved