Giter Site home page Giter Site logo

Comments (11)

venkat-arvo avatar venkat-arvo commented on September 14, 2024

@alist I faced the same exact issue. In my case, I didn't have one of "stream" or "buffer" npm packages installed (I don't remember which one now). Adding them to the project resolved the issue.

from retell-client-js-sdk.

rj-rajpal avatar rj-rajpal commented on September 14, 2024

Hey I am facing the same issue, but I working with next. And I have both "buffer" and "stream" installed.

from retell-client-js-sdk.

weijia-yu avatar weijia-yu commented on September 14, 2024

Thanks for reporting the issue and we will take a look at the issue and get back to you soon!

from retell-client-js-sdk.

arthur-vonq avatar arthur-vonq commented on September 14, 2024

I am facing the same issue with next + [email protected]

from retell-client-js-sdk.

weijia-yu avatar weijia-yu commented on September 14, 2024

@arthur-vonq Was your issue solved by installing stream or buffer?

from retell-client-js-sdk.

arthur-vonq avatar arthur-vonq commented on September 14, 2024

unfortunatelly I tried installing those, but it did not work. take a look:

"node": "v20.11.0"
"next": "12.3.4"
"react": "^18.2.0"
"react-dom": "^18.2.0"
"retell-client-js-sdk": "^1.3.3"
"buffer": "^6.0.3"
"stream": "^0.0.2"

from retell-client-js-sdk.

arthur-vonq avatar arthur-vonq commented on September 14, 2024

@rj-rajpal Have you managed to make it work? I have the same situation as you

from retell-client-js-sdk.

ayush-saha-56 avatar ayush-saha-56 commented on September 14, 2024

retellInstance.stopConversation(); doesn't work.

const getCallInitDetails = () => {
    return bot9API
      .post(`/api/retell/start-call`, { agent_id: AGENT_ID })
      .then((res) => res.data)
      .catch((err) => {
        console.error(err);
      });
  };

  const handleStartCall = (payload) => {
    setHasCallStarted(true);
    setCallStatus("Calling...");
    getCallInitDetails().then((data) => {
      setCallStatus("Ringing...");
      retellInstance
        .startConversation({
          callId: data.call_id,
          sampleRate: data.sample_rate,
          enableUpdate: true,
        })
        .then(() => {
          setCallStatus("Say hello");
        });
    });
  };

  const handleEndCall = () => {
    //   doesnt work
    retellInstance.stopConversation();
    setHasCallStarted(false);
    setCallStatus("");
  };

from retell-client-js-sdk.

arthur-vonq avatar arthur-vonq commented on September 14, 2024

@ayush-saha-56 where are you instantiating the Retell client?
I think you cannot instantiate it inside a react component otherwise it meses up with the life cycle.
That was the problem happening with me at least..

from retell-client-js-sdk.

ayush-saha-56 avatar ayush-saha-56 commented on September 14, 2024

Yes. I was instantiating the Retell client inside a component.

Instantiating it outside solves the end call case. It seems to be a lifecycle mess up that creates this issue.

from retell-client-js-sdk.

alist avatar alist commented on September 14, 2024

Yeah awesome find @arthur-vonq !!!! You saved us.

For everyone else, here is the solution!

'use client';
import { RetellWebClient } from 'retell-client-js-sdk';
const retellWebClient = new RetellWebClient();
export default function RetellCallMVC({
   await retellWebClient.startConversation(...);
   return <UserInterface/>;
})

with this sort of setup

    retellWebClient.stopConversation();

now works and also multiple calls are possible

from retell-client-js-sdk.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.