[SR-Dev] Will SIP-Router handle better TCP childs avoiding blocking?

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Mar 3 09:19:46 CET 2009


On Mar 03, 2009 at 10:12, Juha Heinanen <jh at tutpro.com> wrote:
> Andrei Pelinescu-Onciul writes:
> 
>  > BTW: I don't think that for immediate errors (like send failing in
>  > kamailio tcp) one should call the failure route. You can always detect this
>  > using something like if (t_relay())... and you have more control this
>  > way.
> 
> andrei.
> 
> more control, but config file becomes a real mess, because the same
> handling of failure needs to be done in two places.  in my opinion,
> t_relay failure is a failure no matter if it is caused be tcp connection
> establishment failure or failure to receive a response on an established
> tcp connection or on udp packet.  it is really stupid if script writer
> needs to care about if tcp or udp is used by t_relay and at what point
> the failure occurred.

The same thing can happen for udp too, albeit only in special cases
(udp send can fail albeit very rarely, the most common case being
firewall rules on output on the local machine that use REJECT).
You don't need to care about the protocol being used. It could be as
simple as checking the return of a t_* function and calling a route().


Andrei



More information about the sr-dev mailing list