<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>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.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 07.01.21 17:58, Jeremy McNamara
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAO0X5JRjBueBhJrmoYey39L9J62vaG1T-5k4kSDQHC716G=f-Q@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi - 
        <div><br>
        </div>
        <div><font face="monospace">route[RELAY] {<br>
             if (!t_relay()) {<br>
                sl_reply_error();<br>
             }<br>
            }<br>
          </font><br>
          I also call SETUP_ROUTES separately before RELAY:<br>
          <br>
          <font face="monospace">route[SETUP_ROUTES] {<br>
               # enable additional event routes for forwarded requests<br>
               if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {<br>
                  if (!t_is_set("branch_route")) {<br>
                     t_on_branch("MANAGE_BRANCH");<br>
                  }<br>
               }<br>
               if (is_method("INVITE|SUBSCRIBE|UPDATE")) {<br>
                  if (!t_is_set("onreply_route")) {<br>
                    t_on_reply("MANAGE_REPLY");<br>
                  }<br>
               }<br>
            }</font><br>
        </div>
        <div><font face="monospace"><br>
          </font></div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Jan 7, 2021 at 11:48
          AM Jurijs Ivolga <<a href="mailto:jurijs.ivolga@gmail.com"
            moz-do-not-send="true">jurijs.ivolga@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div>Hi,</div>
            <div><br>
            </div>
            <div>What happens in the route[RELAY]?</div>
            <div><br>
            </div>
            <div>Maybe code after "route(RELAY)" is not executed?</div>
            <div><br>
            </div>
            <div>When there is only 1 device what value is inside
              $var(hstored) when the register hits Kamailio?<br>
            </div>
            <div><br>
            </div>
            <div>
              <div>
                <div dir="ltr">
                  <div dir="ltr">Jurijs<br>
                  </div>
                </div>
              </div>
              <br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Wed, Jan 6, 2021 at
              4:27 AM Jeremy McNamara <<a
                href="mailto:mcnamara.jeremy@gmail.com" target="_blank"
                moz-do-not-send="true">mcnamara.jeremy@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div><font face="monospace">Hi Folks - I am attempting
                    to set up a mobile push configuration, by following
                    the published example(s).  </font></div>
                <div><font face="monospace"><br>
                  </font></div>
                <div><font face="monospace">If we have more than one
                    endpoint registered, this configuration works as
                    expected (via the ts_store() path below).  </font></div>
                <div><font face="monospace"><br>
                  </font></div>
                <div><font face="monospace">If we do not have another
                    registered endpoint the transaction seems to be
                    suspended but then cannot be resumed (t_suspend)
                    after REGISTER arrives. </font></div>
                <font face="monospace">
                  <div><font face="monospace"><br>
                    </font></div>
                  <div><font face="monospace"><br>
                    </font></div>
                  INFO: <script>: [R-LOG]: INVITE from
                  IP:[24.XXX.XXX.XXX:62665]
                  [<a class="moz-txt-link-freetext" href="sip:jeremy2@stage">sip:jeremy2@stage</a>][<null>]<br>
                  NFO: <script>: [R-SUSPEND]: Suspended
                  transaction [41359:415220139]<br>
                  INFO: <script>: [R-SUSPEND]: fU:[jeremy]
                  rU:[jeremy2] tU:[jeremy2]<br>
                  INFO: <script>: [R-SUSPEND]: fU:[jeremy] =>
                  tU:[jeremy2]<br>
                  INFO: <script>: [R-SUSPEND]:
                  vtp:[41359:415220139]<br>
                  INFO: <script>: [R-SENDPUSH]: Push sent
[(55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78][com][hq01gt5utegi18ipkh1b]<br>
                  [Node-Push]: About to push:
                  55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78<br>
                  INFO: <script>: R-REGISTER]: jeremy2 registered<br>
                  INFO: <script>: [R-REGISTER]: Contact:
[<a class="moz-txt-link-rfc2396E" href="sip:ilyartjr@qjwhdafxlbtk.invalid;transport=ws"><sip:ilyartjr@qjwhdafxlbtk.invalid;transport=ws></a>;expires=10;app-id=stage;pn-voip-tok=55516cc061038f1283104abb39072a59107b7d8e13a1fd166b1704a315d07f78]<br>
                  INFO: <script>: [R-REGISTER]: App id: stage<br>
                  INFO: <script>: [R-REGISTER]: Expires: 10<br>
                  INFO: <script>: [R-JOIN]: jeremy2<br>
                  INFO: <script>: [R-JOIN]: Resuming trasaction
                  [41359:415220139] jeremy2 (41359:415220139)<br>
                  WARNING: tm [t_suspend.c:197]: t_continue_helper():
                  transaction is not suspended [41359:415220139]<br>
                  WARNING: tmx [tmx_mod.c:847]: w_t_continue(): resuming
                  the processing of transaction [41359:415220139] failed<br>
                  <br>
                  <br>
                  Relvant kamailio.cfg <br>
                  [Note: I did notice we had to switch things up a bit
                  if calls come from a PSTN number via SBC]<br>
                  <br>
                  <br>
                  modparam("htable", "htable",
                  "vtp=>size=10;autoexpire=300")</font>
                <div><font face="monospace"><br>
                  </font></div>
                <div><font face="monospace">...<br>
                    if (!lookup("location")) {<br>
                            send_reply("100", "Suspending");<br>
                            route(SUSPEND); // <b>testing this path
                      here </b><br>
                        } else {<br>
                            route(RELAY);<br>
                            ts_store("$tu");<br>
                            $sht(vtp=>stored::$tU) = 1;<br>
                           xlog("L_INFO", "[R-LOCATION]: Stored
                    transaction      [$T(id_index):$T(id_label)] $fU
                    => $tU\n");<br>
                        }      <br>
                    ...<br>
                    <br>
                    route[SUSPEND] {<br>
                        if (!t_suspend()) {<br>
                            xlog("L_ERROR", "[R-SUSPEND]: Failed to
                    suspend transaction [$T(id_index):$T(id_label)]\n");<br>
                            send_reply("501", "Unknown Destinaton");<br>
                            exit;<br>
                        }<br>
                        xlog("L_INFO", "[R-SUSPEND]: Suspended
                    transaction [$T(id_index):$T(id_label)]\n");<br>
                        xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] rU:[$rU]
                    tU:[$tU]\n");<br>
                        if (isbflagset(FLB_PSTN)) {<br>
                           $sht(vtp=>join::$rU) = "" + $T(id_index) +
                    ":" + $T(id_label);<br>
                           xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] =>
                    rU:[$rU]\n");<br>
                           xlog("L_INFO", "[R-SUSPEND]:
                    vtp:[$sht(vtp=>join::$rU)]\n");<br>
                        } else {<br>
                           $sht(vtp=>join::$tU) = "" + $T(id_index) +
                    ":" + $T(id_label);<br>
                           xlog("L_INFO", "[R-SUSPEND]: fU:[$fU] =>
                    tU:[$tU]\n");<br>
                           xlog("L_INFO", "[R-SUSPEND]:
                    vtp:[$sht(vtp=>join::$tU)]\n");<br>
                        }<br>
                    }<br>
                    <br>
                    route[REGISTER] {<br>
                       if (!is_method("REGISTER")) {<br>
                         return;<br>
                       }<br>
                       if (isflagset(FLT_NATS)) {<br>
                            setbflag(FLB_NATB);<br>
                       }<br>
                       if (!save("location")) {<br>
                          sl_reply_error();<br>
                       }<br>
                        route(JOIN);<br>
                    }<br>
                    <br>
                    # Append branches or resume the transaction<br>
                    route[JOIN] {<br>
                        xlog("L_INFO","[R-JOIN]: $tU\n");<br>
                        $var(hjoin) = 0;<br>
                        lock("$tU");<br>
                        $var(hjoin) = $sht(vtp=>join::$tU);<br>
                        $var(hstored) = $sht(vtp=>stored::$tU);<br>
                        $sht(vtp=>join::$tU) = $null;<br>
                        unlock("$tU");<br>
                        if ($var(hjoin)==0) {<br>
                           if ($var(hstored)) {<br>
                              xlog("L_INFO","[R-JOIN]: Appending
                    transaction ($tu)\n");  <br>
                              ts_append("location", "$tu");<br>
                              exit;<br>
                           }<br>
                           xlog("L_INFO","[R-JOIN]: No INVITE to
                    resume\n");  <br>
                           exit;<br>
                        }<br>
                        $var(id_index) = $(var(hjoin){s.select,0,:}{<a
                      href="http://s.int" target="_blank"
                      moz-do-not-send="true">s.int</a>});<br>
                        $var(id_label) = $(var(hjoin){s.select,1,:}{<a
                      href="http://s.int" target="_blank"
                      moz-do-not-send="true">s.int</a>});<br>
                        xlog("L_INFO", "[R-JOIN]: Resuming trasaction
                    [$var(id_index):$var(id_label)] $tU
                    ($var(hjoin))\n");<br>
                        t_continue("$var(id_index)", "$var(id_label)",
                    "RESUME");<br>
                        exit;<br>
                    }<br>
                    <br>
                    # Lookup and relay after resuming transaction<br>
                    route[RESUME] {<br>
                        xlog("L_INFO", "[R-RESUME]: ru: [$ru] tu:
                    [$tu]\n");<br>
                        lookup("location");<br>
                        route(SETUP_ROUTES);<br>
                        route(RELAY);<br>
                        ts_store("$tu");<br>
                        $sht(vtp=>stored::$tU) = 1;<br>
                        xlog("L_INFO", "[R-RESUME]: Stored transaction
                    [$T(id_index):$T(id_label)] $fU => $tU\n");<br>
                        exit;<br>
                    }</font>
                  <div><font face="monospace"><br>
                    </font></div>
                  <div><font face="monospace"><br>
                    </font></div>
                  <div><font face="monospace">What did I miss? </font></div>
                  <div><font face="monospace"><br>
                    </font></div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                </div>
              </div>
              _______________________________________________<br>
              Kamailio (SER) - Users Mailing List<br>
              <a href="mailto:sr-users@lists.kamailio.org"
                target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
              <a
                href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            </blockquote>
          </div>
          _______________________________________________<br>
          Kamailio (SER) - Users Mailing List<br>
          <a href="mailto:sr-users@lists.kamailio.org" target="_blank"
            moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
          <a
            href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>