# Detecting dropped call

**URL:** <https://community.sendbird.com/t/detecting-dropped-call/1709>\
**Category:** JavaScript\
**Tags:** sendbird-call\
**Created:** [February 16, 2021, 6:44pm UTC](https://community.sendbird.com/t/detecting-dropped-call/1709 "2021-02-16T18:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccarithe1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ccarithe1/32/394_2.png) [@ccarithe1](https://community.sendbird.com/u/ccarithe1)\
**Post date:** [February 16, 2021, 6:44pm UTC](https://community.sendbird.com/t/detecting-dropped-call/1709/1 "2021-02-16T18:44:15Z")

</div>

What method should I take to detect a dropped call? ie: User X calls user Y, user Y answers. Then user Y refreshes their browser, or closes browser all together. Is there a reconnection handler I could access somewhere to timeout the call & cleanup user X’s UI (close modal, etc etc)?

Thanks

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [February 16, 2021, 8:36pm UTC](https://community.sendbird.com/t/detecting-dropped-call/1709/2 "2021-02-16T20:36:43Z")

</div>

@ccarithe1,

The best bet would be to utilize the `onReconnecting()` [event handler](https://sendbird.com/docs/calls/v1/javascript/guides/key-functions#2-add-event-handlers).

With that you could implement some logic client side to timeout the connection after sitting in the reconnected state for a certain period of time.

-Tyler

---

<div class="post-metadata">

**Author:** ![ccarithe1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ccarithe1/32/394_2.png) [@ccarithe1](https://community.sendbird.com/u/ccarithe1)\
**Post date:** [February 17, 2021, 9:38pm UTC](https://community.sendbird.com/t/detecting-dropped-call/1709/3 "2021-02-17T21:38:22Z")

</div>

Ok thanks @Tyler, the call to that handler seems a bit random but I’ll try to figure something out. I’ve got a follow up question. I’m using sendbird-calls sdk v1.5.1, and after making the call camera/microphone is still being used, even after calling `call.end()`. Both hardware camera indicator and browsers software are active. Tested both on Firefox and Chrome. Should anything besides .end() be called on the call object to stop video/audio?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [February 17, 2021, 9:42pm UTC](https://community.sendbird.com/t/detecting-dropped-call/1709/4 "2021-02-17T21:42:32Z")

</div>

If you’re calling the `useMedia()` method, but are not disposing of it, you’d see similar behavior.

So if you’re doing something like

```javascript
let media = SendBirdCall.useMedia({ audio: true, video: false });

```

You’d need to ensure you call

```javascript
media.dispose();

```
