transferCall with extension
# support
m
We're working on a voice assistant that, in some cases, should do a call transfer to a destination number with extension. There is some way to add an extension to a transfer destination?
v
@moidesko Yes, you can add an extension to a transfer destination by using the
PhoneNumberTransferDestination
option. When you specify a phone number as the transfer destination, you can include the extension as part of the phone number string. The format typically involves appending the extension to the main number, often separated by a pause or a special character that indicates an extension, such as a comma (,) or a semicolon (;). For example, if the main number is
+1234567890
and the extension is
123
, you might format the transfer destination as
+1234567890,123
. The exact format can depend on the system you are interfacing with, so you should ensure that the format you use is compatible with the voice API and the telephony system you are transferring the call to. Would you like to proceed with setting up a call transfer with an extension? If so, please provide the destination number and the extension, and I can assist you further.
You can continue this conversation by mentioning me in the message.
m
Where do I set the PhoneNumberTransferDestination option?
For example: if the transfer destination is +16065554433 with extension 123, adding +16065554433;123 to the destination parameter in the transferCall tool, will do the work? @User
j
Where do I set the PhoneNumberTransferDestination option? For example: if the transfer destination is +16065554433 with extension 123, adding +16065554433;123 to the destination parameter in the transferCall tool, will do the work?
v
@JRDabrio To set the
PhoneNumberTransferDestination
option, you would typically include it in the parameters when you call the
transferCall
tool. The
PhoneNumberTransferDestination
should be an object that includes the phone number with the extension formatted correctly. In your example, if you want to transfer a call to +16065554433 with extension 123, you would format it as
+16065554433;123
or
+16065554433,123
depending on the system's requirements for handling extensions. The semicolon (
;
) or comma (
,
) is often used to indicate a pause before dialing the extension. Here's how you might set it up:
Copy code
json
{
  "destinations": [
    {
      "type": "PhoneNumberTransferDestination",
      "number": "+16065554433;123"
    }
  ]
}
This JSON object would be passed as a parameter to the
transferCall
tool. If you're ready to proceed with the transfer, please confirm the destination number and extension, and I can help you with the next steps.
m
Phone number +16065554433 extension 5900
v
@moidesko Great, to transfer a call to the phone number +16065554433 with the extension 5900, you would format the destination parameter by appending the extension to the phone number, typically with a pause before the extension. The pause can be represented by a comma (
,
) which usually equates to a 2-second pause on most phone systems. The formatted phone number with the extension would look like this:
+16065554433,5900
. If you're ready to proceed with the call transfer, you can use this formatted string as the destination in your voice API's call transfer function. If you need assistance with the specific API call or have any other questions, please let me know!
i
Also wondering about this as well
How do extensions work call transfers because I don't see a specific extension field
@User
m
The PhoneNumberTransferDestination type doesn't seem to work. When adding it and doing a call, an error "couldn't get assistant" is thrown.
v
@moidesko It seems there might be a misunderstanding regarding the use of
PhoneNumberTransferDestination
. The error "couldn't get assistant" suggests that the system is expecting an assistant-based transfer rather than a phone number transfer. To clarify, the
PhoneNumberTransferDestination
should be used when you want to transfer a call to an external phone number. If the system is throwing an error related to an assistant, it might be because it's expecting a different type of destination, such as
SipTransferDestination
or an internal assistant transfer. Please ensure that you are using the correct type of transfer destination for your use case. If you are trying to transfer to an external phone number with an extension, you should use the
PhoneNumberTransferDestination
type and format the number with the extension correctly, as previously described. If you continue to experience issues, it might be necessary to consult the documentation for the specific voice API you are using or reach out to their support team for assistance. If there's anything else I can help you with, please let me know!
m
It doesn't seem to work. The PhoneNumberTransferDestintation is nor recognized. If I set the destinations objects with phoneNumber type, it ignores the extension after the comma (or semicolon). @User
s
@moidesko We are currently having an office hour, can you please join it? We will help you directly. https://discord.gg/WPQuUJkF?event=1290804148354416710
s
@moidesko just checking in, is this resolved?
m
No, it's not resolved. There is no entry in the docs for transferring calls to numbers with extension (e.g. 6065554433;5900). Also, if I add the number to the assistant json like: destinations: [{ 'type': 'phoneNumber', 'number': '6065554433;5900', 'message': '', }] In the vapi log for the call, it appears that the number gets cropped to '6065554433', without the extension. I've tried to put in the 'number' type and does the same. With 'string' and 'PhoneNumberTransferDestination' a vapi "could't get assistant" error is thrown when recreating the assistant at the start of the call.
Got this from Nikhil, use the destinations.extension when you create a transfer call tool
s
@moidesko / @Ibrahim I hope it is resolved now.
i
Yes thank you
m
Solved!
Thanks!
4 Views