Hello,
while trying to upgrade from 1.5 to 3.1 i noticed that between t_relay() and branch_route, $du gets automatically set to $ru if it has not been set before.
This is a change from 1.5 i could not find documentation for, so it might have been unintened.
Can someone enlighten me on the purpose of this change and if there is a way to determine if $du is (was) unset other than comparing $ru to $du, wich seems a bit inefficient?
Is it even guaranteed that $du gets set to $ru in every possible scenario?
On 08/01/2011 11:57 AM, Alex Hermann wrote:
Is it even guaranteed that $du gets set to $ru in every possible scenario?
No, it is set only in a few cases.
Good way to check:
if(!defined $du)
On Monday 01 August 2011 17:58:17 Alex Balashov wrote:
On 08/01/2011 11:57 AM, Alex Hermann wrote:
Is it even guaranteed that $du gets set to $ru in every possible scenario?
No, it is set only in a few cases.
Good way to check:
if(!defined $du)
That does not work:
The following script fragment:
request_route: xlog("Relay: <$ru> via <$du>"); if (defined $du) { xlog("Relay: $$du is defined"); }
branch_route: xlog("Branch: <$ru> via <$du>"); if (defined $du) { xlog("Branch: $$du is defined"); }
Produces the following log fragment:
Relay: sip:user@domain:8888;transport=udp via <<null>> Branch: sip:user@domain:8888;transport=udp via sip:user@domain:8888;transport=udp Branch: $du is defined
Let me rephrase the question as it may have been a bit unclear: How can i determine within branch_route if the current branch had $du set?
Hello,
On 8/1/11 5:57 PM, Alex Hermann wrote:
Hello,
while trying to upgrade from 1.5 to 3.1 i noticed that between t_relay() and branch_route, $du gets automatically set to $ru if it has not been set before.
have you spotted the code that does it? It should not happen like that, I see no reason for it, but it would be good to review it. Pointing in the sources will save some time of blind search here.
Cheers, Daniel
This is a change from 1.5 i could not find documentation for, so it might have been unintened.
Can someone enlighten me on the purpose of this change and if there is a way to determine if $du is (was) unset other than comparing $ru to $du, wich seems a bit inefficient?
Is it even guaranteed that $du gets set to $ru in every possible scenario?
On Monday 01 August 2011 19:00:36 Daniel-Constantin Mierla wrote:
while trying to upgrade from 1.5 to 3.1 i noticed that between t_relay() and branch_route, $du gets automatically set to $ru if it has not been set before.
have you spotted the code that does it? It should not happen like that, I see no reason for it, but it would be good to review it. Pointing in the sources will save some time of blind search here.
I think it is in t_fwd.c : prepare_new_uac() around line 294
On 8/1/11 7:23 PM, Alex Hermann wrote:
On Monday 01 August 2011 19:00:36 Daniel-Constantin Mierla wrote:
while trying to upgrade from 1.5 to 3.1 i noticed that between t_relay() and branch_route, $du gets automatically set to $ru if it has not been set before.
have you spotted the code that does it? It should not happen like that, I see no reason for it, but it would be good to review it. Pointing in the sources will save some time of blind search here.
I think it is in t_fwd.c : prepare_new_uac() around line 294
thanks, indeed seems to be the case of setting $du to next hop, which is $ru if $du was not set before. I will prepare a patch and maybe you can help testing it.
Cheers, Daniel
Hello,
I committed a patch to master branch in order to skip setting the dst_uri to next hop address for branch route, link to commit: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb4ecbf9...
It would be great if you can give it a try and let me know if all is ok. Then it will be safe to backport to 3.1.
Thanks, Daniel
On 8/2/11 10:37 AM, Daniel-Constantin Mierla wrote:
On 8/1/11 7:23 PM, Alex Hermann wrote:
On Monday 01 August 2011 19:00:36 Daniel-Constantin Mierla wrote:
while trying to upgrade from 1.5 to 3.1 i noticed that between t_relay() and branch_route, $du gets automatically set to $ru if it has not been set before.
have you spotted the code that does it? It should not happen like that, I see no reason for it, but it would be good to review it. Pointing in the sources will save some time of blind search here.
I think it is in t_fwd.c : prepare_new_uac() around line 294
thanks, indeed seems to be the case of setting $du to next hop, which is $ru if $du was not set before. I will prepare a patch and maybe you can help testing it.
Cheers, Daniel
On Thursday 04 August 2011, Daniel-Constantin Mierla wrote:
I committed a patch to master branch in order to skip setting the dst_uri to next hop address for branch route, link to commit: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb4ecbf 986f4af366e5be9cbad26ceba924c77fd
It would be great if you can give it a try and let me know if all is ok. Then it will be safe to backport to 3.1.
I tested an empty $du and a filled in $du and both arrive as expected in branch_route. I did not test any further.
On 8/5/11 5:17 PM, Alex Hermann wrote:
On Thursday 04 August 2011, Daniel-Constantin Mierla wrote:
I committed a patch to master branch in order to skip setting the dst_uri to next hop address for branch route, link to commit: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb4ecbf 986f4af366e5be9cbad26ceba924c77fd
It would be great if you can give it a try and let me know if all is ok. Then it will be safe to backport to 3.1.
I tested an empty $du and a filled in $du and both arrive as expected in branch_route. I did not test any further.
Thanks, I will backport in the near future.
Cheers, Daniel