voiceip / oreka

OpenSource G711, G722, G729, Opus & Other Format VoIP SIP Recorder
GNU General Public License v3.0
145 stars 76 forks source link

how to config ignore early media recording #123

Closed wangduanduan closed 1 year ago

wangduanduan commented 1 year ago

I want to only record calls which are established, not include early media, can it be config ?

kingster commented 1 year ago

Hi @wangduanduan

Afaik there is no direct way to understand what is early media in a passive recording mode (since early media changes can happen multiple time during a call), hence its currently not possible to exclude early media, however you can set TapeDurationMinimumSec to compensate for this, so that very small recordings which would be only ringing.

Does this help your use-case?

wangduanduan commented 1 year ago

I know that orkea will track SIP message, so i think maybe orkea can start record after receive 200 Ok of INVITE.

A ---INVITE---B
A <---183-----B
A <----RTP----B
A <---200 Ok ---B  #start recording here

the early media is useless in tape, and will cost a lost of disk。the time length of early media is not fixed, so TapeDurationMinimumSec will not work.

but thanks you any way. @kingster

kingster commented 1 year ago

@wangduanduan There are few scenarios where there is only media and no SIP (eg: app started when call is already in progress or h.232 calls).

Though that said we haven't observed large amount of disk utilisation since tapes stored in compressed format is very small in size (few kbs).

If you still think removing early media would help you, maybe you can raise a PR with the changes.