Hello,
On 03/11/2010 10:11 PM, IƱaki Baz Castillo wrote:
2010/3/11 Santiago Soaressantiagosoares@gmail.com:
says I can't use forward(), for failover, I have to use t_relay, which means that the server must be statefull. But the thing is, i wouldn't like to maintain transactions state in the server, due to the high memory usage. Is it true? Can't I have failover support with forward()?
If yoou want Kamailio to perform failover you need it to be transaction stateful, if not Kamailio has no information about hte request when it receives a 500/503 so can not dispatch it to other server (failover).
Load balancing is possible in stateless mode as it just involves sending the requests to different servers randomly.
Also, are you sure you need it to be stateless? TM performance is very good and it's mostly used.
just to confirm what Inaki says that you need tm for doing failover and give you a bit more insights to understand why.
In stateless mode, the sip message is received, processed via config (e.g., in your case select a destination), relayed and completely forgotten. Reply comes, the sip router takes the Via header stack and routes it to origin. Nothing exists about the SIP request in sip router when the reply is processed.
In stateful mode, the initial request is saved in memory, when the reply comes it, tm module matches what is the corresponding request. If the reply code was negative, via failure_route you can get the initial request back for processing and re-send it to new destination.
The performances of tm are very good, with latest 3.0 one more time improved a lot.
Also note that transaction means "request to final reply", not "beginning of call to end of call". So memory is used from the moment the initial invite comes in until the call is answered, canceled or time-out. During the time call is active, no memory is consumed.
Cheers, Daniel