<p>After more debugging, it seems that the Route header is not well regenerated from topos stored values.</p>

<p>There is a wrong additional comma at the end of the <code>Route</code> header:</p>

<p><code><sip:A.A.35.90;r2=on;lr;ftag=SD9pnva01-8c51e3a9-0001-0313-0000-0000>,</code></p>

<p>Instead of</p>

<p><code><sip:A.A.35.90;r2=on;lr;ftag=SD9pnva01-8c51e3a9-0001-0313-0000-0000></code></p>

<p>I tried to reduce sb size by replacing last character with \0, that makes it work</p>

<p><code>*(sb.s-1)='\0';</code></p>

<p>between these two lines</p>

<pre><code>638     sb.len++;
639 }
</code></pre>

<p>but leads, sometimes, to segmentation faults...</p>

<p>There is probably another way to achieve a correct header regeneration, but i don't know how.</p>

<p>Please let me know if i can give you more informations</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/716#issuecomment-236642671">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZVZBkI5vMrFiauwFNyluo8SWdwDqks5qbid3gaJpZM4JPNU8">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZerjkYUnudIB8EUppsOrS-ZcU5ULks5qbid3gaJpZM4JPNU8.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/kamailio/kamailio/issues/716#issuecomment-236642671"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>