Juha Heinanen wrote:
Jonathan Creasy writes:

 > Oh. I didn't understand what the branches were. Excellent!
> > If you have a moment can you post a link to some good documentation on > that? If not...I can find it, I know I saw it earlier....

for example, see load_contacts() and next_contacts() functions of lcr
module.

-- juha

I'm going to show my ignorance here. I'm reading through the documentation and old messages floating around the internet and I really don't get it. The proper use of these functions is eluding me. I have not been able to get the system to move on and try the second contact. I can see from the debug that it pulls both records and they have the right preference and priority but it will not change to the second one even though the first on is an IP that has nothing on it to listen on 5060 and can't possibly be seen as a viable destination.

Jun 26 18:41:01 lugsy-raw openser[7214]: lookup(): '+13144803536' Not found in usrloc Jun 26 18:41:01 lugsy-raw openser[7214]: alias_db_lookup: no alias found for R-URI Jun 26 18:41:01 lugsy-raw openser[7214]: lookup(): '+13144803536' Not found in usrloc Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(6.3.5.3.0.8.4.4.1.3.1.enum.failover): order 50, pref 5, flen 1, flags 'u', slen 7, services 'E2U+sip', rlen 37, regexp '!^.*$!sip:[EMAIL PROTECTED]' Jun 26 18:41:01 lugsy-raw openser[7214]: reg_replace(): pattern: '^.*$', replacement: 'sip:[EMAIL PROTECTED]', string: '+13144803536' Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(): resulted in replacement: 'sip:[EMAIL PROTECTED]' Jun 26 18:41:01 lugsy-raw openser[7214]: rewrite_uri: Rewriting Request-URI with 'sip:[EMAIL PROTECTED]' Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(6.3.5.3.0.8.4.4.1.3.1.enum.failover): order 100, pref 10, flen 1, flags 'u', slen 7, services 'E2U+sip', rlen 41, regexp '!^.*$!sip:[EMAIL PROTECTED]' Jun 26 18:41:01 lugsy-raw openser[7214]: reg_replace(): pattern: '^.*$', replacement: 'sip:[EMAIL PROTECTED]', string: '+13144803536' Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(): resulted in replacement: 'sip:[EMAIL PROTECTED]' Jun 26 18:41:01 lugsy-raw openser[7214]: ******* setting for branch 0 flags 0 Jun 26 18:41:01 lugsy-raw openser[7214]: ENUM lookup returned <sip:[EMAIL PROTECTED]> , sending on Jun 26 18:41:01 lugsy-raw openser[7214]: parse_headers: flags=ffffffffffffffff Jun 26 18:41:01 lugsy-raw openser[7214]: load_contacts(): DEBUG: Loaded <sip:[EMAIL PROTECTED]>, q_flag <0> Jun 26 18:41:01 lugsy-raw openser[7214]: load_contacts(): DEBUG: Loaded <sip:[EMAIL PROTECTED]>, q_flag <4> Jun 26 18:41:01 lugsy-raw openser[7214]: Route(2) Req 1 ACK From <sip:[EMAIL PROTECTED]> To <sip:[EMAIL PROTECTED]> RURI <sip:[EMAIL PROTECTED]> Jun 26 18:41:01 lugsy-raw openser[7214]: next_contacts(): DEBUG: R-URI is <sip:[EMAIL PROTECTED]>


Here is an excerpt from my configuration.

                       if (enum_query("enum.failover")) {
xlog("L_INFO", "ENUM lookup returned <$ru> , sending on\n");
                               append_hf("P-hint: enum applied\r\n");
                               route(2);
                               return;
                       }
Then the routes:

route[2]
{
       if (!load_contacts()) {
sl_send_reply("500", "Server Internal Error - Cannot load contacts");
               exit;
       };
xlog("L_INFO", "Route(2) Req $mi $rm From <$fu> To <$tu> RURI <$ru>\n");
       # !! Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){ sl_send_reply("479", "We don't forward to private IP addresses");
           return;
       };

# if client or openserver know to be behind a NAT, enable relay of RTP
       if (isflagset(6)) {
           force_rtp_proxy();
       };

       # NAT processing of replies; apply to all transactions (for example,
       # re-INVITEs from public to private UA are hard to identify as
       # NATed at the moment of request processing); look at replies
       t_on_reply("1");

       if (!next_contacts()) {
               sl_send_reply("500", "Server Internal Error");
               exit;
       } else {
               xlog("L_INFO", "route2: Sending to <$ru>\n");
               t_relay();
       };

# After this gets processed it will go back to the statement it was called from
}

failure_route[2]
{
if (next_contacts()) {
       route(2);
       exit;
};
}


_______________________________________________
Users mailing list
Users@openser.org
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to