I have the following basic script:

 

request_route{

        record_route();

 

        $var(enumres) = enum_query();

 

        switch( $var(enumres) ) {

                case -1: 

                        xlog("enum_query lookup failure - To URI $tU");

                        sl_reply("503", "Temporary lookup failure");

                        return(0);

                case 1:

                        break; # uri replaced

        }

        xlog("INVITE ENUM query - To URI $tU");

        t_relay();

 

I have the following ENUM records for a test setup:

 

;; ANSWER SECTION:

x.x.x.1.5.1.8.3.0.3.1.e164.arpa. 60 IN  NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:+13038151xxx@10.20.20.198!" .

x.x.x.1.5.1.8.3.0.3.1.e164.arpa. 60 IN  NAPTR 110 10 "U" "E2U+sip" "!^.*$!sip:+13038151xxx@10.20.20.75!" .

 

What happens is the following:

 

tcpdump: listening on ens3, link-type EN10MB (Ethernet), capture size 262144 bytes

 

17:57:19.961041 IP (tos 0x10, ttl 64, id 59648, offset 0, flags [none], proto UDP (17), length 1481)

    10.20.20.40.5060 > 10.20.20.198.5060: SIP, length: 1453

      INVITE sip:+13038151xxx@10.20.20.198 SIP/2.0

      …

17:57:19.961058 IP (tos 0x10, ttl 64, id 24143, offset 0, flags [none], proto UDP (17), length 1480)

    10.20.20.40.5060 > 10.20.20.75.5060: SIP, length: 1452

      INVITE sip:+13038151xxx@10.20.20.75 SIP/2.0

      …

 

These basically go out at the same time.

 

Eventually I get a ICMP Port Unreachable on the .198 one because that’s a dummy I just set up for testing.

 

My question is, with this kind of setup, is there a way to tell Kamailio to respect the NAPTR order value (note, 100, 110 above) and only try the 2nd route if the first fails?

 

Thanks,

 

Jawaid