[OpenSER-Users] Issue calling use_media_proxy() at on_reply_route.

Dan-Cristian Bogos dan.bogos at gmail.com
Wed Aug 8 19:36:38 CEST 2007


Hi Sergio,

I share the same opinion with Andreas that your openser configuration
is not properly done and you are not handling properly in normal route
the requests for mediaproxy.

Please keep in mind if you are using some sample configurations for
mediaproxy written for earlier versions - since 1.2 the policy for nat
detection for registers (so destinations behind nat) has been changed
and now u must use bflag instead of normal ones.

Here is some sample config to give you some ideas about what u could do:
route {
  if (!search("^Contact:[ ]*\*") && nat_uac_test("23")) {
        append_hf("P-hint: Cannot find contact and client is behind nat\r\n");
        setbflag(6);
        fix_nated_register();
        force_rport();
        };
t_on_reply("1");

if (isbflagset(6) || isbflagset(7)) {
        if(!isbflagset(8)) {
                        # Set flag 8 for using mediaproxy in onreply
for the same sessions
                        setbflag(8);
                        use_media_proxy();
                        };

}

onreply_route[1] {

  if (status=~"(180)|(183)|2[0-9][0-9]") {

        if (isbflagset(8) && !search("^Content-Length:[ ]*0")) {
                append_hf("P-hint: ONREPLY: Content in, use media proxy\r\n");
                use_media_proxy();
                };

        if(client_nat_test("1")) {
                fix_contact();

                if (status=~"(183)|(200)") {
                        fix_nated_sdp("1");
                        };
                };

        };

  append_hf("P-hint: ONREPLY END. \r\n");

}

Hope this helps.

DanB


On 8/8/07, Andreas Granig <agranig at sipwise.com> wrote:
> modparam("usrloc", "nat_bflag", 6) # or any other free flag
> ...
> if(lookup("location")) {
>    if(isbflagset(6)) {
>      # use mediaproxy if not already done
>      # (make sure to not call it twice)
>
>    }
>    ...
> }
>
> Sergio Gutierrez wrote:
> >
> > Hi Andreas.
> >
> > Thanks for your answer. I that case, as you say, how should I setup the
> > configuration?
> >
> > After doing lookup("location"), how could I check nat-flag?
> >
> > Thanks a lot.
> > /
> > Sergio Armando Gutiérrez Betancur/
> > /S//ubdirección //A//plicaciones //de //S//ervicios //C//onvergentes//
> > EPM TUNE /
> > /Tel: 054 3802956/
> > /Email: sergio.gutierrez at une.com.co <mailto:sergio.gutierrez at une.com.co>/
> > /
> > /
> >
> >
> >
> > On 8/8/07, *Andreas Granig* <agranig at sipwise.com
> > <mailto:agranig at sipwise.com>> wrote:
> >
> >     Hi,
> >
> >     Maybe the request of this reply hasn't been passed to mediaproxy? If the
> >     callee is registered from behind NAT, you know that already in the
> >     request because the nat-flag should have been set during registration.
> >     So after lookup("location") the nat-flag should be set, and if so, you
> >     have to use_media_proxy() also for the request.
> >
> >     Andreas
> >
> >     Sergio Gutierrez wrote:
> >      > Hello all.
> >      >
> >      > We are facing some problems in our deployment of OpenSER, related
> >     to NAT
> >      > Traversal solution using MediaProxy.
> >      >
> >      > In our scenario, using the the sample configuration NAT detection
> >     works
> >      > right for REGISTER method, and for INVITE's sent from clients behind
> >      > NAT, but, incoming calls originated from transparent clients,
> >     directed
> >      > to clients behind NAT do not work, and do not pass through
> >     MediaProxy.
> >      > Services based on re-INVITES do not work either.
> >      >
> >      > To solve that issue, we tried to intercept the 200 OK answer
> >     coming from
> >      > NAT client, so that we could call use_media_proxy(), but, we get the
> >      > error: "Empty Response from media_proxy()"
> >      >
> >      > Our configuration is more or less like this:
> >      >
> >      > # In the beginning of the main route
> >      >
> >      > if(client_nat_test("7"))
> >      > {
> >      >    setflag(2);
> >      >    fix_contact();
> >      > };
> >      >
> >      > .....
> >      >
> >      > if(is_method("INVITE"))
> >      > {
> >      >     if(isflagset(2))
> >      >     {
> >      >         use_media_proxy();
> >      >     };
> >      >
> >      >     t_on_reply("1");
> >      >
> >      > }
> >      >
> >      > ....
> >      >
> >      > on_reply_route[1]
> >      > {
> >      >         if (status =~ "(18[0-3])|(2[0-9][0-9])|(1[0-9][0-9])")
> >      >         {
> >      >                 if (client_nat_test("3"))
> >      >                 {
> >      >                         fix_contact();
> >      >                         use_media_proxy();
> >      >                 }
> >      >
> >      >         }
> >      > }
> >      >
> >      >
> >      > That is a very brief configuration fragment, but it is more or
> >     less the
> >      > schema of configuration we are using. So far, our solution to be
> >     able to
> >      > have the whole services working is marking all the calls so that
> >     they
> >      > pass through the mediaproxy, but we are not sure if that is a good
> >      > solution.
> >      >
> >      > Thanks in advance for every hint or suggestion.
> >      >
> >      > Kind regards
> >      >
> >      > /Sergio Armando Gutiérrez Betancur/
> >      > /S//ubdirección //A//plicaciones //de //S//ervicios
> >     //C//onvergentes//
> >      > UNE - EPM Telecomunicaciones
> >      > / /Tel: 054 3802956/
> >      > /Email: saguti at gmail.com <mailto:saguti at gmail.com> <mailto:
> >     saguti at gmail.com <mailto:saguti at gmail.com>>/
> >      >
> >      >
> >      >
> >      >
> >      >
> >      >
> >     ------------------------------------------------------------------------
> >      >
> >      > _______________________________________________
> >      > Users mailing list
> >      > Users at openser.org <mailto:Users at openser.org>
> >      > http://openser.org/cgi-bin/mailman/listinfo/users
> >
> >
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list