[Serusers] Mediaproxy / Rtpproxy Video Quality

Kiko Vives kiko.vives at ua.es
Thu Nov 25 12:18:16 CET 2004


Yes, thats it !

The 'nathelper.c' I am using is one posted by Schweizer Laurent November the
10th. It compiles without problems, so...

My ser.cfg is below.

Kiko

check_via=no # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
listen=193.145.233.66

# Defino lo alias siguiente para identificar si la llamada va hacia dentro
# del dominio o ambas partes pertenecen al dominio.
alias="xxx.xxx.xxx.xxx"

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"

loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
loadmodule "/usr/local/lib/ser/modules/auth_radius.so"

# !! Nathelper
loadmodule "/usr/local/lib/ser/modules/nathelper.so"

# !! Mediaproxy
loadmodule "/usr/local/lib/ser/modules/domain.so"
#loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"


# ----------------- setting module-specific parameters ---------------

#Configuracion de la base de datos. De momento de tipo DBTEXT
modparam("usrloc|domain", "db_url", "sql://ser:heslo@localhost/ser")

# -- domain params --
modparam("domain","db_mode", 0) # No caching !!! Siempre desde BD

# -- usrloc params --
modparam("usrloc", "db_mode", 1)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
#modparam("auth_db", "password_column", "password")

modparam("auth_radius", "radius_config",
"/usr/local/etc/radiusclient/radiusclient.conf")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

#URI RADIUS
#modparam("uri_radius", "radius_config",
"/usr/local/etc/radiusclient/radiusclient.conf")

# Registrar
modparam("registrar", "nat_flag", 6)

# Mediaproxy !!!
# modparam("mediaproxy", "mediaproxy_socket",
"/usr/local/etc/ser/proxydispatcher.sock")
# modparam("mediaproxy", "sip_asymmetrics",
"/usr/local/etc/ser/sip-asymmetric-clients")
# modparam("mediaproxy", "rtp_asymmetrics",
"/usr/local/etc/ser/rtp-asymmetric-clients")
# modparam("mediaproxy", "natping_interval", 60)

# !! Nathelper
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "natping_interval", 30) # Ping interval 30 s
modparam("nathelper", "ping_nated_only", 1)   # Ping only clients behind NAT

# -------------------------  request routing logic -------------------

# main routing logic

route{

 if (!mf_process_maxfwd_header("10")) {
  sl_send_reply("483","Too Many Hops");
  break;
 };
 if (msg:len >=  max_len ) {
  sl_send_reply("513", "Message too big");
  break;
 };

        # !! Nathelper
 # Special handling for NATed clients; first, NAT test is
 # executed: it looks for via!=received and RFC1918 addresses
 # in Contact (may fail if line-folding is used); also,
 # the received test should, if completed, should check all
 # vias for rpesence of received
 if (nat_uac_test("3")) {
  # Allow RR-ed requests, as these may indicate that
  # a NAT-enabled proxy takes care of it; unless it is
  # a REGISTER

  if (method == "REGISTER" || ! search("^Record-Route:")) {
      log("LOG: Someone trying to register from private IP, rewriting\n");

      # This will work only for user agents that support symmetric
      # communication. We tested quite many of them and majority is
      # smart enough to be symmetric. In some phones it takes a
configuration
      # option. With Cisco 7960, it is called NAT_Enable=Yes, with kphone it
is
      # called "symmetric media" and "symmetric signalling".

      fix_nated_contact(); # Rewrite contact with source IP of signalling
      if (method == "INVITE") {
          fix_nated_sdp("1"); # Add direction=active to SDP
      };
      force_rport(); # Add rport parameter to topmost Via
      setflag(6);    # Mark as NATed
  };
 };

 # we record-route all messages -- to make sure that
 # subsequent messages will go through our proxy; that's
 # particularly good if upstream and downstream entities
 # use different transport protocol
 if (!method=="REGISTER") record_route();

 # subsequent messages withing a dialog should take the
 # path determined by record-routing
 if (loose_route()) {
  # mark routing logic in request
  append_hf("P-hint: rr-enforced\r\n");
  route(1);
  break;
 };

 if (!uri==myself) {
  # mark routing logic in request
  append_hf("P-hint: outbound\r\n");
  route(1);
  break;
 };

 # if the request is for other domain use UsrLoc
 # (in case, it does not work, use the following command
 # with proper names and addresses in it)
 if (uri==myself) {
  if (method=="REGISTER") {
   if (!radius_www_authorize("xxx.xxx.xxx")) {
    www_challenge("xxx.xxx.xxx", "1");
    break;
   };

   save("location");
   break;
  };

  lookup("aliases");
  if (!uri==myself) {
   append_hf("P-hint: outbound alias\r\n");
   route(1);
   break;
  };

  # native SIP destinations are handled using our USRLOC DB
  if (!lookup("location")) {
   sl_send_reply("404", "Not Found");
   break;
  };
 };
 append_hf("P-hint: usrloc applied\r\n");
 route(1);
}

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");
 #    break;
        #};

 # 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();
 };
}

# !! Nathelper
onreply_route[1] {
    # NATed transaction ?
    if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
        fix_nated_contact();
 force_rtp_proxy();
    # otherwise, is it a transaction behind a NAT and we did not
    # know at time of request processing ? (RFC1918 contacts)
    } else if (nat_uac_test("1")) {
        fix_nated_contact();
    };
}



----- Original Message -----
From: "Atle Samuelsen" <clona at camaro.no>
To: <LBE_SIP at telefonica.net>
Cc: <serusers at lists.iptel.org>
Sent: Thursday, November 25, 2004 9:59 AM
Subject: Re: [Serusers] Mediaproxy / Rtpproxy Video Quality


> There was a guy a couple of weeks ago that made a patch, seach the
> arcive for it.. (I currently didnt have it in my mailbox...)
>
> -atle
>
>
> * LBE_SIP at telefonica.net <LBE_SIP at telefonica.net> [041125 09:50]:
> > Kiko,
> >
> > rtpproxy with video support???. Where can I find that beast?. As far as
> > I know rtpproxy only supports audio (at least that is what we got).
> > Could you send me your config file, please?
> >
> > Thanks in advance, regards,
> > Luciano Bajo
> >
> > ----- Mensaje Original -----
> > De: "Kiko Vives" <kiko.vives at ua.es>
> > Fecha: Jueves, Noviembre 25, 2004 9:06 am
> > Asunto: [Serusers] Mediaproxy / Rtpproxy Video Quality
> >
> > > Hi all again.
> > >
> > > A few days before I wrote to the list asking if someone has a similar
> > > problem that the one I had. This problem was that when I start a
> > > videsession between 2 UAs using Mediaproxy, audio was perfect but
> > > video was
> > > horrible. Nobody tells me anything.
> > >
> > > After checking that there was not a problem of my network (drops or
> > > something like that in switches or routers), I decided to try
> > > Rtpproxy with
> > > video support instead of Mediaproxy. I don't know why but with
> > > rtpproxy,video goes PERFECT with exactly the same SER.CFG (using
> > > the correct options)
> > > that I used for Mediaproxy.
> > >
> > > So if someone find a similar problem... try it !
> > >
> > > Bye:
> > >
> > > Kiko
> > >
> > > _______________________________________________
> > > Serusers mailing list
> > > serusers at lists.iptel.org
> > > http://lists.iptel.org/mailman/listinfo/serusers
> > >
> >
> > _______________________________________________
> > Serusers mailing list
> > serusers at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
> >
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list