[SR-Users] t_suspend() / t_continue() create new branches

Sebastian Damm sdamm at pascom.net
Wed Nov 24 14:43:43 CET 2021

After spending more hours of unsuccessful debugging, I can add to my problem:

My call enters the branch_route_failure route, where I can get the 486 status with t_get_status_code(). However, I cannot issue a t_reply() in this phase of the call. And after some more seconds, when the transaction times out (looks like it's the no-answer-received timer of 30 seconds), Kamailio just sends a 408 without entering any route anymore. I have a debug output in my failure route, which is never printed.

I tried virtually every command from tm or tmx module in the last hours that looked like it could help. Without success. Still stuck at "Why is there another branch after t_suspend and t_continue and how do I make it go away? There's just an evapi call to cgrates in between.

Grateful for any ideas.


----- Ursprüngliche Mail -----
Von: "Sebastian Damm" <sdamm at pascom.net>
An: "sr-users" <sr-users at lists.kamailio.org>
Gesendet: Dienstag, 23. November 2021 17:51:02
Betreff: [SR-Users] t_suspend() / t_continue() create new branches


I have the following weird problem. A Kamailio (5.4.x) with some asynchronous permission logic suspends outgoing INVITEs and resumes them after the answer of the permission system. Everything works as expected when the call is answered. However, when the called party rejects the call (with a 486 for example), the call doesn't get torn down immediately (it is rejected with a 408 eventually) because Kamailio logs the following:

Nov 23 14:51:02 host /usr/sbin/kamailio[1569]: DEBUG: app_python [apy_kemi.c:106]: sr_kemi_config_engine_python(): execution of route type 4 with name [ksr_onreply_manage] returned 1
Nov 23 14:51:02 host /usr/sbin/kamailio[1569]: DEBUG: tm [t_reply.c:1363]: t_should_relay_response(): ->>>>>>>>> T_code=183, new_code=486
Nov 23 14:51:02 host /usr/sbin/kamailio[1569]: DEBUG: tm [t_reply.c:1448]: t_should_relay_response(): store - other branches still active
Nov 23 14:51:02 host /usr/sbin/kamailio[1569]: DEBUG: tm [t_reply.c:1926]: relay_reply(): reply status=3 branch=2, save=1, relay=-1 icode=0 msg status=486

I don't do any forking, the call is just forwarded.

I put the following line immediately after t_suspend() and in the beginning of the route specified in t_continue():

    KSR.info("We're at branch index %d" % KSR.pv.get("$T(branch_index)"))

This produces the following output:

Nov 23 16:30:13 host /usr/sbin/kamailio[2745]: INFO: <core> [core/kemi.c:104]: sr_kemi_core_info(): We're at branch index 0
Nov 23 16:30:13 host /usr/sbin/kamailio[2725]: INFO: <core> [core/kemi.c:104]: sr_kemi_core_info(): We're at branch index 2

So apparently, the suspend and continue introduce new branches. (Other option: I'm doing something completely different creating those branches, but I don't have any append_branch() or similar in my code.)

I assume, I just missed a configuration parameter. Can I get Kamailio somehow to behave as if there was just one branch and forward the negative reply?


Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users at lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

More information about the sr-users mailing list