ericgla / RTC-Call-Monitor

Voice/video call detection by monitoring of UDP packet rate with notification via webhooks
37 stars 6 forks source link

Webhook Buffer #3

Closed mbaran5 closed 3 years ago

mbaran5 commented 3 years ago

Is there away to adjust the time a call needs to setup before toggling subsequent webhooks? It looks like a sample teams call will start and stop while setting up the call triggering multiple webhooks and subsequent automations.

<6>RtcCallMonitor.Worker[0] call started for msteams on 52.114.159.99 count 2
<6>RtcCallMonitor.Worker[0] call ended, time 1 seconds
<6>RtcCallMonitor.Worker[0] call started for msteams on 52.114.132.63 count 3
<6>RtcCallMonitor.Worker[0] call ended, time 3 seconds
<6>RtcCallMonitor.Worker[0] call started for msteams on 52.114.132.63 count 8
<6>RtcCallMonitor.Worker[0] call ended, time 2 seconds
mbaran5 commented 3 years ago

Here's an example of a discord call

image

ericgla commented 3 years ago

I've noticed this issue as well and haven't got around to fixing it yet. The issue is that I'm checking for UDP packets from a known IP range every second. When no one is in a call, certain providers send minimal UDP traffic, triggering the call start/stop behavior you are seeing.

If you are building from source, simply increase the wait time in Worker.cs line 41 from 1000 (1 second) to something longer so that you will see at least one UDP packet per check interval. I'll be pushing an update tomorrow that will have configuration keys to allow you to adjust the interval and min packet rate.

mbaran5 commented 3 years ago

The source version appears to work better than the released 1.0.0. It includes a DelayMs variable, which worker.cs line 41 references and I just have set it to 2000ms.

ericgla commented 3 years ago

v1.0.1 has been released which renames the DelayMs config key to CheckInterval, and also adds an optional key for minimum packet rate.

mbaran5 commented 3 years ago

thank you!