Resume call from last script adter Call Drop ans c...
# support
k
I want to know if there is a sudden call drop between user and vapi, I have aaded a function which retries to call the user back but the converstation starts from the begininng. Is there a way for Vapi agent to resume the call from last converstaion occured between him and the user. And continue from there
v
Yes, you can resume a Vapi call from where it left off after a call drop by saving and restoring the conversation state on your backend. Here's a high-level approach: 1. Save the conversation at the end of each call using the
end-of-call-report
event sent to your server (includes summary, transcript, etc.). 2. On reconnect, when you receive an
assistant-request
, look up the caller's previous conversation and respond with an assistant configuration that includes the last context (e.g., system prompt: "Here's where we left off: ..."). Example server logic:
Copy code
js
// Pseudocode for assistant-request handler
if (req.body.message?.type === "assistant-request") {
  const phone = req.body.call.from.phoneNumber;
  const lastSession = db.getConversation(phone);
  res.json({
    assistant: {
      ...,
      model: {
        ...,
        messages: [
          { role: "system", content: `Here's where we left off: ${lastSession.summary}` }
        ]
      }
    }
  });
}
See [Vapi inbound support example](https://docs.vapi.ai/examples/inbound-support) for more details. Sources: - [Vapi inbound support example](https://docs.vapi.ai/examples/inbound-support) - [Personalization with user information](https://docs.vapi.ai/assistants/personalization)
p
Hi KennyBenso4, Currently, Vapi does not support resuming a call conversation exactly from where it left off after a call drop. Once a call is dropped and re-initiated, the conversation starts anew. However, you might consider implementing a session management system outside of Vapi that tracks conversation state and can pass relevant details to the agent to help it contextually restart a conversation. For more intricate setups, you might explore logging conversational states externally and scripting the agent to intake this state at the beginning of a call, but this would require additional custom development around the agent's workflow. There is also this YouTube tutorial that shows how to manage previous conversations -->

k
@Vapi Support Bot I want it for outbound calling