<html>Dear all,<br /><br />My use case is :<br /><br />I defined a username = 112 (for emergency call)<br />This username doesn't exist in subscribers table and unavailable in location table.<br />The idea is when Sopftphone1 call the group = 112 then Kamailio will forward the call to a group using SERIAL FORKING.<br /><br />=> Softphone 1 -> Sends INVITE to 112 -> Kamailio -> FORWARD TO SERIAL FORKING (4x softphone all registered and in location table). The q priority could be hybrid that means 2x softphone could have same priority.<br /><br />My issues :<br />- the q priority forced for each softphone is not taking into account.<br />- the first branch created when send INVITE to 112 is still available.<br /><br /><br />My setup<br /><br />Kamailio is behind a NAT.<br /><br />Kamailio version :<blockquote><p>sipsecure@kamailio:/$ kamailio -version<br />version: kamailio 5.5.4 (x86_64/linux)<br />flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED<br />ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br />poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br />id: unknown<br />compiled with gcc 10.2.1</p></blockquote><br />Kamailio.cfg<blockquote><p># ----- tm params -----<br /># auto-discard branches from previous serial forking leg<br />modparam("tm", "failure_reply_mode", 3)<br /># default retransmission timeout: 5sec<br />modparam("tm", "fr_timer", 5000)<br /># default invite retransmission timeout after 1xx: 10sec<br />modparam("tm", "fr_inv_timer", 10000)<br /># This is the name of an XAVP that the t_load_contacts() function uses to store contacts of the destination set and that t_next_contacts() function uses to restore those contacts.<br />modparam("tm", "contacts_avp", "tm_contacts")<br />modparam("tm", "contact_flows_avp", "tm_contact_flows")<br /><br /># modparam("tm|usrloc", "xavp_contact", "tm_contacts")<br /><br /># ----- rr params -----<br /># set next param to 1 to add value to ;lr param (helps with some UAs)<br />modparam("rr", "enable_full_lr", 0)<br /># do not append from tag to the RR (no need for this script)<br />modparam("rr", "append_fromtag", 0)</p></blockquote> <blockquote><pre>route[INVITE]{
    route(THREAD_CHECK);
    route(AUTH);
    route(RECORD_ROUTE);
    setflag(FLT_ACC);

    switch($tU)
    {
        case "112":
            xlog("MY_SEVERITY"," -- Calling Group Serial");
            route(FORK_SERIAL);
        break;

        case "113":
            xlog("MY_SEVERITY"," -- Calling Group Parralelle");
            route(FORK_PARALLEL);
        break;

        default:
            xlog("MY_SEVERITY"," -- Calling Someone");
            route(LOCATION);
            route(RELAY);
        break;
    }
    exit;
}
</pre></blockquote><pre>
 </pre><blockquote><pre>route[FORK_SERIAL]{

    t_on_reply("MANAGE_REPLY");

    #!ifndef WITH_BRIDGE_ON_FAIL
        setbflag(FLB_BRIDGE);
    #!endif
    route(IPV4V6);
    route(NATMANAGE);

    $var(uri1)="sip:9919995@192.168.1.41";
    $var(uri2)="sip:9919994@192.168.1.41";    
    $var(uri3)="sip:9919991@192.168.1.41";
    $var(uri4)="sip:9919997@192.168.1.41";

    lookup("location","$var(uri4)");
    append_branch("$ru","0.2");

    lookup("location","$var(uri1)");
    append_branch("$ru","0.8");

    lookup("location","$var(uri2)");
    append_branch("$ru","0.5");

    lookup("location","$var(uri3)");
    append_branch("$ru","0.5");

    t_load_contacts();

    t_next_contacts();

    t_on_failure("SERIAL");

    #!ifdef WITH_SIPSECURE_DEBUG
        xlog("MY_SEVERITY","    ROUTE_SERIAL : Relaying \n");
    #!endif
    #Relay (aka Forward) the request
    t_relay();
    break;
}

failure_route[SERIAL]{

        xlog("MY_SEVERITY","At failure route - Trying next destination");

            if (!t_next_contacts()) {
                send_reply("408","Nobody available");
                exit;
            }

        t_on_failure("SERIAL");
    
        t_relay();
}
</pre></blockquote><pre>
Any highlight will be welcome.

Best Regards,
</pre>--<br /><span style="font-size:11pt"><span style="font-family:Calibri, sans-serif"><b><span style="font-size:10.0pt" lang="EN-US"><span style="font-family:"Verdana",sans-serif"><span style="color:#1f497d">Youssef</span></span></span></b> </span></span></html>