[asterisk-users] Copying received and sent RTP packets due legal obligations

Holger Freyther holger at moiji-mobile.com
Wed Jul 12 16:30:15 CDT 2017


I am facing a problem where for legal obligations (LI) I have
to copy/mirror/forward the RTP streams for some selected call
to an external address/port and I have not found a way to do
it with built-in functionality. Do I miss something?

The basic requirements are:

	* Raw RTP (no transcoding, header and payload as is)
	* Direction (did it arrive at asterisk or was it sent)
	* End indication once the call has been cleared

I tried to use app_chanspy and ran into three different problems:

	- It is always transcoding
	- No support for input only on the audiohooks used
	by app_chanspy (send input, output to two different
	dest ports)
	- End of call only through hangup

A post mentioned the framehooks but from what I see:

	- It is the audio payload but not the RTP header
	- I considered to rebuild the RTP header but:
	ast_rtp_instance can't give me the rx SSRC, rx SQNO,... 

Currently we are extending ast_rtp_instance to have a mirror_audio
function pointer with dest ip/dest port and a custom protocol to send
the rtp frames. And we have extended ast_channel_tech to add a
start_mirror function pointer and have implemented it for chan_sip
and chan_pjsip. They find the ast_rtp_instance and then call the
mirror_audio method on it. Finally there is an AMI handler to initiate
the mirroring for a given Call-Id on the right ast_channel.

We would like to avoid modifying asterisk and wonder how we could
move forward? Is there any hope to get our modifications included?
Could there be a framehook for the rtp frame (with remote peer info)?
Extend ast_rtp_instance to export more info about the RX info? Anything

looking forward for feedback and hints


More information about the asterisk-users mailing list