Re: [asterisk-dev] RTP Bridging optimization

2007-05-13 Thread Vadim Lebedev



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


___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] RTP Bridging optimization

2007-05-13 Thread Kevin P. Fleming
Vadim Lebedev wrote:

 You're right but  only in  the case that when you have separtae briding
 threads for each direction.
 I was thinkin about situation when there is ONE briging theard for two
 directions. The you can you the same pipe
 for both direction.

No, you cannot. How are you going to distinguish packets that belong to
the A-B direction from the ones that belong to the B-A direction if
both of them are being written to the 'write' end of the same pipe?

Instead of just proposing this idea without fully understanding how it
would work (here on the developer mailing list), it would be much better
if you wrote a small program demonstrating the technique and proving
that it is possible. Otherwise this is all just speculation and people
disagreeing about what may or may not work.

Certainly it is not at all possible to create a single pipe and using it
for both directions of multiple bridges... I don't know how you came to
the conclusion that could work at all.
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] sipsock_read: Failed to grab lock, trying again...

2007-05-13 Thread Olle E Johansson


13 maj 2007 kl. 21.52 skrev Nour Omar:


Hello all,
I was working on asterisk 1.2(latest) doing some tests before  
deployments when I saw the debug statement in the subject. I  
decided to look into it further and what causing it. I found out it  
was caused by slow cdr backend. To make sure this is the case, I  
changed the sql in cdr_addon_mysql.c to make it stored procedure. I  
called it InsertCDR. Inside this stored proc. I slow down the  
query using  mysql BENCHMARK() functions ( example: DECLARE result  
int; SELECT BENCHMARK(1,ENCODE('hello','goodbye')) into result; )




Enable CDR batching in cdr.conf if you have such a slow backend.

/O
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev