[Serusers] force_rtp_proxy() in some cases only

PREVOT Paul prevot at enseirb.fr
Tue Apr 25 15:04:40 CEST 2006


If you are interested, I have fixed my problem.

In fact, it seems to be impossible to use force_rtp_proxy() with 

rewritehostport("xxx.xxx.xxx.xxx:5060");
forward(uri:host, uri:port);

The solution I found is to use 

rewritehostport("xxx.xxx.xxx.xxx:5060");
route(1);

with the default route(1) instead of forward().


route[1]
{
        # !! Nathelper
        if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){
            sl_send_reply("479", "We don't forward to private IP
addresses");
            return;
        };

        # if client or server know to be behind a NAT, enable relay
        if (isflagset(6)){
            force_rtp_proxy();
        };

        # NAT processing of replies; apply to all transactions (for example,
        # re-INVITEs from public to private UA are hard to identify as
        # NATed at the moment of request processing); look at replies
        t_on_reply("1");

        # send it out now; use stateful forwarding as it works reliably
        # even for UDP2TCP
        if (!t_relay()) {
                sl_reply_error();
        };
}

-----Message d'origine-----
De : serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] De la
part de prevot at enseirb.fr
Envoyé : vendredi 21 avril 2006 15:50
À : serusers at lists.iptel.org
Objet : [Serusers] force_rtp_proxy() in some cases only


Hi all,

I’d like to use RTP relay as less as possible and I know that only a few
users
of my network need it.
When those clients make a INVITE, I use force_rtp_proxy().

But how can I know if an OK received by OpenSER needs force_rtp_proxy() or
not?
Is it a way to check for OK if a flag has been set during INVITE?


Thanks a lot,
Paul



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
Serusers mailing list
serusers at lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list