Inquiry on Implementing Warm Transfer Functionalit...
# support
c
Hi Vapi Support Team, I hope this message finds you well. I am currently using the following code to create transfercall tool to transfer calls: { "type": "transferCall", "destinations": [ { "type": "number", "number": "+12092316035", "message": "I am forwarding your call. Please stay on the line." } ], "function": { "name": "transferCall", "description": "Use this function to transfer the call to the specified destination.", "parameters": { "type": "object", "properties": { "destination": { "type": "string", "enum": [ "+12092316035" ], "description": "The destination to transfer the call to." } }, "required": [ "destination" ] } }, "messages": [ { "type": "request-start", "content": "I am forwarding your call. Please stay on the line." } ] } This code works great for forwarding calls, but I am looking to add the warm transfer functionality. Specifically, I want to add a feature where a message is sent to the receiving agent before the call is transferred. For example, a message like: "Hi, we have customer [First Name] and they pay $[Monthly Bill] a month. Can you provide them more info?" Can you please guide me on how to integrate the warm transfer feature into my existing code? Based on your documentation, I understand there are different modes like "warm-transfer-with-summary" or "warm-transfer-with-message." Could you help me understand how to implement this functionality, and if possible, provide an example that would fit seamlessly with my current setup? I would greatly appreciate your help!
v
message has been deleted
@Ch Adeel Hello, I'm glad to hear that your current setup for transferring calls is working well. To integrate the warm transfer functionality with a custom message for the receiving agent, you can modify your existing code to include the warm transfer mode and the message you want to convey. Here's an example of how you can adjust your code to include a warm transfer with a message:
Copy code
json
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+12092316035",
      "message": "Hi, we have customer [First Name] and they pay $[Monthly Bill] a month. Can you provide them more info?"
    }
  ],
  "mode": "warm-transfer-with-message",
  "messages": [
    {
      "type": "request-start",
      "content": "I am forwarding your call. Please stay on the line."
    },
    {
      "type": "agent-message",
      "content": "Hi, we have customer [First Name] and they pay $[Monthly Bill] a month. Can you provide them more info?"
    }
  ]
}
In this example, the
"mode": "warm-transfer-with-message"
line specifies that you want to use the warm transfer feature with a custom message. The
"agent-message"
type in the
messages
array is used to define the message that will be sent to the receiving agent before the call is transferred. Please replace
[First Name]
and
[Monthly Bill]
with the appropriate variables or static values you wish to convey to the receiving agent. If you need further assistance or have any more questions, feel free to reach out. We're here to help!
You can continue this conversation by mentioning me in the message.
c
Getting error
s
Hey @Ch Adeel check this and let me know if you have any questions.
Copy code
ts
{
  "type": "transferCall",
  "messages": [
    {
      "type": "request-start",
      "content": "I'll transfer you to someone who can help."
    }
  ],
  "destinations": [
    {
      "type": "number",
      "number": "+918936850777",
      "description": "Transfer the call",
      "transferPlan": {
        "mode": "warm-transfer-with-summary",
        "summaryPlan": {
          "enabled": true,
          "messages": [
            {
              "role": "system",
              "content": "Please provide a summary of the call."
            },
            {
              "role": "user",
              "content": "Here is the transcript:\n\n{{transcript}}\n\n"
            }
          ]
        }
      }
    }
  ]
}
@Ch Adeel you don't need to define
function
property
destinations
is enough, and transferPlan has to be part of destinations.
c
@Shubham Bajaj I want to add this message "Hi, we have customer [First Name] and they pay $[Monthly Bill] a month. Can you provide them more info?" our vapi agent will say this to our human agent
can you let me know where to put this message or I have to add this in agent's prompt?
s
Hey @Ch Adeel can you help me exactly where you want to use this as firstMessage, during the call, in call analysis?
If first message then in firstMessage If during the call in systemPrompt if in call analysis then in the analysisPlan [corrected] Hi, we have customer {{firstName}} and they pay ${{monthlyBill}} a month. Can you provide them more info?
Here $ is add because you have added it to.
c
I want to use it during the call transfer so the first message which our agent will say will be "hold on the line while I'm transferring your call" and when the call is transferred I want the ai agent to say this message "Hi we have a customer..." So I'm not sure where to add this message
@Shubham Bajaj so I have to add this into summary plan?
s
Hey @Ch Adeel yes you can use it will transferPlan and it will work.
DO let me know how it goes.
c
If you don't mind can you add this message in above code and provide it to me I don't know how to troubleshoot the code
@Shubham Bajaj I tried by myself but was not able to make it working so if you can provide me the code by adding the message to the correct place then I'll be very thankful to you
s
Hey @Ch Adeel try using this:
Copy code
json
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+12092316035",
      "transferPlan": {
        "mode": "warm-transfer-say-message",
        "message": "Hi, we have customer {{firstName}} and they pay ${{monthlyBill}} a month."
      }
    }
  ]
}
c
@Shubham Bajaj Thank you so much I'm will try this one and then let you know
@Shubham Bajaj I am getting an error. The tool has been created, but it shows the tool name as a united tool. I tried to edit the name from inside Vapi, but it does not save the tool name.
@Shubham Bajaj Can you please have a look at this?
s
Hey @Ch Adeel you cannot edit the tool name from dashboard now, instead delete the old tool and create a new tool with name of your choice.
Copy code
json
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+12092316035",
      "transferPlan": {
        "mode": "warm-transfer-say-message",
        "message": "Hi, we have customer {{firstName}} and they pay ${{monthlyBill}} a month."
      }
    }
  ],
  "function": {name: "<insert-tool-name-here>"}
}
TIP
Do not use tool call name
transferCall
c
Ok thanks let me try this one
@Shubham Bajaj Hello sir I created the tool again with the code which you provided but it is still doing the cold transfer instead of warm transfer
I've deleted all previous tools
s
hey @Ch Adeel can you share the recent call id?
c
@Shubham Bajaj Sure sir
3f4729d7-bf16-4564-a394-300afd1fb143
s
logs
🔵 17:26:29:559 Transferring Twilio Call...TwiML:+12092316035 Hey @Ch Adeel the message is being spoken out to the user as you can see in the logs, the variables are not replaced because you didn;t provded any assistant overrides. What you can do is try this mode:
warm-transfer-wait-for-operator-to-speak-first-and-then-say-message
@Ch Adeel do let me know how it goes.
c
Copy code
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+12092316035",
      "transferPlan": {
        "mode": "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message",
        "message": "Hi, we have customer {{firstName}} and they pay ${{monthlyBill}} a month."
      }
    }
  ],
  "function": {
    "name": "forwardCall",
    "description": "Use this function to transfer the call with a warm introduction to the specified destination."
  }
}
@Shubham Bajaj Can you look at the above code snippet is that correct?
And how can our vapi agent get the the variables from the script automatically or is there any way to map them?
s
c
Hey @Shubham Bajaj this is an outbound calling agent I am passing only the first name from make.com into the assistant but for the variable like {{current_bill}} I want it to get that from call transcript. How can I do that?
s
Hey can you give an example?
@Ch Adeel can i close this ticket, as your primary issue is resolved?
c
@Shubham Bajaj It is still not working sir I am not sure how to set assistant overrides
s
Have you read the doc?
c
Yes I read that but I'm not fimiliar with coding that's why unable to understand
Do I just need to create the transfer call tool with the latest code you've provided?
s
Can you join discord OH today for live vapi tech support?
c
When it will be live?
c
Hello, @Shubham Bajaj Thanks for your guidance I appreciate that. You can close this ticket now.
m
I’m facing a similar issue. I know how to set variables but the code I’m using seems to result in a disconnect. What did they share with you on this topic to fix?
s
@Shubham Bajaj could you support me with the same issue?
s
@Seygi please create a new #1211483291191083018 ticket and ping me over there.
7 Views