Hi all<div>I need some help with an error that have been for three days in my log.</div><div><br></div><div>This is the situation; I needed to &quot;mask&quot; the from header of everything that comes from a given ip address. So, everything that comes from ip address x.x.x.x, with from header: anypeer@x.x.x.x, opensips change the from header to <a href="mailto:sip%3Aotherpeer@mydomain.com">sip:otherpeer@mydomain.com</a> </div>
<div><br></div><div>These are the lines of interest in opensips.cfg</div><div><br></div><div><div>#--- Routing to the PSTN section ---#</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (uri=~&quot;^sip:(00|011|09|555|995|996|997|998)[0-9]*@&quot;) </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>  <span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if(check_source_address(&quot;1&quot;)){<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>uac_replace_from(&quot;sip:8647242678@my_gateway_ip&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>route(1);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<br>Now, some calls coming from this ip, are established without problems, but some other don&#39;t showing this error
</div><div><br></div><div><div>Aug 11 15:26:04 ippbx /sbin/opensips[6507]: Pattern recognized: PSTN  </div><div>Aug 11 15:26:04 ippbx /sbin/opensips[6507]: Call from sip:8664606yyy@x.x.x.x:5060 to sip:0013202292yyy@opensips_ip:5060  </div>
<div>Aug 11 15:26:04 ippbx /sbin/opensips[6507]: Rewriting host to asterisk-gw </div><div>Aug 11 15:26:04 ippbx /sbin/opensips[6507]: new branch at sip:0013202292yyy@gateway_ip </div><div>Aug 11 15:26:06 ippbx /sbin/opensips[6508]: <b>CRITICAL:dialog:log_next_state_dlg: bogus event 7 in state 2 for dlg 0xafbd4c14 [3328:832429994] with clid &#39;ZTYwMjliN2Y5NDM0OWQzY2Y3MjUwMWU2YWM3MGFhNDQ.&#39; and tags &#39;a29f6e3e&#39; &#39;as5065f2a1&#39; </b></div>
</div><div><b><br></b></div><div>Now, doing some google on that error, i found out that it is caused by a BYE sending before a call is established, something like this:</div><div>INVITE  ------&gt;</div><div>            &lt;----- trying, ringing</div>
<div>BYE     -------&gt;     </div><div><br></div><div>The BYE message is being send bye the UAC instead of a CANCEL message. I don&#39;t know why, it seems to be a UAC missfunctioning</div><div><br></div><div>As I said before, not every call coming from this ip fails in this error. And it is not a problem of a single peer or group of peers. Sometimes peer 123456 succeds and sometimes don&#39;t.</div>
<div>I<b>s there something else i can check in opensips that i am missing out?</b></div><div><br></div><div><br></div><div>Here a capture of packets of one call that give error. </div><div><br></div><div><div>U x.x.x.x:5060 -&gt; opensips_ip:5060</div>
<div>INVITE sip:0013202292xxx@opensips_ip:5060 SIP/2.0.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8664606xxx@x.x.x.x:5060&gt;;tag=a29f6e3e.</div><div>
<br></div><div># </div><div>U opensips_ip:5060 -&gt; gateway_ip:5060</div><div>INVITE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div>
<div><br></div><div>U gateway_ip:5060 -&gt; opensips_ip:5060</div><div>SIP/2.0 180 Ringing.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div>
<div><br></div><div>#</div><div>U opensips_ip:5060 -&gt; x.x.x.x:5060</div><div>SIP/2.0 180 Ringing.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8664606xxx@x.x.x.x:5060&gt;;tag=a29f6e3e.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div>
<div><br></div><div>U x.x.x.x:5060 -&gt; opensips_ip:5060</div><div>BYE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8664606xxx@x.x.x.x:5060&gt;;tag=a29f6e3e.</div>
<div><br></div><div>#</div><div>U opensips_ip:5060 -&gt; gateway_ip:5060</div><div>BYE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div>
<div><br></div><div>#</div><div>U gateway_ip:5060 -&gt; opensips_ip:5060</div><div>SIP/2.0 487 Request Terminated.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div><div>
To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div><div><br></div><div>#</div><div>U gateway_ip:5060 -&gt; opensips_ip:5060</div><div>SIP/2.0 200 OK.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div>
<div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div><div><br></div><div>#</div><div>U opensips_ip:5060 -&gt; gateway_ip:5060</div><div>ACK sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>From: &quot;V0811162536019339921&quot;&lt;sip:8647242xxx@gateway_ip&gt;;tag=a29f6e3e.</div>
<div>Call-ID: ZTYwMjliN2Y5NDM0OWQzY2Y3MjUwMWU2YWM3MGFhNDQ..</div><div>To: &lt;sip:0013202292xxx@opensips_ip:5060&gt;;tag=as5065f2a1.</div></div><div><br></div><div><br></div><div><br></div>