Twilio:第一次成功通话; 第二次和后续调用错误

An extension of this SO question: twilio-webrtc-client-breaks-if-user-always-allows-microphone-access

I'm having the same issue with error Error creating the answer: Failed to set local answer sdp: Called in wrong state: STATE_INPROGRESS.

Does anyone have a work around? For now, I'm reloading the page after successful calls. It worked but it's not good to reload the page every time.

It's a bug in the client at the moment; the workaround is that if you answer() the call in the incoming event handler, it doesn't happen. The problem is that you thus can't use Twilio's own incoming call handling (i.e. "ringing" the client) and have to implement your own instead, which may or may not be a problem for you.

We did it using a socket.io type effort, so the browser talked to our server side app over websockets and when the browser accepts the call, we direct the call to the client and the Twilio client auto-answers.