[asterisk-dev] asterisk's bridge

serva serva at yeah.net
Thu Nov 22 10:08:23 CST 2007

    I'm sorry, I have forgot to say the version of asterisk I pay attention to is 1.2.x. Not the 1.4.x one. I know that when I use 1.4.x,in ast_rtp_bridge() function, there are two differences p2p bridge,one is ture native bridge named bridge_native_loop(),in bridge_native_loop() function we also need ast_read() and ast_write(),I think this one is similar to ast_generic_bridge().The other p2p bridge is bridge_p2p_loop(),this one look like a single thread bridge, because if two same type channnels (eg. SIP channel) come into this bridge, will set voice rtp socket's fd to -1, and set a callback function, so the bridge will block by polling fd (except pipe fd),and callback function:p2p_rtp_callback() will be invoked by ast_io_wait in do_monitor function,then they can use only socket fd to send or recieve rtp.

So, I want to ask ,why not use a only one thread to do this thing instead of do_monitor, and make this thread in the core of asterisk, and make it deal with difference kinds of channel? I think this can enhance the concurrency of asterisk more better.  


From:Russell Bryant
Date:2007-11-22 23:13:27
Subject:Re: [asterisk-dev] asterisk's bridge

truename wrote:
> Hi, I found that if I set mixmonitor or spy options, that asteriosk will
> choose ast_generic_bridge() function in channel.c , but ast_rtp_bridge()
> in rtp.c can also deal with monitor and spy because monitor or spy is
> only doing in ast_read() and ast_write() function using
> queue_frame_to_spies(). So can anyone tell me , why asterisk
> choose  ast_generic_bridge() instead of ast_rtp_bridge() ?

Asterisk must be able to intercept every single audio frame.  In the case of an
RTP bridge, the audio may not be flowing through Asterisk anymore.

Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.

--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:

More information about the asterisk-dev mailing list