Yep. What Iñaki said.
In any sort of programming language-like runtime environment, which Kamailio script is, when you evaluate two actual statements in a disjunction rather than values holding return codes, those statements get executed right then and there.
So, whether the first t_relay() ran successfully or not, the second one will be executed. This won't work unless you branch.
Iñaki Baz Castillo wrote:
El Domingo, 12 de Octubre de 2008, Asim Riaz escribió:
if(!t_relay("udp:third_proxy_1:5060") || !t_relay("udp:third_proxy_2:5060")) {
I think that this is not valid, you can not check the result of sending the request to both destinations.
If the first condition is false (!t_relay("udp:third_proxy_1:5060") this means that a transaction has been correctly created. But after that you do a new comparision: !t_relay("udp:third_proxy_2:5060") The transaction was already created in the first t_realy so you are trying to do it again in a new t_relay, that is illegal.