RTPProxy No Audio on Outbound Calls

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RTPProxy No Audio on Outbound Calls

Mark Farmer
Hello everyone, all help gratefully received, I've been slogging away at this for ages!

I have OpenSIPS 2.4.4 & RTPProxy behind 1:1 NAT's (different hosts).

RTPProxy runs so:
/usr/local/bin/rtpproxy -s unix:/var/run/rtpproxy/rtpproxy.sock -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -s udp:10.96.16.58 7722 -l 10.96.0.58 10.98.0.58 -A ext.ip.addr.ess 10.98.0.58 -d DBUG LOG_LOCAL0 -m 10000 -M 20000

OpenSIPS is sitting between my provider & an Asterisk server which has phones registered.

When I make calls 'Provider -> OpenSIPS/RTPProxy -> Asterisk -> Phone' all is good, 2 way audio.
But when the call flows in the opposite direction, I get no audio since SDP is the same as the 1st call.

How do I get it to reverse the rtpproxy_offer/answer flags?

These are the bits that handles it all:

route[RTPPROXY] {

        if (is_method("BYE|CANCEL")) {
                rtpproxy_unforce();
        }

        if (is_method("INVITE")) {
                rtpproxy_offer("corwfie");
        }
}

onreply_route[DROUTING] {

        if (is_method("BYE|CANCEL")) {
                sip_trace("tid","d");
                rtpproxy_unforce();
        }

        if ($rs=~"(2[0-9][0-9])") {
                rtpproxy_answer("corwfei");
        }
}



--
Mark Farmer
[hidden email]

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: RTPProxy No Audio on Outbound Calls

John Quick
Mark,

You can detect if the INVITE came from your Asterisk by testing the $si
pseudo-variable.
That will allow you to identify the direction of the call. I usually set a
flag for this purpose. For example:
If ($si == "my.ast.er.isk")
    setflag(DIR_OUT);

At the point where you engage the rtpproxy, you will then be able to reverse
the internal/external parameters for the function call depending on the
direction of the call

If (isflagset(DIR_OUT)) {
    rtpproxy_offer("corfei");
} else {
    rtpproxy_offer("corfie");
}

The same flag should still be valid in the onreply handler where you can do
something similar. [Not sure if I have ie/ei the right way round in my
example].

That said, I'm not sure this topology is a good one to be using.
I would generally try to avoid having the media proxy behind NAT and also
using it in bridging mode - it makes life too complicated.

P.S. Looks like you sorted out the problems with the call to do_routing().

John Quick
Smartvox Limited



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users