peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

How to disconnect call before user accept

Open akilah007 opened this issue 10 years ago • 15 comments

Call not disconnecting from user end after disconnect call. It's shows ringing. Can answer the call also. How to disconnect call before user accept.

akilah007 avatar Feb 12 '16 13:02 akilah007

You can close media connection using call.close();. Here is reference.

dlinx avatar Feb 25 '16 08:02 dlinx

I have the same question. call.close() doesn't work if you don't do call.anwser() first...

BernardoMG avatar Jun 10 '17 11:06 BernardoMG

I'm experiencing the same problem as @BernardoMG . Works fine if call.close() is called after call.answer(), but not if you call call.close() before call is answered.

andreassh avatar Jul 14 '17 10:07 andreassh

@akilah007 @BernardoMG @andreassh Anyone of you guys found any work around here?

capripio avatar Aug 11 '18 08:08 capripio

This was discussed in another issue, the problem here is that when you call someone, you give them the "right" to establish the call with you, so while he doesn't answer, there is no call to close, but he still has the "right" to call you. In this case I think destroying the peer will work, but there is no way of closing anything because the call is not still created.

kidandcat avatar Aug 11 '18 14:08 kidandcat

Even though the peer is destroyed on the caller side, the callee still won't be able to be notified of the end of the calling.

moztemur avatar Sep 08 '18 20:09 moztemur

Well. the only workaround I've found was to create a data channel between the peers and send an finish object that finishes the call on the other end

allanplima avatar Oct 15 '18 20:10 allanplima

we can add 'decline' method, which send back decline message to callee via signaling.

afrokick avatar Mar 29 '19 07:03 afrokick

Well, for the disconnecting problem, we could set some kind of heartbeat using DataChannel (or with PeerServer between)

kidandcat avatar Mar 29 '19 08:03 kidandcat

well, this is not the best solution but i use web sockets to relay different states and synchronize between caller and receiver. so if caller hangs up before the receiver picks up, i revert to the "before call was initiated" state on the callers side and use the web socket to relay that the call was disconnected to the receiver side so the receiver can also go back to the "before call was initiated" state. but note: the peer connection is not disconnected because call.close() doesnt work without the call being answered. so this is essentially a work around to make the UI feel like the call ended but actually the "call" is just hanging in limbo

obelixotic avatar Nov 02 '19 18:11 obelixotic

You can close media connection using call.close();. Here is reference.

Broken link

bilo1967 avatar Apr 16 '20 11:04 bilo1967

Any chance this decline/reject new feature will be implemented soon?

bilo1967 avatar Apr 16 '20 11:04 bilo1967

Really could do with a decline method

MatthewPringle avatar Apr 30 '20 21:04 MatthewPringle

Same. Decline method would be really appreciated.

ergilaze avatar May 03 '20 00:05 ergilaze

Still waiting for this feature. :/

marcjulianfleck avatar Sep 10 '21 13:09 marcjulianfleck