[asterisk-dev] LI handling in asterisk

Joshua Colp jcolp at digium.com
Mon Aug 7 19:06:07 CDT 2017


On Fri, Aug 4, 2017, at 02:00 AM, Holger Freyther wrote:

<snip>

> 
> What is done by the customer right now:
> 
> There is an AMI command to register interest in a SIP Call-Id (the mime
> header value). If there is an active call with this id LI will be
> activated and if a call is incoming the id will be checked against
> pending requests.
> 
> For the actual LI part the RTP is wrapped in a small header including a
> sessionId (registered by the command), the direction (e.g. in, out, end,
> start), the peer ip and port followed by the rtp packet.
> 
> The actual leak implementation is done by modifying the rtp_engine
> interface like...
> 
> struct ast_rtp_engine {
> ...
> 	int (*leak_rtp)(int fd, const struct ast_sockaddr *sa);
> 
> and then modifying the asterisk rtp_engine to duplicate the payload
> before it is sent out and after it was received from a socket. It is
> triggered from within chan_sip/pjsip (but that would have to move
> somewhere else)
> 
> 
> 
> Hpw to move forward here? Could the framehooks be extended to include the
> on-wire received/sent messages as well? Could the ast_frame be extended
> to hold more information? Is the modification of the rtp_engine a first
> step (as this would allow to build a module like app_chanspy).

There's nothing really built in to do such a thing, and modifying the
RTP engine would be the easiest like you've mentioned above. Frames
passing through the core were never designed or written to include
protocol specific information like the RTP header itself, extending
frames to include this could be difficult - specifically ensuring
everything can handle it (or that it's done in such a way that it's
hidden). They'd also increase the size of frames, which is something
else to consider.

I've heard other people doing this outside of Asterisk instead, to avoid
having to do any modifications.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list