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 "mask" 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=~"^sip:(00|011|09|555|995|996|997|998)[0-9]*@") </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("1")){<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("sip:8647242678@my_gateway_ip");</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'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 'ZTYwMjliN2Y5NDM0OWQzY2Y3MjUwMWU2YWM3MGFhNDQ.' and tags 'a29f6e3e' 'as5065f2a1' </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 ------></div><div> <----- trying, ringing</div>
<div>BYE -------> </div><div><br></div><div>The BYE message is being send bye the UAC instead of a CANCEL message. I don'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'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 -> opensips_ip:5060</div>
<div>INVITE sip:0013202292xxx@opensips_ip:5060 SIP/2.0.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>.</div><div>From: "V0811162536019339921"<sip:8664606xxx@x.x.x.x:5060>;tag=a29f6e3e.</div><div>
<br></div><div># </div><div>U opensips_ip:5060 -> gateway_ip:5060</div><div>INVITE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div>
<div><br></div><div>U gateway_ip:5060 -> opensips_ip:5060</div><div>SIP/2.0 180 Ringing.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div>
<div><br></div><div>#</div><div>U opensips_ip:5060 -> x.x.x.x:5060</div><div>SIP/2.0 180 Ringing.</div><div>From: "V0811162536019339921"<sip:8664606xxx@x.x.x.x:5060>;tag=a29f6e3e.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div>
<div><br></div><div>U x.x.x.x:5060 -> opensips_ip:5060</div><div>BYE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div><div>From: "V0811162536019339921"<sip:8664606xxx@x.x.x.x:5060>;tag=a29f6e3e.</div>
<div><br></div><div>#</div><div>U opensips_ip:5060 -> gateway_ip:5060</div><div>BYE sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div>
<div><br></div><div>#</div><div>U gateway_ip:5060 -> opensips_ip:5060</div><div>SIP/2.0 487 Request Terminated.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div><div>
To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div><div><br></div><div>#</div><div>U gateway_ip:5060 -> opensips_ip:5060</div><div>SIP/2.0 200 OK.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div>
<div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div><div><br></div><div>#</div><div>U opensips_ip:5060 -> gateway_ip:5060</div><div>ACK sip:0013202292xxx@gateway_ip SIP/2.0.</div><div>From: "V0811162536019339921"<sip:8647242xxx@gateway_ip>;tag=a29f6e3e.</div>
<div>Call-ID: ZTYwMjliN2Y5NDM0OWQzY2Y3MjUwMWU2YWM3MGFhNDQ..</div><div>To: <sip:0013202292xxx@opensips_ip:5060>;tag=as5065f2a1.</div></div><div><br></div><div><br></div><div><br></div>