<div dir="ltr"><div>Hi</div><div><br></div><div>You could find opensips logs here (log_level=3)</div><div><a href="https://pastebin.com/Gmq3BLkt">https://pastebin.com/Gmq3BLkt</a><br></div><div><br></div><div>And here I tried to extract last BYE proceed from logs in debug mode (log_level=4)</div><div><a href="https://pastebin.com/exyVuqj0">https://pastebin.com/exyVuqj0</a><br></div><div><br></div><div><br></div><div>I am using load balancer to send requests to one of 2 freeswitches.</div><div>Both users (<span style="color:rgb(51,51,51);font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono",monospace,serif;font-size:12px">USER_1 and </span><span style="color:rgb(51,51,51);font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono",monospace,serif;font-size:12px">USER_2</span>) are webrtc users.</div><div>After opensips restart both clients reconnects and re-register, you could find it in logs.</div><div>First routing of BYE from webrtc to freeswitch is successful, but secondary from freeswitch to another client fails.</div><div><br></div><div><br></div><div>Below is a part of my routing for totag.</div><div>It works fine till I restart opensips.</div><div>I expect to see in log "t_relay error" message, but it is not there.</div><div><br></div><div><div>if (has_totag())</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>xlog("L_ERR", "Following ToTag: $tt $proto");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>if (loose_route())<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>{<span style="white-space:pre">                    </span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                       </span>xlog("L_ERR", "loose_route success\n");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                    </span>if (!t_relay())</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>xlog("L_ERR", "t_relay error [$du]");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>send_reply("500","Internal Error");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>else</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>xlog("L_ERR", "loose_route fail\n");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                       </span>if ( is_method("ACK") )</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>if ( t_check_trans() )</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                         </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                      </span>t_relay();<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                   </span>exit;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                          </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>else</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                           </span>{</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                      </span>exit;<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>sl_send_reply("404","Not here");</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>exit;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>}</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-26 16:05 GMT+07:00 Răzvan Crainea <span dir="ltr"><<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <tt>Are you sure t_relay() is not returning an error? Can you post
      somewhere the entire log for this scenario?<br>
      <br>
      Best regards,<br>
    </tt><span class="">
    <pre class="m_2413552471833867704moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="m_2413552471833867704moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre>
    </span><div><div class="h5"><div class="m_2413552471833867704moz-cite-prefix">On 04/26/2017 12:00 PM, Mikhail Sidorov
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div>I am sorry for spamming you, I missed subscription
        verification email.</div>
      <div><br>
      </div>
      <div>Regarding my question, I understand that opensips could not
        recover connection and my client already reconnect.</div>
      <div>All I need is ability to catch this error to execute lookup
        and find reconnected client.</div>
      <div>And I could not find how to detect this kind of failure,
        because t_relay does not return error.</div>
      <div>Do you have any suggestions?</div>
      <div><br>
        <div class="gmail_quote">
          <div>ср, 26 апр. 2017 г. в 15:49, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>>:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> <tt>Hi, Mikhail!<br>
                <br>
                I've already replied to your question[1]. Please
                register to the opensips list if you want to get further
                emails.<br>
                <br>
                [1] <a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext" href="http://lists.opensips.org/pipermail/users/2017-April/037179.html" target="_blank">http://lists.opensips.org/<wbr>pipermail/users/2017-April/<wbr>037179.html</a><br>
                <br>
                Best regards,<br>
              </tt>
              <pre class="m_2413552471833867704m_-4476057297123752540moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <div class="m_2413552471833867704m_-4476057297123752540moz-cite-prefix">On
                04/26/2017 11:05 AM, Mikhail Sidorov wrote:<br>
              </div>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <blockquote type="cite">
                <div>
                  <div class="gmail_quote">
                    <div>Hi
                      <div><br>
                      </div>
                      <div>I am using opensips 2.2.3 to handle websocket
                        connections from web client (sip.js).</div>
                      <div>I just started testing recover after opensips
                        restart and find that I could not handle
                        t_relay() failure.</div>
                      <div><br>
                      </div>
                      <div>Assume I have a call between 2 webrtc clients
                        and I restart opensips during this call. Media
                        handled by freeswitch, so call continue without
                        problem.</div>
                      <div><br>
                      </div>
                      <div>Then, one client send BYE. I use loose_route
                        to find another party and send him message.</div>
                      <div>But here I got error that I could not handle.</div>
                      <div>t_on_failure trigger does not fire</div>
                      <div>t_relay return success.<br>
                      </div>
                      <div><br>
                      </div>
                      <div>Are there any special flags or triggers to
                        handle this case?</div>
                      <div><br>
                      </div>
                      <div>Opensips log:</div>
                      <div><br>
                      </div>
                      <div>
                        <div>loose_route success</div>
                        <div><a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext">INFO:core:probe_max_sock_buff</a>:
                          using snd buffer of 416 kb</div>
                        <div><a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext">INFO:core:init_sock_keepalive</a>:
                          TCP keepalive enabled on socket 16</div>
                        <div>ERROR:core:tcp_connect_<wbr>blocking: poll
                          error: flags 28 - 4 8 16 32</div>
                        <div>ERROR:core:tcp_connect_<wbr>blocking: failed to
                          retrieve SO_ERROR [server=<a href="http://172.19.235.225:62594" target="_blank">172.19.235.225:62594</a>]
                          (111) Connection refused</div>
                        <div>ERROR:proto_<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext">wss:ws_sync_</a>connec<wbr>t:
                          tcp_blocking_connect failed</div>
                        <div>ERROR:proto_<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext">wss:ws_connect</a>:
                          connect failed</div>
                        <div>ERROR:proto_<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext">wss:proto_wss_</a>send<wbr>:
                          connect failed</div>
                        <div>ERROR:tm:msg_send: send() for proto 6
                          failed</div>
                        <div>ERROR:tm:t_forward_nonack: sending request
                          failed</div>
                      </div>
                      <div><br>
                      </div>
                      <div>My configuration:</div>
                      <div><br>
                      </div>
                      <div>
                        <div>if (has_totag())</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>xlog("L_ERR",
                          "Following ToTag: $tt $proto");</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>#
                          sequential requests within a dialog should</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>#
                          take the path determined by record-routing</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>if
                          (loose_route())</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>#if
                          (is_method("INVITE"))</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>#{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>#<span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>record_route();</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>#}</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>xlog("L_ERR",
                          "loose_route success\n");</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>route(relay);</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>}</div>
                      </div>
                      <div>------------------------------<wbr>--</div>
                      <div>
                        <div>route[relay]</div>
                        <div>{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>t_on_failure("loose_route");</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>if
                          (!t_relay())</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>xlog("L_ERR",
                          "t_relay error]");</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>send_reply("500","Internal
                          Error");</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>}</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>exit;</div>
                        <div>}</div>
                      </div>
                      <div><br>
                      </div>
                      <div>
                        <div>failure_route[loose_route]</div>
                        <div>{</div>
                        <div><span class="m_2413552471833867704m_-4476057297123752540m_-5810722503261170666gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>xlog(
                          "L_ERR", "loose_route failed" );</div>
                      </div>
                      <div>...</div>
                      <div>}</div>
                      <div><br>
                      </div>
                    </div>
                  </div>
                  <br>
                </div>
                <br>
                <fieldset class="m_2413552471833867704m_-4476057297123752540mimeAttachmentHeader"></fieldset>
                <br>
              </blockquote>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <blockquote type="cite">
                <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_2413552471833867704m_-4476057297123752540moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="m_2413552471833867704mimeAttachmentHeader"></fieldset>
      <br>
      <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_2413552471833867704moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_2413552471833867704moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>