Opensips 2.1.2 - can't pass var in rewritehostport()

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

Opensips 2.1.2 - can't pass var in rewritehostport()

maatohewetbi
I have Opensips 2.1.2 and wanna to pass IP variable using sip header and
parse it in Opensips to use with rewritehostport() function.  I've checked
that when I use it like rewritehostport("var(IP):5060") I can't pass this
variable, it's empty. I've read it's impossible to do it. How can I do it
right?



--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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

Re: Opensips 2.1.2 - can't pass var in rewritehostport()

Răzvan Crainea-2
You can achieve this by using:
$rd = $hdr(X-IP-header); # X-IP-header is the header's name that holds
the IP

Best regards,
Răzvan

On 11/8/18 10:03 AM, maatohewetbi wrote:

> I have Opensips 2.1.2 and wanna to pass IP variable using sip header and
> parse it in Opensips to use with rewritehostport() function.  I've checked
> that when I use it like rewritehostport("var(IP):5060") I can't pass this
> variable, it's empty. I've read it's impossible to do it. How can I do it
> right?
>
>
>
> --
> Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

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

Re: Opensips 2.1.2 - can't pass var in rewritehostport()

maatohewetbi
How can I use it, like that?
$rd=$hdr(X-IP-Header)
rewritehostport($rd:5060)




--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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

Re: Opensips 2.1.2 - can't pass var in rewritehostport()

Răzvan Crainea-2
All you have to do is to assingn the $rd pseudo-variable, which does the
same thing as rewritehostport() function.

On 11/14/18 12:39 PM, maatohewetbi wrote:

> How can I use it, like that?
> $rd=$hdr(X-IP-Header)
> rewritehostport($rd:5060)
>
>
>
>
> --
> Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

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

Re: Opensips 2.1.2 - can't pass var in rewritehostport()

Liviu Chircu
Minor nit: $rd is not exactly the equivalent of rewritehostport(),
rather $rd used together with $rp [1].

[1]: https://www.opensips.org/Documentation/Script-CoreVar-3-0#toc70

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 20.11.2018 10:44, Răzvan Crainea wrote:

> All you have to do is to assingn the $rd pseudo-variable, which does
> the same thing as rewritehostport() function.
>
> On 11/14/18 12:39 PM, maatohewetbi wrote:
>> How can I use it, like that?
>> $rd=$hdr(X-IP-Header)
>> rewritehostport($rd:5060)
>>
>>
>>
>>
>> --
>> Sent from:
>> http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
>>
>> _______________________________________________
>> 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