<p>I am using opensips 2.2-dev git revision: <a href="https://github.com/OpenSIPS/opensips/commit/0faac6ad01ac0655cd4e41f73c7a2cf2afd04fb2" class="commit-link"><tt>0faac6a</tt></a> and I am seeing issues when sending a request to second  route for failover purpose(AS server) When the source is a WS client. I am using sipjs version 0.7.1</p>

<p>within this 2nd route i'm specifying (sip:ip:port) but opensips is sending this request as a websocket. </p>

<p>which concludes in this error:</p>

<p>CRITICAL:proto_ws:ws_server_handshake</p>

<p>Only when the request  goes from the failure route to the failover route. In the event that I route the request directly to the 2nd route upon failure to find the AOR entry for the user from the main route.  Opensips does send the request go to AS server as a sip request. Another note to add is that opensips does not revert the ruri . In the case of sipjs it utilizes a random string for contact entries upon registration. Opensips uses this as the ruri when making the request it does not revert them upon failure route consequently the request reaches  failover route with this ruri as well. Can I use  revert_uri();</p>

<p>in this case? within the failover route?</p>

<p>What can be done over the fact that the request is being sent to the AS server as a ws?</p>

<p>Here is a debug log of the issue.</p>

<p><a href="https://drive.google.com/file/d/0B1yz74eTHZFPV0Q0NmtObmw1aEU/view?usp=sharing">https://drive.google.com/file/d/0B1yz74eTHZFPV0Q0NmtObmw1aEU/view?usp=sharing</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/645">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciTQDuEXny83rVAB50S25iO1-gC0Rks5o0XOPgaJpZM4GBume.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/645"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>