Hi Folks - I am attempting to set up a mobile push configuration, by following the published example(s).
If we have more than one endpoint registered, this configuration works as expected (via the ts_store() path below).
If we do not have another registered endpoint the transaction seems to be suspended but then cannot be resumed (t_suspend) after REGISTER arrives.
INFO: <script>: [R-LOG]: INVITE from IP:[24.XXX.XXX.XXX:62665] [sip:jeremy2@stage][<null>] NFO: <script>: [R-SUSPEND]: Suspended transaction [41359:415220139] INFO: <script>: [R-SUSPEND]: fU:[jeremy] rU:[jeremy2] tU:[jeremy2] INFO: <script>: [R-SUSPEND]: fU:[jeremy] => tU:[jeremy2] INFO: <script>: [R-SUSPEND]: vtp:[41359:415220139] INFO: <script>: [R-SENDPUSH]: Push sent [(55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78][com][hq01gt5utegi18ipkh1b] [Node-Push]: About to push: 55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78 INFO: <script>: R-REGISTER]: jeremy2 registered INFO: <script>: [R-REGISTER]: Contact: [sip:ilyartjr@qjwhdafxlbtk.invalid ;transport=ws;expires=10;app-id=stage;pn-voip-tok=55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78] INFO: <script>: [R-REGISTER]: App id: stage INFO: <script>: [R-REGISTER]: Expires: 10 INFO: <script>: [R-JOIN]: jeremy2 INFO: <script>: [R-JOIN]: Resuming trasaction [41359:415220139] jeremy2 (41359:415220139) WARNING: tm [t_suspend.c:197]: t_continue_helper(): transaction is not suspended [41359:415220139] WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [41359:415220139] failed
Relvant kamailio.cfg [Note: I did notice we had to switch things up a bit if calls come from a PSTN number via SBC]
modparam("htable", "htable", "vtp=>size=10;autoexpire=300")
... if (!lookup("location")) { send_reply("100", "Suspending"); route(SUSPEND); // *testing this path here * } else { route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-LOCATION]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); } ...
route[SUSPEND] { if (!t_suspend()) { xlog("L_ERROR", "[R-SUSPEND]: Failed to suspend transaction [$T(id_index):$T(id_label)]\n"); send_reply("501", "Unknown Destinaton"); exit; } xlog("L_INFO", "[R-SUSPEND]: Suspended transaction [$T(id_index):$T(id_label)]\n"); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] rU:[$rU] tU:[$tU]\n"); if (isbflagset(FLB_PSTN)) { $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => rU:[$rU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$rU)]\n"); } else { $sht(vtp=>join::$tU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => tU:[$tU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$tU)]\n"); } }
route[REGISTER] { if (!is_method("REGISTER")) { return; } if (isflagset(FLT_NATS)) { setbflag(FLB_NATB); } if (!save("location")) { sl_reply_error(); } route(JOIN); }
# Append branches or resume the transaction route[JOIN] { xlog("L_INFO","[R-JOIN]: $tU\n"); $var(hjoin) = 0; lock("$tU"); $var(hjoin) = $sht(vtp=>join::$tU); $var(hstored) = $sht(vtp=>stored::$tU); $sht(vtp=>join::$tU) = $null; unlock("$tU"); if ($var(hjoin)==0) { if ($var(hstored)) { xlog("L_INFO","[R-JOIN]: Appending transaction ($tu)\n"); ts_append("location", "$tu"); exit; } xlog("L_INFO","[R-JOIN]: No INVITE to resume\n"); exit; } $var(id_index) = $(var(hjoin){s.select,0,:}{s.int}); $var(id_label) = $(var(hjoin){s.select,1,:}{s.int}); xlog("L_INFO", "[R-JOIN]: Resuming trasaction [$var(id_index):$var(id_label)] $tU ($var(hjoin))\n"); t_continue("$var(id_index)", "$var(id_label)", "RESUME"); exit; }
# Lookup and relay after resuming transaction route[RESUME] { xlog("L_INFO", "[R-RESUME]: ru: [$ru] tu: [$tu]\n"); lookup("location"); route(SETUP_ROUTES); route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-RESUME]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); exit; }
What did I miss?
Hi,
What happens in the route[RELAY]?
Maybe code after "route(RELAY)" is not executed?
When there is only 1 device what value is inside $var(hstored) when the register hits Kamailio?
Jurijs
On Wed, Jan 6, 2021 at 4:27 AM Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
Hi Folks - I am attempting to set up a mobile push configuration, by following the published example(s).
If we have more than one endpoint registered, this configuration works as expected (via the ts_store() path below).
If we do not have another registered endpoint the transaction seems to be suspended but then cannot be resumed (t_suspend) after REGISTER arrives.
INFO: <script>: [R-LOG]: INVITE from IP:[24.XXX.XXX.XXX:62665] [sip:jeremy2@stage][<null>] NFO: <script>: [R-SUSPEND]: Suspended transaction [41359:415220139] INFO: <script>: [R-SUSPEND]: fU:[jeremy] rU:[jeremy2] tU:[jeremy2] INFO: <script>: [R-SUSPEND]: fU:[jeremy] => tU:[jeremy2] INFO: <script>: [R-SUSPEND]: vtp:[41359:415220139] INFO: <script>: [R-SENDPUSH]: Push sent [(55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78][com][hq01gt5utegi18ipkh1b] [Node-Push]: About to push: 55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78 INFO: <script>: R-REGISTER]: jeremy2 registered INFO: <script>: [R-REGISTER]: Contact: [sip:ilyartjr@qjwhdafxlbtk.invalid ;transport=ws;expires=10;app-id=stage;pn-voip-tok=55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78] INFO: <script>: [R-REGISTER]: App id: stage INFO: <script>: [R-REGISTER]: Expires: 10 INFO: <script>: [R-JOIN]: jeremy2 INFO: <script>: [R-JOIN]: Resuming trasaction [41359:415220139] jeremy2 (41359:415220139) WARNING: tm [t_suspend.c:197]: t_continue_helper(): transaction is not suspended [41359:415220139] WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [41359:415220139] failed
Relvant kamailio.cfg [Note: I did notice we had to switch things up a bit if calls come from a PSTN number via SBC]
modparam("htable", "htable", "vtp=>size=10;autoexpire=300")
... if (!lookup("location")) { send_reply("100", "Suspending"); route(SUSPEND); // *testing this path here * } else { route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-LOCATION]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); } ...
route[SUSPEND] { if (!t_suspend()) { xlog("L_ERROR", "[R-SUSPEND]: Failed to suspend transaction [$T(id_index):$T(id_label)]\n"); send_reply("501", "Unknown Destinaton"); exit; } xlog("L_INFO", "[R-SUSPEND]: Suspended transaction [$T(id_index):$T(id_label)]\n"); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] rU:[$rU] tU:[$tU]\n"); if (isbflagset(FLB_PSTN)) { $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => rU:[$rU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$rU)]\n"); } else { $sht(vtp=>join::$tU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => tU:[$tU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$tU)]\n"); } }
route[REGISTER] { if (!is_method("REGISTER")) { return; } if (isflagset(FLT_NATS)) { setbflag(FLB_NATB); } if (!save("location")) { sl_reply_error(); } route(JOIN); }
# Append branches or resume the transaction route[JOIN] { xlog("L_INFO","[R-JOIN]: $tU\n"); $var(hjoin) = 0; lock("$tU"); $var(hjoin) = $sht(vtp=>join::$tU); $var(hstored) = $sht(vtp=>stored::$tU); $sht(vtp=>join::$tU) = $null; unlock("$tU"); if ($var(hjoin)==0) { if ($var(hstored)) { xlog("L_INFO","[R-JOIN]: Appending transaction ($tu)\n"); ts_append("location", "$tu"); exit; } xlog("L_INFO","[R-JOIN]: No INVITE to resume\n"); exit; } $var(id_index) = $(var(hjoin){s.select,0,:}{s.int}); $var(id_label) = $(var(hjoin){s.select,1,:}{s.int}); xlog("L_INFO", "[R-JOIN]: Resuming trasaction [$var(id_index):$var(id_label)] $tU ($var(hjoin))\n"); t_continue("$var(id_index)", "$var(id_label)", "RESUME"); exit; }
# Lookup and relay after resuming transaction route[RESUME] { xlog("L_INFO", "[R-RESUME]: ru: [$ru] tu: [$tu]\n"); lookup("location"); route(SETUP_ROUTES); route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-RESUME]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); exit; }
What did I miss?
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi -
route[RELAY] { if (!t_relay()) { sl_reply_error(); } }
I also call SETUP_ROUTES separately before RELAY:
route[SETUP_ROUTES] { # enable additional event routes for forwarded requests if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) { if (!t_is_set("branch_route")) { t_on_branch("MANAGE_BRANCH"); } } if (is_method("INVITE|SUBSCRIBE|UPDATE")) { if (!t_is_set("onreply_route")) { t_on_reply("MANAGE_REPLY"); } } }
On Thu, Jan 7, 2021 at 11:48 AM Jurijs Ivolga jurijs.ivolga@gmail.com wrote:
Hi,
What happens in the route[RELAY]?
Maybe code after "route(RELAY)" is not executed?
When there is only 1 device what value is inside $var(hstored) when the register hits Kamailio?
Jurijs
On Wed, Jan 6, 2021 at 4:27 AM Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
Hi Folks - I am attempting to set up a mobile push configuration, by following the published example(s).
If we have more than one endpoint registered, this configuration works as expected (via the ts_store() path below).
If we do not have another registered endpoint the transaction seems to be suspended but then cannot be resumed (t_suspend) after REGISTER arrives.
INFO: <script>: [R-LOG]: INVITE from IP:[24.XXX.XXX.XXX:62665] [sip:jeremy2@stage][<null>] NFO: <script>: [R-SUSPEND]: Suspended transaction [41359:415220139] INFO: <script>: [R-SUSPEND]: fU:[jeremy] rU:[jeremy2] tU:[jeremy2] INFO: <script>: [R-SUSPEND]: fU:[jeremy] => tU:[jeremy2] INFO: <script>: [R-SUSPEND]: vtp:[41359:415220139] INFO: <script>: [R-SENDPUSH]: Push sent [(55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78][com][hq01gt5utegi18ipkh1b] [Node-Push]: About to push: 55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78 INFO: <script>: R-REGISTER]: jeremy2 registered INFO: <script>: [R-REGISTER]: Contact: [sip:ilyartjr@qjwhdafxlbtk.invalid ;transport=ws;expires=10;app-id=stage;pn-voip-tok=55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78] INFO: <script>: [R-REGISTER]: App id: stage INFO: <script>: [R-REGISTER]: Expires: 10 INFO: <script>: [R-JOIN]: jeremy2 INFO: <script>: [R-JOIN]: Resuming trasaction [41359:415220139] jeremy2 (41359:415220139) WARNING: tm [t_suspend.c:197]: t_continue_helper(): transaction is not suspended [41359:415220139] WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [41359:415220139] failed
Relvant kamailio.cfg [Note: I did notice we had to switch things up a bit if calls come from a PSTN number via SBC]
modparam("htable", "htable", "vtp=>size=10;autoexpire=300")
... if (!lookup("location")) { send_reply("100", "Suspending"); route(SUSPEND); // *testing this path here * } else { route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-LOCATION]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); } ...
route[SUSPEND] { if (!t_suspend()) { xlog("L_ERROR", "[R-SUSPEND]: Failed to suspend transaction [$T(id_index):$T(id_label)]\n"); send_reply("501", "Unknown Destinaton"); exit; } xlog("L_INFO", "[R-SUSPEND]: Suspended transaction [$T(id_index):$T(id_label)]\n"); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] rU:[$rU] tU:[$tU]\n"); if (isbflagset(FLB_PSTN)) { $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => rU:[$rU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$rU)]\n"); } else { $sht(vtp=>join::$tU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => tU:[$tU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$tU)]\n"); } }
route[REGISTER] { if (!is_method("REGISTER")) { return; } if (isflagset(FLT_NATS)) { setbflag(FLB_NATB); } if (!save("location")) { sl_reply_error(); } route(JOIN); }
# Append branches or resume the transaction route[JOIN] { xlog("L_INFO","[R-JOIN]: $tU\n"); $var(hjoin) = 0; lock("$tU"); $var(hjoin) = $sht(vtp=>join::$tU); $var(hstored) = $sht(vtp=>stored::$tU); $sht(vtp=>join::$tU) = $null; unlock("$tU"); if ($var(hjoin)==0) { if ($var(hstored)) { xlog("L_INFO","[R-JOIN]: Appending transaction ($tu)\n"); ts_append("location", "$tu"); exit; } xlog("L_INFO","[R-JOIN]: No INVITE to resume\n"); exit; } $var(id_index) = $(var(hjoin){s.select,0,:}{s.int}); $var(id_label) = $(var(hjoin){s.select,1,:}{s.int}); xlog("L_INFO", "[R-JOIN]: Resuming trasaction [$var(id_index):$var(id_label)] $tU ($var(hjoin))\n"); t_continue("$var(id_index)", "$var(id_label)", "RESUME"); exit; }
# Lookup and relay after resuming transaction route[RESUME] { xlog("L_INFO", "[R-RESUME]: ru: [$ru] tu: [$tu]\n"); lookup("location"); route(SETUP_ROUTES); route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-RESUME]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); exit; }
What did I miss?
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
have you run with debug=3 in kamailio.cfg? You should see more log messages about what happens, maybe the transaction is destroyed for some reason, there are debug messages when that happens.
Cheers, Daniel
On 07.01.21 17:58, Jeremy McNamara wrote:
Hi -
route[RELAY] { if (!t_relay()) { sl_reply_error(); } }
I also call SETUP_ROUTES separately before RELAY:
route[SETUP_ROUTES] { # enable additional event routes for forwarded requests if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) { if (!t_is_set("branch_route")) { t_on_branch("MANAGE_BRANCH"); } } if (is_method("INVITE|SUBSCRIBE|UPDATE")) { if (!t_is_set("onreply_route")) { t_on_reply("MANAGE_REPLY"); } } }
On Thu, Jan 7, 2021 at 11:48 AM Jurijs Ivolga <jurijs.ivolga@gmail.com mailto:jurijs.ivolga@gmail.com> wrote:
Hi, What happens in the route[RELAY]? Maybe code after "route(RELAY)" is not executed? When there is only 1 device what value is inside $var(hstored) when the register hits Kamailio? Jurijs On Wed, Jan 6, 2021 at 4:27 AM Jeremy McNamara <mcnamara.jeremy@gmail.com <mailto:mcnamara.jeremy@gmail.com>> wrote: Hi Folks - I am attempting to set up a mobile push configuration, by following the published example(s). If we have more than one endpoint registered, this configuration works as expected (via the ts_store() path below). If we do not have another registered endpoint the transaction seems to be suspended but then cannot be resumed (t_suspend) after REGISTER arrives. INFO: <script>: [R-LOG]: INVITE from IP:[24.XXX.XXX.XXX:62665] [sip:jeremy2@stage][<null>] NFO: <script>: [R-SUSPEND]: Suspended transaction [41359:415220139] INFO: <script>: [R-SUSPEND]: fU:[jeremy] rU:[jeremy2] tU:[jeremy2] INFO: <script>: [R-SUSPEND]: fU:[jeremy] => tU:[jeremy2] INFO: <script>: [R-SUSPEND]: vtp:[41359:415220139] INFO: <script>: [R-SENDPUSH]: Push sent [(55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78][com][hq01gt5utegi18ipkh1b] [Node-Push]: About to push: 55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78 INFO: <script>: R-REGISTER]: jeremy2 registered INFO: <script>: [R-REGISTER]: Contact: [<sip:ilyartjr@qjwhdafxlbtk.invalid;transport=ws>;expires=10;app-id=stage;pn-voip-tok=55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78] INFO: <script>: [R-REGISTER]: App id: stage INFO: <script>: [R-REGISTER]: Expires: 10 INFO: <script>: [R-JOIN]: jeremy2 INFO: <script>: [R-JOIN]: Resuming trasaction [41359:415220139] jeremy2 (41359:415220139) WARNING: tm [t_suspend.c:197]: t_continue_helper(): transaction is not suspended [41359:415220139] WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [41359:415220139] failed Relvant kamailio.cfg [Note: I did notice we had to switch things up a bit if calls come from a PSTN number via SBC] modparam("htable", "htable", "vtp=>size=10;autoexpire=300") ... if (!lookup("location")) { send_reply("100", "Suspending"); route(SUSPEND); // *testing this path here * } else { route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-LOCATION]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); } ... route[SUSPEND] { if (!t_suspend()) { xlog("L_ERROR", "[R-SUSPEND]: Failed to suspend transaction [$T(id_index):$T(id_label)]\n"); send_reply("501", "Unknown Destinaton"); exit; } xlog("L_INFO", "[R-SUSPEND]: Suspended transaction [$T(id_index):$T(id_label)]\n"); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] rU:[$rU] tU:[$tU]\n"); if (isbflagset(FLB_PSTN)) { $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => rU:[$rU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$rU)]\n"); } else { $sht(vtp=>join::$tU) = "" + $T(id_index) + ":" + $T(id_label); xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] => tU:[$tU]\n"); xlog("L_INFO", "[R-SUSPEND]: vtp:[$sht(vtp=>join::$tU)]\n"); } } route[REGISTER] { if (!is_method("REGISTER")) { return; } if (isflagset(FLT_NATS)) { setbflag(FLB_NATB); } if (!save("location")) { sl_reply_error(); } route(JOIN); } # Append branches or resume the transaction route[JOIN] { xlog("L_INFO","[R-JOIN]: $tU\n"); $var(hjoin) = 0; lock("$tU"); $var(hjoin) = $sht(vtp=>join::$tU); $var(hstored) = $sht(vtp=>stored::$tU); $sht(vtp=>join::$tU) = $null; unlock("$tU"); if ($var(hjoin)==0) { if ($var(hstored)) { xlog("L_INFO","[R-JOIN]: Appending transaction ($tu)\n"); ts_append("location", "$tu"); exit; } xlog("L_INFO","[R-JOIN]: No INVITE to resume\n"); exit; } $var(id_index) = $(var(hjoin){s.select,0,:}{s.int <http://s.int>}); $var(id_label) = $(var(hjoin){s.select,1,:}{s.int <http://s.int>}); xlog("L_INFO", "[R-JOIN]: Resuming trasaction [$var(id_index):$var(id_label)] $tU ($var(hjoin))\n"); t_continue("$var(id_index)", "$var(id_label)", "RESUME"); exit; } # Lookup and relay after resuming transaction route[RESUME] { xlog("L_INFO", "[R-RESUME]: ru: [$ru] tu: [$tu]\n"); lookup("location"); route(SETUP_ROUTES); route(RELAY); ts_store("$tu"); $sht(vtp=>stored::$tU) = 1; xlog("L_INFO", "[R-RESUME]: Stored transaction [$T(id_index):$T(id_label)] $fU => $tU\n"); exit; } What did I miss? _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Thu, Jan 7, 2021 at 2:59 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
have you run with debug=3 in kamailio.cfg? You should see more log messages about what happens, maybe the transaction is destroyed for some reason, there are debug messages when that happens.
Upon deep dive today we discovered that http_async_client might be the issue and/or we need to call t_release() from within the HTTP reply handler?
16(9808) DEBUG: <core> [core/parser/msg_parser.c:620]: parse_msg(): SIP Reply (status): 16(9808) DEBUG: <core> [core/parser/msg_parser.c:622]: parse_msg(): version: <HTTP/1.1> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:624]: parse_msg(): status: <200> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:626]: parse_msg(): reason: <OK> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:185]: get_hdr_field(): content_length=2 16(9808) DEBUG: <core> [core/parser/msg_parser.c:89]: get_hdr_field(): found end of header 16(9808) DEBUG: http_async_client [async_http.c:209]: async_http_cb(): successfully parsed http reply 0x7f6c871bb3a0 16(9808) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction found 16(9808) DEBUG: http_async_client [async_http.c:235]: async_http_cb(): resuming transaction (49045:953290246) 16(9808) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction found 16(9808) INFO: <script>: [PUSH_RESPONSE]: status 200 16(9808) INFO: <script>: [PUSH_RESPONSE]: body OK 16(9808) DEBUG: dialog [dlg_var.c:97]: cb_dlg_locals_reset(): resetting the local dialog shortcuts on script callback: 2147483650 16(9808) WARNING: tm [t_lookup.c:1505]: t_unref(): script writer didn't release transaction
...
21(9813) INFO: <script>: [R-JOIN]: Resuming trasaction [49045:953290246] viaan [49045:953290246] 21(9813) DEBUG: tm [t_lookup.c:1604]: t_lookup_ident_filter(): transaction in terminated phase - skipping 21(9813) WARNING: tm [t_suspend.c:192]: t_continue_helper(): active transaction not found 21(9813) WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [49045:953290246] failed
Hi, the http async callback implicitly resumes the transaction that it's then processed in the routing script callback route. If there is no action in the callback route you'll get the message about the not released transaction. Depending on your routing logic you have two choices: 1) you don't suspend the transaction when calling http_async_query, setting $http_req(suspend)=0. 2) you suspend again the transaction in the callback route
Cheers,
Federico
On Thu, Jan 7, 2021 at 10:55 PM Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
On Thu, Jan 7, 2021 at 2:59 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
have you run with debug=3 in kamailio.cfg? You should see more log messages about what happens, maybe the transaction is destroyed for some reason, there are debug messages when that happens.
Upon deep dive today we discovered that http_async_client might be the issue and/or we need to call t_release() from within the HTTP reply handler?
16(9808) DEBUG: <core> [core/parser/msg_parser.c:620]: parse_msg(): SIP Reply (status): 16(9808) DEBUG: <core> [core/parser/msg_parser.c:622]: parse_msg(): version: <HTTP/1.1> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:624]: parse_msg(): status: <200> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:626]: parse_msg(): reason: <OK> 16(9808) DEBUG: <core> [core/parser/msg_parser.c:185]: get_hdr_field(): content_length=2 16(9808) DEBUG: <core> [core/parser/msg_parser.c:89]: get_hdr_field(): found end of header 16(9808) DEBUG: http_async_client [async_http.c:209]: async_http_cb(): successfully parsed http reply 0x7f6c871bb3a0 16(9808) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction found 16(9808) DEBUG: http_async_client [async_http.c:235]: async_http_cb(): resuming transaction (49045:953290246) 16(9808) DEBUG: tm [t_lookup.c:1612]: t_lookup_ident_filter(): transaction found 16(9808) INFO: <script>: [PUSH_RESPONSE]: status 200 16(9808) INFO: <script>: [PUSH_RESPONSE]: body OK 16(9808) DEBUG: dialog [dlg_var.c:97]: cb_dlg_locals_reset(): resetting the local dialog shortcuts on script callback: 2147483650 16(9808) WARNING: tm [t_lookup.c:1505]: t_unref(): script writer didn't release transaction
...
21(9813) INFO: <script>: [R-JOIN]: Resuming trasaction [49045:953290246] viaan [49045:953290246] 21(9813) DEBUG: tm [t_lookup.c:1604]: t_lookup_ident_filter(): transaction in terminated phase - skipping 21(9813) WARNING: tm [t_suspend.c:192]: t_continue_helper(): active transaction not found 21(9813) WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming the processing of transaction [49045:953290246] failed
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I can confirm using $http_req(suspend)=0 before calling http_async_query() resolves our issue - Thank you