Hello,
On 9/15/12 9:22 AM, Juha Heinanen wrote:
current implementation of nathelper nat pinging is based on obtaining contact info from usrloc module:
static void nh_timer(unsigned int ticks, void *timer_idx) { ... rval = ul.get_all_ucontacts(buf, cblen, (ping_nated_only?ul.nat_flag:0), ((unsigned int)(unsigned long)timer_idx)*natping_interval+iteration, natping_processes*natping_interval);
would it be feasible to have another mode where the contact info is obtained from database location table? this would make it possible to ping nated contacts also from other hosts than the registrar, such as a dispatcher.
any comments?
the pinging is using the local socket where the register was received, that could fail on the dispatcher host. Also, the path header may create troubles in routing.
Overall, I would not like to get nathelper connecting to database of usrloc, instead usrloc can be updated for a runtime mode where it does only read operations - in db only mode, if save() is not used, then only thing to be disabled is the timer for deleting auto-expired records. In this way, any change to database structure/backend type has to be updated in one place.
Cheers, Daniel