[Kamailio-Users] load/next_contacts question

Klaus Darilion klaus.mailinglists at pernau.at
Mon Oct 20 11:22:28 CEST 2008


Hi Juha and others!

I wonder if I understand load/next_contacts(). If I understand it right
it can be used for example to make parallel/serial forking after an ENUM 
lookup (multiple NAPTRs).

I think this is the correct usage:

if (enum_query()) {
   if (load_contacts()) {
     if (next_contacts()) {
       t_on_failure("1");
       t_relay();
     } else {
       sl_reply("500","error adding contacts");
     }
   } else {
     sl_reply("500","error fetching destination set");
   }
   exit;
}


But I wonder what if all the branches after enum_query() have the same q 
value. According to the README:
load_contact: If all contacts in the destination set have the same 
qvalue, load_contacts() does not do anything thus minimizing performance 
impact of sequential forking capability when it is not needed. Returns 1 
if loading of contacts succeeded or there was nothing to do.

Thus, next_contacts() will be called although there are no AVPs to 
fetch. Do I miss something here?

regards
klaus




More information about the Users mailing list