Description

BYE transactions keept increasing and were never freed.

Reproduction

  1. Compile kamailio 5.8.5 and run it under no traffic, with default config
  2. Connect 1 WSS client
  3. Send INVITE with "Session-Expires" header from WSS client -> kamailio -> PBX (e.g. asterisk)
  4. Wait for WSS client to refresh session in re-INVITE with another "Session-Expires"
  5. Force kill WSS client and wait
  6. PBX (asterisk) will send BYE to end session
  7. kamailio replies "477 Unfortunately error on sending to next hop occurred (477/SL)"
  8. kamcmd tm.list | grep BYE -> will see that transaction there is never freed

Debugging Data + Log Messages

DEBUG: tm [h_table.c:415]: build_cell(): created new cell 0x7f673e2552d0
INFO: <script>: [pdn60n9cob1j3j0doi36] MANAGE_BRANCH: New branch [0] to ....., BYE
WARNING: tm [../../core/forward.h:217]: msg_send_buffer(): TCP/TLS connection for WebSocket could not be found
DEBUG: tm [t_fwd.c:1566]: t_send_branch(): send to 169.132.91.64:1702 (5) failed
WARNING: tm [t_fwd.c:1586]: t_send_branch(): sending request on branch 0 failed
DEBUG: tm [t_funcs.c:358]: t_relay_to(): t_forward_nonack returned error -1 (-477)
DEBUG: tm [t_funcs.c:376]: t_relay_to(): -477 error reply generation delayed 
DEBUG: sl [sl_funcs.c:564]: sl_run_callbacks(): execute callback for event type 1
ERROR: sl [sl_funcs.c:428]: sl_reply_error(): stateless error reply used: Unfortunately error on sending to next hop occurred (477/SL)
DEBUG: dialog [dlg_hash.c:780]: dlg_lookup_mode(): ref dlg 0x7f673e5dbae0 with 1 -> 2
DEBUG: dialog [dlg_hash.c:784]: dlg_lookup_mode(): dialog id=6986 found on entry 2734
DEBUG: dialog [dlg_hash.c:1088]: dlg_unref_helper(): unref op on 0x7f673e5dbae0 with 1 from dlg_hash.c:1106
DEBUG: dialog [dlg_hash.c:1092]: dlg_unref_helper(): unref dlg 0x7f673e5dbae0 with 1 -> 1

SIP Traffic


![Image](https://github.com/user-attachments/assets/abc99b7a-9830-4928-81c3-3aa02bb8acbe)

Possible Solutions

Tracked this down to this "#ifdef" that is defined inside the C file itself: https://github.com/kamailio/kamailio/blob/master/src/modules/tm/t_funcs.c#L357

Solution 1: remove all the code related to TM_DELAYED_REPLY since it is anyway local to t_funcs.c file

Solution 2: t_release_transaction(t); /* kill it silently */ in case of TM_DELAYED_REPLY too

Additional Information

all up to latest one
not relevant


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/4140@github.com>