[Serusers] Dest IP

Sebastian Kühner skuehner at veraza.com
Thu Jul 28 20:26:48 CEST 2005


Hi,

I tried it with the following parameters:


# ------------- avp parameters
modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser")
modparam("avpops", "avp_table", "location")
modparam("avpops", "username_column", "username")
modparam("avpops", "domain_column", "domain")
modparam("avpops", "value_column", "contact")

and then

# Force rtpproxy for users that are behind a Port Restricted Cone NAT
if ((src_ip == xxx.xxx.xxx.xxx |
avp_check("contact","re/sip:.*@xxx.xxx.xxx.xxx/g")) &&
!(uri=~"sip:[0-9]{7,30}@.*")) {
    fix_nated_contact(); # Rewrite contact with source IP of signalling
    force_rport(); # Add rport parameter to topmost Via
    setflag(6);
    log(1, "Call with proxy...\n");
}

I didn't find many examples of avp_check :-(

Thanks

Sebastian



----- Original Message ----- 
From: "Klaus Darilion" <klaus.mailinglists at pernau.at>
To: "Sebastian Kühner" <skuehner at veraza.com>
Cc: <serusers at lists.iptel.org>
Sent: Thursday, July 28, 2005 1:03 PM
Subject: Re: [Serusers] Dest IP


> If I understand your problem correctly you want this IP address?
>
> user ----> ser -----> user
>                     ^^^^
>                     dst_ip
>
> Just an idea: you may try to write the the ruri/domain into an AVP using
> avpops (after lookup("location")). Then try using avp_check, and report
> if this works :-)
>
> regards,
> klaus
>
>
> Sebastian Kühner wrote:
> > Hello,
> >
> > I need the destination IP of the user of the first INVITE message
(user ->
> > ser)... but dst_ip == xxx.xxx.xxx.xxx gives me the IP of ser.
> >
> > The problem is that I only want to force the rtp_proxy if the users are
> > behind a Port restricted cone NAT (the scr-ips of them are known)
> >
> > Here is my code:
> >
> > # Force rtpproxy for users that are behind a Port Restricted Cone NAT
> > if ((src_ip == xxx.xxx.xxx.xxx | dst_ip == xxx.xxx.xxx.xxx) &&
> > !(uri=~"sip:[0-9]{9,30}@.*")) {
> >     fix_nated_contact(); # Rewrite contact with source IP of signalling
> >     force_rport(); # Add rport parameter to topmost Via
> >     setflag(6);
> > }
> >
> > Has anyone an idea how I can get the IP of the user? For example in the
> > location database?
> >
> > Thanks!
> >
> > Sebastian
> >
> >
> > _______________________________________________
> > Serusers mailing list
> > serusers at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
> >
> >
>
>
>





More information about the sr-users mailing list