[asterisk-dev] RTP Bridging optimization

Vadim Lebedev vadim at mbdsys.com
Sun May 13 15:43:13 MST 2007



Tilghman Lesher wrote:

>On Sunday 13 May 2007, Kevin P. Fleming wrote:
>  
>
>>Vadim Lebedev wrote:
>>    
>>
>>>I beleive you are mistaken,  the pipe syscals creates 2 file
>>>descirptors, one for reading other for writing....
>>>so in worst case you need 2 pipes meaning 4 fds
>>>so first you splice to a write side of first pipe from a socket, then
>>>optioanlly in case of montiored stream
>>>tee form read side of the first pipe to the write side of the second
>>>pipe, then splice from write side of the first pipe to the target socket,
>>>then read from the read side of the second pipe
>>>to perfrom monitoring
>>>      
>>>
>>You just validated my point. A single bridge connecting two sockets
>>requires two pipes, one for each direction between the sockets. This
>>turns the '2 fds required' for a bridge into _6_ fds.
>>
>>In addition, this only works in the cases where the media streams are
>>completely compatible, including dynamic RTP format number assignments,
>>frame lengths and other variables.
>>    
>>
>
>Josh also brought up a valid point on IRC.  How exactly are we to direct
>packets to the destination IP address?  Keep in mind that RTP is UDP
>and thus there is no specific destination with respect to the socket.  If this
>were TCP, it would work fine, but with UDP, there is no connection.
>
>  
>
Actually you can use 'connect' syscall on udp socket, and then 'write', 
and 'send' syscalls will use destination address
used in connect. I magin the 'splice' and 'tee' will behave same way

Thanks
Vadim




More information about the asterisk-dev mailing list