Can't get call transfer to work with phone with ex...
# support
h
for my call transfer agent, I have a couple of phone numbers with extensions for different department, the phone number portion is the same, only different in extension. I can't figure out from the VAPI documentation what to pass to in the function -> parameters -> properties -> destination -> enum. from the documentation it only put the phone number, but in this case, the number is actually the same, so it cause duplicate value error. I tried to leave the parameters completely empty, that doesn't work either, and when I tried to check on the tool_calls log for this I saw this { "role": "tool_calls", "time": 1743564816247, "message": "", "toolCalls": [ { "id": "call_6uZ5st4NyxNQ4rRN9stJvufo", "type": "function", "function": { "name": "transferCall", "arguments": "{\"destination\": \"+442035826399,6017\"}" } } ], "secondsFromStart": 13.378 } I guess +442035826399,6017 is not the right format for handling the extension either, (I tried +442035826399@6017 for the destination formation as well, that doesn't work either), and it seems like enum so what should be the right format, and if I need to, what should be the value I pass for the extension case? thanks!
here is my complete config tool section if that's helpful in triaging "tools": [ { "type": "transferCall", "messages": [... ], "destinations": [ { "type": "number", "number": "+442035826399", "description": "Sales Department", "transferPlan": { "mode": "warm-transfer-with-summary", "summaryPlan": { "enabled": true, "messages": [ { "role": "system", "content": "Please provide one-line-summary of the call." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n" } ] } }, "extension": "6017" },... ], "function": { "name": "transferCall", "description": "Transfer the call to the appropriate department", "parameters": { "type": "object", "properties": { "destination": { "type": "string", "enum": [?????], "description": "The department to transfer the call to" } }, "required": [ "destination" ] } } } ]
v
Hi there! šŸ‘‹ I understand you're having trouble with call transfers to phone numbers with extensions. While I don't have a definitive answer for the exact format to use in the destination enum parameter, I can share what I found about handling phone extensions with the transferCall function. Based on the information I found, the recommended approach is to use separate "number" and "extension" fields in a JSON structure rather than trying to combine them in the destination parameter. Here's an example of the correct JSON structure:
Copy code
json
{
  "type": "transferCall",
  "function": {
    "name": ""
  },
  "destinations": [
    {
      "type": "number",
      "number": "insert-number-here",
      "extension": "insert-ext",
      "numberE164CheckEnabled": false
    }
  ]
}
According to the [documentation](https://docs.vapi.ai/phone-calling/dynamic-call-transfers), this structure allows you to specify the phone number and extension separately, which should help avoid the duplicate value error you're encountering. I see from your tool_calls log that the system tried using a comma-separated format (
+442035826399,6017
), and you mentioned trying the
@
symbol format as well. These formats don't appear to be working correctly. For SIP connections, some users have tried various SIP URI formats like: -
sip:username:password@asterisk-ip;extension=10001
-
sip:username@asterisk-ip;extension=10001
-
sip:username:password@asterisk-ip:5060;extension=10001
-
sip:username@asterisk-ip:5060;extension=10001
However, it's worth noting that [VAPI does not allow PSTN to SIP transfers](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333747605628391434), which might be relevant to your case. Is there anything else about call transfers or other aspects of VAPI that I can help with? Sources:
- [VAPI transferCall function destination parameter format for phone number with extension](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339709058587820132) - [Different formats for phone numbers with extensions](https://docs.vapi.ai/api-reference/calls/create-phone-call) - [VAPI call transfer with phone extension](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333747605628391434) - [VAPI documentation for transferCall function parameters properties destination enum](https://docs.vapi.ai/phone-calling/dynamic-call-transfers)
h
like I mentioned above, I already specify the number and extension separately in the destinations field, my question is really what should be the value I put in the enum in the
function
field as the parameter, I tried to put separate field as well but it just break the ai. I tried to leave it empty like "function": { "name": "" }, also doesn't work, that's when it would generate the comma separate format in the log.
a
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
Hey Haiyang, here is how you can specify the extension with the cold transfer destination, and it works.
Copy code
"destinations": [
        {
            "type": "number",
            "number": "+1234567890",
            "extension": "4603",
            "message": "I am forwarding your call to Department A. Please stay on the line."
        }
    ]
h
hey @Shubham Bajaj thanks, the call id is this 80f2b4f7-73f6-428b-8d09-aa2abd9ca25f, as you can see, I already config the
destinations
field to be the same format like you mentioned, but it is what I put in the parameter for the
function
field is what confuse me, this call id I provided is the one where I tried with leaving the parameter field empty and only rely on the
destinations
, and it didn't work
@User any update on this?
a
šŸ”µ 03:33:36:245 \[user LOG\] Model called tool: transferCall({"destination":"+442xxx99,6017"}) šŸ”µ 03:33:38:082 Transferring Twilio Call...TwiML:<Response><Dial><Number sendDigits="wwww6017" url="[https://api.vapi.ai/twilio/twiml?verb=say&amp;text=One-line+summary%3A+Customer+called+to+inquire+about+checking+the+latest+window+pipe+information+but+did+not+complete+their+request.">+442xxx99</Number></Dial></Response>](https://api.vapi.ai/twilio/twiml?verb=say&amp;text=One-line+summary%3A+Customer+called+to+inquire+about+checking+the+latest+window+pipe+information+but+did+not+complete+their+request.\">+442035826399) šŸ”µ 03:33:38:287 Live Call Manager Ending...(assistant-forwarded-call) I do see the call has been forwarded here. I am honest I couldn't understand what do you mean by like you couldn't make it like the shared example but I can see the destination and extension being passed. If you can re-phrase your last message it will be really helpful for me to help you further. I was out of office for a couple of days, so that's why your response to your ticket has been delayed.