Discussion:
[SR-Users] rewriteuri and append_branch with variables
alex pappas
2011-05-06 12:28:19 UTC
Permalink
Dear All,

I'm trying the following and i get error:

$var(new_uri) = "sip:" +$avp(s:term_prefix) +$rU +"@" +$avp(s:gw_address);

rewriteuri=($var(new_uri)); OR append_branch($var(new_uri));

But it seems that it does not like the variable. The documentation says that
rewriteuri get a string so i don't understand why does not work.

Do you have any ideas on this ?

Cheers
Alex
Iñaki Baz Castillo
2011-05-06 15:31:59 UTC
Permalink
rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says that
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).

However you can use:

$ru = $var(new_uri);

as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
<***@aliax.net>
Iñaki Baz Castillo
2011-05-06 15:31:59 UTC
Permalink
rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says that
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).

However you can use:

$ru = $var(new_uri);

as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
<***@aliax.net>
alex pappas
2011-05-07 16:37:06 UTC
Permalink
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem is
the append_branch.

I'm trying to create a redirect function with the append_branch dynamically
filled in.

Any suggestion on that?

Thanks

Alex
Post by alex pappas
+$avp(s:gw_address);
Post by alex pappas
rewriteuri=($var(new_uri)); OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says
that
Post by alex pappas
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).
$ru = $var(new_uri);
as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
alex pappas
2011-05-07 16:37:06 UTC
Permalink
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem is
the append_branch.

I'm trying to create a redirect function with the append_branch dynamically
filled in.

Any suggestion on that?

Thanks

Alex
Post by alex pappas
+$avp(s:gw_address);
Post by alex pappas
rewriteuri=($var(new_uri)); OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says
that
Post by alex pappas
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).
$ru = $var(new_uri);
as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ovidiu Sas
2011-05-07 20:16:55 UTC
Permalink
Just set the RURI to the value that you want and then call append_brach().
Everything that's in RURI will be appended as a new branch.

After that, reset the RURI to it's original value: revert_uri().

Regards,
Ovidiu Sas
Post by alex pappas
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem is
the append_branch.
I'm trying to create a redirect function with the append_branch dynamically
filled in.
Any suggestion on that?
Thanks
Alex
Post by Iñaki Baz Castillo
Post by alex pappas
+$avp(s:gw_address);
rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says
that
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).
 $ru = $var(new_uri);
as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ovidiu Sas
2011-05-07 20:16:55 UTC
Permalink
Just set the RURI to the value that you want and then call append_brach().
Everything that's in RURI will be appended as a new branch.

After that, reset the RURI to it's original value: revert_uri().

Regards,
Ovidiu Sas
Post by alex pappas
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem is
the append_branch.
I'm trying to create a redirect function with the append_branch dynamically
filled in.
Any suggestion on that?
Thanks
Alex
Post by Iñaki Baz Castillo
Post by alex pappas
+$avp(s:gw_address);
rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation says
that
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).
 $ru = $var(new_uri);
as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
alex pappas
2011-05-07 21:01:03 UTC
Permalink
Many thanks Ovidiu,

I will try that and get back to the community.

Regards
Alex
Post by Ovidiu Sas
Just set the RURI to the value that you want and then call append_brach().
Everything that's in RURI will be appended as a new branch.
After that, reset the RURI to it's original value: revert_uri().
Regards,
Ovidiu Sas
Post by alex pappas
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem
is
Post by alex pappas
the append_branch.
I'm trying to create a redirect function with the append_branch
dynamically
Post by alex pappas
filled in.
Any suggestion on that?
Thanks
Alex
Post by Iñaki Baz Castillo
Post by alex pappas
+$avp(s:gw_address);
rewriteuri=($var(new_uri)); OR append_branch($var(new_uri));
But it seems that it does not like the variable. The documentation
says
Post by alex pappas
Post by Iñaki Baz Castillo
Post by alex pappas
that
rewriteuri get a string so i don't understand why does not work
You are not passing a string to erwriteuri() function, but a
pseudo-variable containing a string as value. It's not the same (not
at least in kamailio/sip-router configuration DSL language).
$ru = $var(new_uri);
as $ru pseudo-variable (request URI) does allow dynamic assignement.
--
Iñaki Baz Castillo
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...