go-b2bua icon indicating copy to clipboard operation
go-b2bua copied to clipboard

b2bua_simple and rtpproxy

Open dekke046 opened this issue 1 year ago • 3 comments

Hi,

I am looking for a way to use b2bua_simple with rtpproxy, but that seems not to be possible? the b2bua_radius can use rtpproxy but is dependent of the radius client part which I dont want to use.

Is there any way to achieve this?

The goal is to use b2bua in combination with rtpproxy to forward/proxy both sip and rtp traffic for incoming calls to a sip and rtp media server behind b2bua and rtpproxy.

Any thoughts?

dekke046 avatar Sep 06 '23 14:09 dekke046

@sobomax Is the above possible at all?

dekke046 avatar Sep 06 '23 15:09 dekke046

@dekke046 that should be pretty straightforward. All you need is to take rtpproxy code out of the radius version and extend accordingly. You are basically init one or several RtpProxyClient instances during start-up (based on how many proxies do you have), pass it down the call chain and then create a session in the call_controller. The actual hook-up to the call flow is then dead simple:

    if self.rtp_proxy_session != nil && oroute.rtpp {
        self.uaO.SetOnLocalSdpChange(self.rtp_proxy_session.OnCallerSdpChange)
        self.uaO.SetOnRemoteSdpChange(self.rtp_proxy_session.OnCalleeSdpChange)
        self.rtp_proxy_session.SetCallerRaddress(nh_address)
    }

Another way to go about it, is to start with radius version and then disable all features that you don't need (AAA).

sobomax avatar Oct 26 '23 22:10 sobomax

@dekke046 the whole idea behind having b2bua_simple is to have a barebone simple implementation, so that people can add their features on top of it. If you are curious how to setup b2bua_radius for not doing any auth you can also check our voiptests project here. https://github.com/sippy/voiptests/actions/runs/6661678068/job/18104892793#step:6:129. Perhaps the way to resolve that issue would be to rename b2bua_radius into just "b2bua", so that people don't get the wrong idea?

sobomax avatar Oct 27 '23 19:10 sobomax