Re: [SR-Users] Dispatcher Usage and change of $rU

2022-04-29 Thread Daniel-Constantin Mierla
dispatcher module does not touch To/From headers, so if the $tU/$fU are
changed, there are other actions in kamailio.cfg doing it.

dispatcher updates r-uri ($ru) if ds_select_domain() is used, by
changing the domain part ($actually rd, port and parameters).

When ds_select_dst() is used, r-uri ($ru, $rd, ...) is not touched at
all, only dst-uri is set ($du).

Use ds_select_dst() when you do not want to lose the r-uri content
(e.g., preserve incoming r-uri domain), but you want to set a particular
next hop address.

Cheers,
Daniel

On 29.04.22 11:58, Benoît Panizzon wrote:
>> There’s a typo here:
> Ignore, I only made that type in the email example.
>
> After some more google research I found another user describing a
> similar issue so I did some testing:
>
> ds_select_dst does RESET $rU and $tU but not $fU
>
> ds_select_domain does not RESET $rU or $tU.
>
> Doing:
>
> ds_select_dst("2000","6");
> $rU = "0012345";
> route(RELAY)
>
> setting $rU after calling ds_select_dst solved the issue I have.
>
> But I wonder, why this is resetting certain header. This is not clear
> from the documentation.
>
> I also wonder: When should one use ds_select_dst and when
> ds_select_domain ?
>
> Could ds_select_domain be safely used for any situation?
>
> -- 
> Mit freundlichen Grüssen
>
> -Benoît Panizzon- @ HomeOffice und normal erreichbar
> -- 
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
>
> Zurlindenstrasse 29 Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
  * https://www.asipto.com/sw/kamailio-advanced-training-online/


__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Dispatcher Usage and change of $rU

2022-04-29 Thread Benoît Panizzon
> There’s a typo here:

Ignore, I only made that type in the email example.

After some more google research I found another user describing a
similar issue so I did some testing:

ds_select_dst does RESET $rU and $tU but not $fU

ds_select_domain does not RESET $rU or $tU.

Doing:

ds_select_dst("2000","6");
$rU = "0012345";
route(RELAY)

setting $rU after calling ds_select_dst solved the issue I have.

But I wonder, why this is resetting certain header. This is not clear
from the documentation.

I also wonder: When should one use ds_select_dst and when
ds_select_domain ?

Could ds_select_domain be safely used for any situation?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Dispatcher Usage and change of $rU

2022-04-29 Thread David Villasmil
There’s a typo here:

ds_select_dst("2000"),"6");

On Fri, 29 Apr 2022 at 09:49, Benoît Panizzon 
wrote:

> Hi Gang
>
> I have a observation which I don't understand...
>
> Let's assume we have an inbound $rU = 12345
>
> And I want to change $rU outbound to 0012345
>
> Doing:
>
> $rU = "0012345";
> ds_select_dst("2000"),"6");
> route(RELAY)
>
> The call is being sent out with unaltered R-URI Username: 12345
>
> Doing:
>
> $rU = "0012345";
> ds_select_domain("2000", "6");
> route(RELAY);
>
> The call is being sent out with the intended new R-URI Username: 0012345
>
> Looking at the docs:
>
> https://kamailio.org/docs/modules/5.4.x/modules/dispatcher.html#dispatcher.f.ds_select_dst
>
> I can not figure out, why I see this difference.
>
> --
> Mit freundlichen Grüssen
>
> -Benoît Panizzon- @ HomeOffice und normal erreichbar
> --
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
>
> Zurlindenstrasse 29
> 
>Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-- 
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Dispatcher Usage and change of $rU

2022-04-29 Thread Benoît Panizzon
Hi Gang

I have a observation which I don't understand...

Let's assume we have an inbound $rU = 12345

And I want to change $rU outbound to 0012345

Doing:

$rU = "0012345";
ds_select_dst("2000"),"6");
route(RELAY)

The call is being sent out with unaltered R-URI Username: 12345

Doing:

$rU = "0012345";
ds_select_domain("2000", "6");
route(RELAY);

The call is being sent out with the intended new R-URI Username: 0012345

Looking at the docs:
https://kamailio.org/docs/modules/5.4.x/modules/dispatcher.html#dispatcher.f.ds_select_dst

I can not figure out, why I see this difference.

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users