On Wednesday 18 March 2009, Andrei Pelinescu-Onciul wrote:
attached patch
converts the utils module to use the sr msg_send
functionality. Please review if the API is used correct.
Look ok.
Hi Andrei,
In kamailio we
use this "while( get_next_su( proxy, to, 0) == 0 );"
construct to loop over all destinations (e.g. for failover), how this is
handled in sr?
int err;
[snip]
ever be freed */
(lots of stuff omitted, like error checks, blacklist check/add,
dns failover on/off checks, #ifdefs for USE_DNS_FAILOVER a.s.o.)
Basically dns_srv_handle_next() selects the next ip and also tells if there
are no more ips availale. It needs a struct dns_srv_handle which was used
before in a call to dns_sip_resolve*() and the return value (err) of the
last dns_sip_resolve*() call. You could use 0 instead of err, if you check
dns_sip_resolve*() return in some other place and stop the loop on error.
For a more complete example, see forward_request() in forward.c.
Thanks for the detailed explanation.
You might be able to use forward_request() directly
and get rid of all the
send and failover code (I haven't checked if it's possible or
utils_forward() needs something more special). forward_request() will also
use the blacklist (if configured).
Ok, the forward_request method looks good, i'll probably use this.
Cheers,
Henning