[OpenSER-Users] multiple NAPTR records in ENUM module

Jonathan Creasy jcreasy at netlogic.net
Wed Jun 27 01:45:07 CEST 2007


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:+13144803536 at 206.80.75.243!'
Jun 26 18:41:01 lugsy-raw openser[7214]: reg_replace(): pattern: '^.*$', 
replacement: 'sip:+13144803536 at 206.80.75.243', string: '+13144803536'
Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(): resulted in 
replacement: 'sip:+13144803536 at 206.80.75.243'
Jun 26 18:41:01 lugsy-raw openser[7214]: rewrite_uri: Rewriting 
Request-URI with 'sip:+13144803536 at 206.80.75.243'
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:+13144803536 at sikosu.myogre.com!'
Jun 26 18:41:01 lugsy-raw openser[7214]: reg_replace(): pattern: '^.*$', 
replacement: 'sip:+13144803536 at sikosu.myogre.com', string: '+13144803536'
Jun 26 18:41:01 lugsy-raw openser[7214]: enum_query(): resulted in 
replacement: 'sip:+13144803536 at sikosu.myogre.com'
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:+13144803536 at 206.80.75.243> , 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:+13144803536 at sikosu.myogre.com>, q_flag <0>
Jun 26 18:41:01 lugsy-raw openser[7214]: load_contacts(): DEBUG: Loaded 
<sip:+13144803536 at 206.80.75.243>, q_flag <4>
Jun 26 18:41:01 lugsy-raw openser[7214]: Route(2) Req 1 ACK From 
<sip:+13142664000 at 206.80.75.228> To 
<sip:+13144803536 at janice.netlogic.net> RURI <sip:+13144803536 at 206.80.75.243>
Jun 26 18:41:01 lugsy-raw openser[7214]: next_contacts(): DEBUG: R-URI 
is <sip:+13144803536 at 206.80.75.243>


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;
};
}





More information about the sr-users mailing list