Hi 
> what repay_route are you using? in your TOPSTN route you set the 
> failure_route, but no reply_route
> 
Everything is pushed through the standard route[RELAY] with some RTPEngine bits 
added, so I was expecting that to set reply to be MANAGE_REPLAY;

# Wrapper for relaying requests
route[RELAY] {

        xlog("L_ALERT","FLOWTRACE: inside RELAY ([$rm] From IP:$si:$sp)\n");
        # enable additional event routes for forwarded requests
        # - serial forking, RTP relaying handling, a.s.o.
        if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {
                if(!t_is_set("branch_route")) {
                        t_on_branch("MANAGE_BRANCH");
                        $dlg_var(b_call_id) = $ci;
                }
        }

        if (is_method("INVITE|SUBSCRIBE|UPDATE")) {
                if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");
        }

        if (is_method("INVITE")) {
                if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");
        }

#!ifdef WITH_RTPENGINE
        if (has_body("application/sdp")) {
                 route(RTPMANAGE);
        }

        if (is_method("BYE|CANCEL")) {
                route(RTPMANAGE);
                route(RTPPOPULATE_STATS);
        }
#!endif 

        if (!t_relay()) {
                sl_reply_error();
        }
        exit;
}

.. however, assuming I’m reading the logs right it’s going to the 
onreply_route=[DEFAULT_ONREPLY]

Looking at logs for CSEQ 31528 which is the Kamailio -> Carrier Invite with 
Auth packet following the auth challenge:

> DEBUG: {1 31527 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} dialog 
> [dlg_cseq.c:193]: dlg_cseq_update(): adding auth cseq header value: 31528
> DEBUG: {1 31527 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/data_lump.c:785]: sr_hdr_add(): added new header (22) [P-K-CSeq-Auth: 
> 31528#015#012]
> DEBUG: {1 31527 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} dialog 
> [dlg_cseq.c:452]: dlg_cseq_msg_sent(): updating cseq to: 31528
> DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: 
> <31528> <INVITE>
> DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: 
> <31528> <INVITE>
> DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: 
> <31528> <INVITE>
> DEBUG: <core> [core/receive.c:387]: receive_msg(): --- received sip message - 
> reply - call-id: [710ed27a-da6b-4362-b598-e4cd72c765e2] - cseq: [31528 INVITE]
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/receive.c:259]: ksr_evrt_pre_routing(): event route core:pre-routing 
> not defined
> exec: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} *** 
> cfgtrace:dbg_cfg_trace(): onreply_route=[DEFAULT_ONREPLY] 
> c=[/etc/kamailio/kamailio.cfg] l=781 a=26 n=xlog
> ALERT: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <script>: 
> FLOWTRACE: inside reply_route ([INVITE] From IP:[CARRIER IP]:5060)
> exec: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} *** 
> cfgtrace:dbg_cfg_trace(): onreply_route=[DEFAULT_ONREPLY] 
> c=[/etc/kamailio/kamailio.cfg] l=786 a=16 n=if
> exec: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} *** 
> cfgtrace:dbg_cfg_trace(): onreply_route=[DEFAULT_ONREPLY] 
> c=[/etc/kamailio/kamailio.cfg] l=782 a=26 n=sanity_check
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:318]: check_required_headers(): check_required_headers entered
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:340]: check_required_headers(): check_required_headers passed
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:348]: check_via1_header(): check via1 header
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:548]: check_cseq_value(): check_cseq_value entered
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:576]: check_cseq_value(): check_cseq_value passed
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:585]: check_cl(): check_cl entered
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:610]: check_cl(): check_cl passed
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:759]: check_parse_uris(): check_parse_uris entered
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:777]: check_parse_uris(): looking up From header
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:791]: check_parse_uris(): parsing From header
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/parser/parse_addr_spec.c:185]: parse_to_param(): add param: 
> tag=bc64164d-966e-47b4-bf54-12f63acdcc76
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/parser/parse_addr_spec.c:884]: parse_addr_spec(): end of header 
> reached, state=29
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:817]: check_parse_uris(): parsing From URI
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:835]: check_parse_uris(): looking up To header
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:857]: check_parse_uris(): check_parse_uris(): parsing To URI
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity.c:902]: check_parse_uris(): check_parse_uris passed
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} sanity 
> [sanity_mod.c:254]: w_sanity_check(): sanity checks result: 1
> exec: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} *** 
> cfgtrace:dbg_cfg_trace(): onreply_route=[DEFAULT_ONREPLY] 
> c=[/etc/kamailio/kamailio.cfg] l=786 a=2 n=return
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} tm 
> [t_lookup.c:1034]: t_check_msg(): msg (0x7f3090d25ef8) id=1/1081246 global 
> id=0/0 T start=0xffffffffffffffff
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} tm 
> [t_lookup.c:906]: t_reply_matching(): poor reply ids - index 19664 label 0 
> branch 7491888 loopl 32/32
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} tm 
> [t_lookup.c:1009]: t_reply_matching(): failure to match a transaction
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} tm 
> [t_lookup.c:1103]: t_check_msg(): msg (0x7f3090d25ef8) id=1/1081246 global 
> id=1/1081246 T end=(nil)
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} tm 
> [t_reply.c:2350]: reply_received(): transaction not found - (branch -1)
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/forward.c:771]: do_forward_reply(): reply cannot be forwarded - no 2nd 
> via
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/receive.c:595]: receive_msg(): reply-route executed in: 20824 usec
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} dialog 
> [dlg_var.c:97]: cb_dlg_locals_reset(): resetting the local dialog shortcuts 
> on script callback: 2147483652
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/usr_avp.c:637]: destroy_avp_list(): destroying list (nil)
> message repeated 5 times: [ DEBUG: {2 31528 INVITE 
> 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> [core/usr_avp.c:637]: 
> destroy_avp_list(): destroying list (nil)]
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/xavp.c:541]: xavp_destroy_list(): destroying xavp list (nil)
> message repeated 2 times: [ DEBUG: {2 31528 INVITE 
> 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> [core/xavp.c:541]: 
> xavp_destroy_list(): destroying xavp list (nil)]
> DEBUG: {2 31528 INVITE 710ed27a-da6b-4362-b598-e4cd72c765e2} <core> 
> [core/receive.c:606]: receive_msg(): cleaning up


Even if I try and force it inside TOPSTN & TRUNKAUTH it still goes to 
DEFAULT_ONREPLY

failure_route[TRUNKAUTH] {
        xlog("L_ALERT","FLOWTRACE: inside TRUNKAUTH ([$rm] From IP:$si:$sp)\n");
        xlog("L_INFO", "TRUNKAUTH: method [$rm] from [$fu] to [$tu]\n");

    if (t_is_canceled()) {
        exit;
    }
    if(t_check_status("401|407")) {
        xlog("L_INFO", "TRUNKAUTH: responding to 401/407\n");
        $avp(auser) = "whitelabel2";
        $avp(apass) = "797x8pJ";
        uac_auth();
        xlog("L_INFO", "TRUNKAUTH: After uac_auth\n");
        t_on_reply("MANAGE_REPLY");
        route(RELAY);
        # t_relay();
        exit;
    }
}


I see no sign of “Trying” or “Ringing” in the Carriers replies in the logs, 
just the Invite.  They’re definitely there I can see them in the network layer.

The “failure to match a transaction” .. is presumably it’s not forwarding the 
reply to the PBX or realising what the response is for?

Mark
-- 
Mark Boyce

​This message contains confidential information. If you received this email by 
mistake, please let us know and delete it. We ask you to respect any 
confidential or private information in the email and do not share it unless 
appropriate to do so. We take precautions to minimise risk but we cannot 
guarantee the safety, confidentiality and security of the internet. Please 
carry out your own virus checks on any attachments. We are not liable or bound 
by the content of this email. 

Dark Origins Limited is a limited company registered in England and Wales. 
Registered number: 04877988.

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
[email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to