[SR-Users] wt_timer, delayed replies and sendto error
Andreas Granig
agranig at sipwise.com
Fri Sep 16 14:46:07 CEST 2011
Hi,
On 09/16/2011 09:10 AM, Daniel-Constantin Mierla wrote:
>> It's actually an educated guess that this could be related to wt_timer,
>> but I don't know what else it could be.
>>
> what happens is that when transaction is active and tm is handling the
> replies, they are forwarded using the same socket where the request was
> received (iirc).
>
> However, the transaction is gone so the reply is sent stateless and the
> default rule of stateless forwarding for selecting the local socket is
> to use the same socket where the message was received (in this case is
> the reply is received on loopback interface). Try either to use mhomed
> parameter or force the right send socket by hand (force_send_socket(...)
> or $fs=...) when there is no active transaction for replies (use
> t_check_trans()).
Actually I do a force_send_socket in my onreply_routes, but the
onreply_routes to be used are chosen during request handling. I don't
have a default reply route though, which I guess must be used in this
case, because information about which onreply_route to use is lost after
wt_timer, right?
Roughly outlined, this is what I have now. I don't use mhomed, but
rather set the sockets manually:
route[REQUEST]
{
if(request from outside) {
force_send_socket(localhost);
t_on_reply("REPLY_FROM_INSIDE");
}
else { # request from inside
force_send_socket(public interface);
t_on_reply("REPLY_FROM_OUTSIDE");
}
# relay to proper destination
}
onreply_route[REPLY_FROM_INSIDE]
{
force_send_socket(public interface);
}
onreply_route[REPLY_FROM_OUTSIDE]
{
force_send_socket(localhost);
}
And this is what I'd need to add if I got you right:
# the default reply route used when transaction is already gone
onreply_route
{
if(reply from inside)
force_send_socket(localhost);
else
force_send_socket(public interface);
}
Does it look like a plan?
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110916/b1d2ef01/attachment.pgp>
More information about the sr-users
mailing list