<div dir="ltr">I am not sure about your situation, but in my case - Asterisk respond to any message, and wrong paths were corrected the way I showed.<div>By the way - I am using also rtpproxy. Although it should not interfere here at all.</div>
<div>I used wireshark on Asterisk and on Kamailio servers to find what exactly happens.</div><div>The idea is - I check  "target" (for ACK and BYE) and if target is Kamailio server, I forward package to Asterisk.</div>
<div>As I mentioned - I am not sure what exactly is wrong - with my setup, or Kamailio or Asterisk - but my go around works well for me.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 25, 2013 at 7:17 PM, anfecora <span dir="ltr"><<a href="mailto:anfecora@gmail.com" target="_blank">anfecora@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you Stoyan, i tried but i ended up creating a loop with the carrier, i believe this is more a asterisk receiving the package and ignoring the record-route and because i am just proxying the signalling it does ack to the contact, i have to find a way to tell asterisk that answer everything to kamailio and kamailio must respond to the carrier to the proper to header i am clueless here, now thinking to install rtpproxy  to achieve that, any other sugestions .<div>

thanks.</div><div><div class="h5"><div><br><div><div><br></div><div>U 2013/10/23 17:26:16.846067 <a href="http://3.1.1.1:5060" target="_blank">3.1.1.1:5060</a> -> <a href="http://1.1.1.2:5060" target="_blank">1.1.1.2:5060</a></div>
<div>SIP/2.0 200 OK.</div><div>Session-Expires: 3600;refresher=uas.</div>
<div>Require: timer.</div><div>Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0.</div><div>Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060.</div><div>Record-Route: <sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05>.</div>

<div>Record-Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>.</div><div>To: <<a href="mailto:sip%3A76890723276341079@3.1.1.1" target="_blank">sip:76890723276341079@3.1.1.1</a>>;tag=3591552407-393967.</div><div>From: "+19812457865" <<a href="mailto:sip%3A%2B19812457865@1.1.1.1" target="_blank">sip:+19812457865@1.1.1.1</a>>;tag=as4bc322e9.</div>

<div>Call-ID: <a href="http://7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060" target="_blank">7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060</a>.</div><div>CSeq: 102 INVITE.</div><div>Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE.</div>

<div>Contact: <<a href="http://sip:76890723276341079@3.1.1.2:5060" target="_blank">sip:76890723276341079@3.1.1.2:5060</a>>.</div><div>Call-Info: <sip:3.1.1.2>;method="NOTIFY;Event=telephone-event;Duration=1000".</div>

<div>Allow-Events: telephone-event.</div><div>Content-Type: application/sdp.</div><div>Content-Length: 202.</div><div>.</div><div>v=0.</div><div>o=MSXB 4755 8544 IN IP4 3.1.1.2.</div><div>s=sip call.</div><div>c=IN IP4 204.15.40.111.</div>

<div>t=0 0.</div><div>m=audio 33408 RTP/AVP 0 101.</div><div>a=rtpmap:0 PCMU/8000.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-16.</div><div>a=ptime:20.</div><div><br></div><div><br></div><div>U 2013/10/23 17:26:16.846201 <a href="http://1.1.1.2:5060" target="_blank">1.1.1.2:5060</a> -> <a href="http://1.1.1.1:5060" target="_blank">1.1.1.1:5060</a></div>

<div>SIP/2.0 200 OK.</div><div>Session-Expires: 3600;refresher=uas.</div><div>Require: timer.</div><div>Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060.</div><div>Record-Route: <sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05>.</div>

<div>Record-Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>.</div><div>To: <<a href="mailto:sip%3A76890723276341079@3.1.1.1" target="_blank">sip:76890723276341079@3.1.1.1</a>>;tag=3591552407-393967.</div><div>From: "+19812457865" <<a href="mailto:sip%3A%2B19812457865@1.1.1.1" target="_blank">sip:+19812457865@1.1.1.1</a>>;tag=as4bc322e9.</div>

<div>Call-ID: <a href="http://7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060" target="_blank">7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060</a>.</div><div>CSeq: 102 INVITE.</div><div>Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE.</div>

<div>Contact: <<a href="http://sip:76890723276341079@3.1.1.2:5060" target="_blank">sip:76890723276341079@3.1.1.2:5060</a>>.</div><div>Call-Info: <sip:3.1.1.2>;method="NOTIFY;Event=telephone-event;Duration=1000".</div>

<div>Allow-Events: telephone-event.</div><div>Content-Type: application/sdp.</div><div>Content-Length: 202.</div><div>.</div><div>v=0.</div><div>o=MSXB 4755 8544 IN IP4 3.1.1.2.</div><div>s=sip call.</div><div>c=IN IP4 204.15.40.111.</div>

<div>t=0 0.</div><div>m=audio 33408 RTP/AVP 0 101.</div><div>a=rtpmap:0 PCMU/8000.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-16.</div><div>a=ptime:20.</div><div><br></div><div><br></div><div>T 2013/10/23 17:26:16.846287 <a href="http://1.1.1.2:55305" target="_blank">1.1.1.2:55305</a> -> <a href="http://10.0.3.54:3306" target="_blank">10.0.3.54:3306</a> [AP]</div>

<div>.....insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,from_uri,to_uri,kekuintid,type_call,dst_ip,carriercode,callmode ) values ('INVITE','as4bc322e9','3591552407-393967','<a href="http://7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060" target="_blank">7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060</a>','200','OK','2013-10-23 17:26:16','<a href="mailto:sip%3A%2B19812457865@1.1.1.1" target="_blank">sip:+19812457865@1.1.1.1</a>','<a href="mailto:sip%3A23276341079@2.0.0.1" target="_blank">sip:23276341079@2.0.0.1</a>','+19812457865','1.1.1.1','<a href="http://sip:76890723276341079@3.1.1.1:5060" target="_blank">sip:76890723276341079@3.1.1.1:5060</a>','<a href="mailto:sip%3A23276341079@2.0.0.1" target="_blank">sip:23276341079@2.0.0.1</a>','OUT')</div>

<div><br></div><div>U 2013/10/23 17:26:16.847421 <a href="http://1.1.1.1:5060" target="_blank">1.1.1.1:5060</a> -> <a href="http://1.1.1.2:5060" target="_blank">1.1.1.2:5060</a></div><div>ACK <a href="http://sip:76890723276341079@3.1.1.2:5060" target="_blank">sip:76890723276341079@3.1.1.2:5060</a> SIP/2.0.</div>

<div>Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK05b1c5df;rport.</div><div>Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>,<sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05>.</div><div>Max-Forwards: 70.</div><div>From: "+19812457865" <<a href="mailto:sip%3A%2B19812457865@1.1.1.1" target="_blank">sip:+19812457865@1.1.1.1</a>>;tag=as4bc322e9.</div>

<div>To: <<a href="mailto:sip%3A23276341079@2.0.0.1" target="_blank">sip:23276341079@2.0.0.1</a>>;tag=3591552407-393967.</div><div>Contact: <<a href="http://sip:+19812457865@1.1.1.1:5060" target="_blank">sip:+19812457865@1.1.1.1:5060</a>>.</div>

<div>Call-ID: <a href="http://7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060" target="_blank">7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060</a>.</div><div>CSeq: 102 ACK.</div><div>User-Agent: Asterisk PBX 1.8.15-cert2.</div>
<div>Content-Length: 0.</div>
<div>.</div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Thu, Oct 24, 2013 at 12:59 PM, Stoyan Mihaylov <span dir="ltr"><<a href="mailto:stoyan.v.mihaylov@gmail.com" target="_blank">stoyan.v.mihaylov@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra">I had same problem - with BYE also.</div><div class="gmail_extra">
My "go around" was (replaced name of domain and IP of kamailio):</div>
<div class="gmail_extra"><div class="gmail_extra">
<br></div><div class="gmail_extra">route[ACKBYE] {</div><div class="gmail_extra">#!ifdef WITH_MYFORWARD</div><div class="gmail_extra"><span style="white-space:pre-wrap">       </span>if(($sht(forw=>$ft))=~$td){</div><div class="gmail_extra">


<span style="white-space:pre-wrap">             </span>$du=$sht(forw=>$ft);</div><div class="gmail_extra"><span style="white-space:pre-wrap">    </span>}else if((($td=="<a href="http://name.of.company.com" target="_blank">name.of.company.com</a>")||($td=="ip"))&&($si=="ip")){</div>


<div class="gmail_extra"><span style="white-space:pre-wrap">            </span>$du=$sht(forw=>$ft);</div><div class="gmail_extra"><span style="white-space:pre-wrap">            </span>return;</div><div class="gmail_extra"><span style="white-space:pre-wrap">    </span>}</div>


<div class="gmail_extra">#!endif</div><div class="gmail_extra"><span style="white-space:pre-wrap">        </span>return;</div><div class="gmail_extra">}</div><div><br></div><div><div>route[PSTNINVITE] {</div><div>#!ifdef WITH_MYFORWARD</div>


<div><span style="white-space:pre-wrap">  </span>if(is_method("INVITE")){</div><div><span style="white-space:pre-wrap">               </span>ds_select_dst("1","4");</div><div><span style="white-space:pre-wrap">              </span>$sht(forw=>$ft)=$du;</div>


<div><span style="white-space:pre-wrap">          </span>sl_send_reply("100","Trying");</div><div><span style="white-space:pre-wrap">               </span>route(RELAY);</div><div><span style="white-space:pre-wrap">            </span>exit();</div>


<div><span style="white-space:pre-wrap">  </span>}</div><div>#!endif</div><div><br></div><div>return;</div><div>}</div></div><div><br></div><div>Meaning - during invite, I store du (to allow more then one Asterisk behind kamailio)</div>


<div>and on ACK or BYE - I check td and si. Not sure I am correct, but it works from long time, although load is not high.</div><div>PS</div><div>You will need to set in the beginning</div><div><div>modparam("htable", "htable", "forw=>size=8;autoexpire=7200;")</div>


</div><div><br></div><div>and you need to put routes in proper places.</div></div></div>
<br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>