Feature request - pseudo-variable for destination IP address

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

Feature request - pseudo-variable for destination IP address

Robert Dyck
I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.

The motivation.

I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.

Thank you for having a look.
Rob

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

Re: Feature request - pseudo-variable for destination IP address

Ovidiu Sas
Check out the $Ri pvar:
https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78

-ovidiu

On Thu, Jun 27, 2019 at 6:23 PM [hidden email] <[hidden email]> wrote:

>
> I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.
>
> The motivation.
>
> I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.
>
> Thank you for having a look.
> Rob
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
VoIP Embedded, Inc.
http://www.voipembedded.com

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

Re: Feature request - pseudo-variable for destination IP address

Robert Dyck
In reply to this post by Robert Dyck
On second thought it probably isn't poosible to do in any direct way because the information is lost in the router. The only possible way is a DNS query.

----- Original Message -----
From: "rob dyck" <[hidden email]>
To: [hidden email]
Sent: Thursday, June 27, 2019 3:21:59 PM
Subject: Feature request - pseudo-variable for destination IP address

I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.

The motivation.

I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.

Thank you for having a look.
Rob

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

Re: Feature request - pseudo-variable for destination IP address

Robert Dyck
In reply to this post by Ovidiu Sas
Unfortunately the address of the interface where the request was receeived is private. I am using 1 to 1 NAT.

----- Original Message -----
From: "Ovidiu Sas" <[hidden email]>
To: "OpenSIPS users mailling list" <[hidden email]>
Sent: Thursday, June 27, 2019 3:31:34 PM
Subject: Re: [OpenSIPS-Users] Feature request - pseudo-variable for destination IP address

Check out the $Ri pvar:
https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78

-ovidiu

On Thu, Jun 27, 2019 at 6:23 PM [hidden email] <[hidden email]> wrote:

>
> I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.
>
> The motivation.
>
> I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.
>
> Thank you for having a look.
> Rob
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
VoIP Embedded, Inc.
http://www.voipembedded.com

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

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

Re: Feature request - pseudo-variable for destination IP address

Ben Newlin
In reply to this post by Robert Dyck
As far as I know, the equivalent variable to $si on the destination side is either $dd, which may not always be set, or $rd. Those are not guaranteed to be IP addresses, however. If DNS is being used, I don't believe OpenSIPS provides the results of the DNS lookup to the script in any variable, so I don't think there is a way to find the actual IP aside from doing your own DNS lookup (or possibly using the dns_cache module and snooping the cache, but I have had issues with this module in the past.)

Ben Newlin

On 6/28/19, 10:16 AM, "Users on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:

    Unfortunately the address of the interface where the request was receeived is private. I am using 1 to 1 NAT.
   
    ----- Original Message -----
    From: "Ovidiu Sas" <[hidden email]>
    To: "OpenSIPS users mailling list" <[hidden email]>
    Sent: Thursday, June 27, 2019 3:31:34 PM
    Subject: Re: [OpenSIPS-Users] Feature request - pseudo-variable for destination IP address
   
    Check out the $Ri pvar:
    https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78
   
    -ovidiu
   
    On Thu, Jun 27, 2019 at 6:23 PM [hidden email] <[hidden email]> wrote:
    >
    > I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.
    >
    > The motivation.
    >
    > I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.
    >
    > Thank you for having a look.
    > Rob
    >
    > _______________________________________________
    > Users mailing list
    > [hidden email]
    > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
   
   
   
    --
    VoIP Embedded, Inc.
    http://www.voipembedded.com
   
    _______________________________________________
    Users mailing list
    [hidden email]
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users
   
    _______________________________________________
    Users mailing list
    [hidden email]
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users
   
   

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

Re: Feature request - pseudo-variable for destination IP address

Robert Dyck
In reply to this post by Robert Dyck
Thank you Yuri Ritvin <[hidden email]>

{ip.resolve} transform works for me. The example given in the documentation is
misleading. You can't use a literal string. You need to put into a var of some
sort and then transform it.

On Thursday, June 27, 2019 3:35:37 P.M. PDT [hidden email] wrote:

> On second thought it probably isn't poosible to do in any direct way because
> the information is lost in the router. The only possible way is a DNS
> query.
>
> ----- Original Message -----
> From: "rob dyck" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, June 27, 2019 3:21:59 PM
> Subject: Feature request - pseudo-variable for destination IP address
>
> I was looking for something similar to the $si PV but for the destination IP
> address. Either it doesn't exist or I am blind. I can't find things in the
> refrigerator either.
>
> The motivation.
>
> I have a working instance of Opensips with a basic residential
> configuration. I extended it to allow calling UAs on the LAN from the
> outside. It is a typical residential LAN without a fixed IP address.
> Dynamic DNS is working for me. I read the tutorial about Opensips behind
> NAT. Following the recommendations there I was able to setup rtpproxy, the
> advertised address and an alias for my Opensips. Initial testing using a
> softphone on a laptop using either WiFi or a mobile phone tethered to the
> laptop worked well. However it seems that some UAs will not accept a domain
> name in the SDP connection. The UAs that failed could be made to work by
> coding in an IP address. This is not a satisfactory solution because the
> router's address may chaange. There is probably some convoluted way to
> import the needed address into the script.  A pseudo-variable representing
> the destination IP address of the received INVITE or 200 OK could then be
> passed as the advertised address to the rtpproxy module.
>
> Thank you for having a look.
> Rob
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users





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

Re: Feature request - pseudo-variable for destination IP address

Vitalii Aleksandrov
In reply to this post by Ben Newlin
Hi,

Original question was about different thing but the destination IP of a
request or reply is not hard to get. I wrote a small module which
extracts the destination uri from ru (du) for requests and from via for
replies, makes a dns resolve if it's a domain name and then detects the
outgoing interface of opensips and exports it as a PV to config. The
goal was to configure rtpengine's direction to bridge between different
interfaces. Adding just a few more lines of code will export the
destination IP as a PV. Since I use dns cache module resolve happens
only once and when t_relay() (tm module) searches for a destination it
just reuses previously resolved values from cache. I can share it if
anybody needs it.

> As far as I know, the equivalent variable to $si on the destination side is either $dd, which may not always be set, or $rd. Those are not guaranteed to be IP addresses, however. If DNS is being used, I don't believe OpenSIPS provides the results of the DNS lookup to the script in any variable, so I don't think there is a way to find the actual IP aside from doing your own DNS lookup (or possibly using the dns_cache module and snooping the cache, but I have had issues with this module in the past.)
>
> Ben Newlin
>
> On 6/28/19, 10:16 AM, "Users on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:
>
>      Unfortunately the address of the interface where the request was receeived is private. I am using 1 to 1 NAT.
>      
>      ----- Original Message -----
>      From: "Ovidiu Sas" <[hidden email]>
>      To: "OpenSIPS users mailling list" <[hidden email]>
>      Sent: Thursday, June 27, 2019 3:31:34 PM
>      Subject: Re: [OpenSIPS-Users] Feature request - pseudo-variable for destination IP address
>      
>      Check out the $Ri pvar:
>      https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78
>      
>      -ovidiu
>      
>      On Thu, Jun 27, 2019 at 6:23 PM [hidden email] <[hidden email]> wrote:
>      >
>      > I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.
>      >
>      > The motivation.
>      >
>      > I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script.  A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.
>      >
>      > Thank you for having a look.
>      > Rob
>      >
>      > _______________________________________________
>      > Users mailing list
>      > [hidden email]
>      > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      
>      
>      
>      --
>      VoIP Embedded, Inc.
>      http://www.voipembedded.com
>      
>      _______________________________________________
>      Users mailing list
>      [hidden email]
>      http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      
>      _______________________________________________
>      Users mailing list
>      [hidden email]
>      http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      
>      
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

Re: Feature request - pseudo-variable for destination IP address

Robert Dyck
Using the ip transform to resolve the address worked for me. When I get around
to it I should do it on opensips start up and cache the address

On Thursday, July 18, 2019 7:53:41 A.M. PDT Vitalii Aleksandrov wrote:

> Hi,
>
> Original question was about different thing but the destination IP of a
> request or reply is not hard to get. I wrote a small module which
> extracts the destination uri from ru (du) for requests and from via for
> replies, makes a dns resolve if it's a domain name and then detects the
> outgoing interface of opensips and exports it as a PV to config. The
> goal was to configure rtpengine's direction to bridge between different
> interfaces. Adding just a few more lines of code will export the
> destination IP as a PV. Since I use dns cache module resolve happens
> only once and when t_relay() (tm module) searches for a destination it
> just reuses previously resolved values from cache. I can share it if
> anybody needs it.
>
> > As far as I know, the equivalent variable to $si on the destination side
> > is either $dd, which may not always be set, or $rd. Those are not
> > guaranteed to be IP addresses, however. If DNS is being used, I don't
> > believe OpenSIPS provides the results of the DNS lookup to the script in
> > any variable, so I don't think there is a way to find the actual IP aside
> > from doing your own DNS lookup (or possibly using the dns_cache module
> > and snooping the cache, but I have had issues with this module in the
> > past.)
> >
> > Ben Newlin
> >
> > On 6/28/19, 10:16 AM, "Users on behalf of [hidden email]" <users-
[hidden email] on behalf of [hidden email]> wrote:

> >      Unfortunately the address of the interface where the request was
> >      receeived is private. I am using 1 to 1 NAT.
> >      
> >      ----- Original Message -----
> >      From: "Ovidiu Sas" <[hidden email]>
> >      To: "OpenSIPS users mailling list" <[hidden email]>
> >      Sent: Thursday, June 27, 2019 3:31:34 PM
> >      Subject: Re: [OpenSIPS-Users] Feature request - pseudo-variable for
> >      destination IP address
> >      
> >      Check out the $Ri pvar:
> >      https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78
> >      
> >      -ovidiu
> >      
> >      On Thu, Jun 27, 2019 at 6:23 PM [hidden email]
<[hidden email]> wrote:

> >      > I was looking for something similar to the $si PV but for the
> >      > destination IP address. Either it doesn't exist or I am blind. I
> >      > can't find things in the refrigerator either.
> >      >
> >      > The motivation.
> >      >
> >      > I have a working instance of Opensips with a basic residential
> >      > configuration. I extended it to allow calling UAs on the LAN from
> >      > the outside. It is a typical residential LAN without a fixed IP
> >      > address. Dynamic DNS is working for me. I read the tutorial about
> >      > Opensips behind NAT. Following the recommendations there I was
> >      > able to setup rtpproxy, the advertised address and an alias for my
> >      > Opensips. Initial testing using a softphone on a laptop using
> >      > either WiFi or a mobile phone tethered to the laptop worked well.
> >      > However it seems that some UAs will not accept a domain name in
> >      > the SDP connection. The UAs that failed could be made to work by
> >      > coding in an IP address. This is not a satisfactory solution
> >      > because the router's address may chaange. There is probably some
> >      > convoluted way to import the needed address into the script.  A
> >      > pseudo-variable representing the destination IP address of the
> >      > received INVITE or 200 OK could then be passed as the advertised
> >      > address to the rtpproxy module.
> >      >
> >      > Thank you for having a look.
> >      > Rob
> >      >
> >      > _______________________________________________
> >      > Users mailing list
> >      > [hidden email]
> >      > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >      
> >      --
> >      VoIP Embedded, Inc.
> >      http://www.voipembedded.com
> >      
> >      _______________________________________________
> >      Users mailing list
> >      [hidden email]
> >      http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >      
> >      _______________________________________________
> >      Users mailing list
> >      [hidden email]
> >      http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users





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

Re: Feature request - pseudo-variable for destination IP address

Johan De Clercq
In reply to this post by Vitalii Aleksandrov
I am interested

Outlook voor iOS downloaden
 

Van: Users <[hidden email]> namens Vitalii Aleksandrov <[hidden email]>
Verzonden: donderdag, juli 18, 2019 4:56 PM
Aan: [hidden email]
Onderwerp: Re: [OpenSIPS-Users] Feature request - pseudo-variable for destination IP address
 
Hi,

Original question was about different thing but the destination IP of a
request or reply is not hard to get. I wrote a small module which
extracts the destination uri from ru (du) for requests and from via for
replies, makes a dns resolve if it's a domain name and then detects the
outgoing interface of opensips and exports it as a PV to config. The
goal was to configure rtpengine's direction to bridge between different
interfaces. Adding just a few more lines of code will export the
destination IP as a PV. Since I use dns cache module resolve happens
only once and when t_relay() (tm module) searches for a destination it
just reuses previously resolved values from cache. I can share it if
anybody needs it.
> As far as I know, the equivalent variable to $si on the destination side is either $dd, which may not always be set, or $rd. Those are not guaranteed to be IP addresses, however. If DNS is being used, I don't believe OpenSIPS provides the results of the DNS lookup to the script in any variable, so I don't think there is a way to find the actual IP aside from doing your own DNS lookup (or possibly using the dns_cache module and snooping the cache, but I have had issues with this module in the past.)
>
> Ben Newlin
>
> On 6/28/19, 10:16 AM, "Users on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:
>
> Unfortunately the address of the interface where the request was receeived is private. I am using 1 to 1 NAT.
>
> ----- Original Message -----
> From: "Ovidiu Sas" <[hidden email]>
> To: "OpenSIPS users mailling list" <[hidden email]>
> Sent: Thursday, June 27, 2019 3:31:34 PM
> Subject: Re: [OpenSIPS-Users] Feature request - pseudo-variable for destination IP address
>
> Check out the $Ri pvar:
> https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc78
>
> -ovidiu
>
> On Thu, Jun 27, 2019 at 6:23 PM [hidden email] <[hidden email]> wrote:
> >
> > I was looking for something similar to the $si PV but for the destination IP address. Either it doesn't exist or I am blind. I can't find things in the refrigerator either.
> >
> > The motivation.
> >
> > I have a working instance of Opensips with a basic residential configuration. I extended it to allow calling UAs on the LAN from the outside. It is a typical residential LAN without a fixed IP address. Dynamic DNS is working for me. I read the tutorial about Opensips behind NAT. Following the recommendations there I was able to setup rtpproxy, the advertised address and an alias for my Opensips. Initial testing using a softphone on a laptop using either WiFi or a mobile phone tethered to the laptop worked well. However it seems that some UAs will not accept a domain name in the SDP connection. The UAs that failed could be made to work by coding in an IP address. This is not a satisfactory solution because the router's address may chaange. There is probably some convoluted way to import the needed address into the script. A pseudo-variable representing the destination IP address of the received INVITE or 200 OK could then be passed as the advertised address to the rtpproxy module.
> >
> > Thank you for having a look.
> > Rob
> >
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> --
> VoIP Embedded, Inc.
> http://www.voipembedded.com
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

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