<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000066">
    Hello;<br>
        before sending this email i searched on google and doesnt solve
    this issue. all call flows are correct but one call that this isnt
    working right. it sends to <u>wrong port</u> to ACK for 200 OK. i
    tried to fix contact header or remove contact header but it wasnt
    work. i looked at ietf for ACK and couldnt figure out why it
    happens. <br>
    Does it need add a record route or remove Contact Header for every
    ack ?<br>
    <br>
    <br>
    Thanks for help.<br>
    <br>
    i figure out  Kamailio-2 adds a Route header to ACK packet for
    sending Kamailio-1:5060, even if it doesnt add any command for it 
    in cfg.<br>
    <br>
    Here is call flow<br>
    <br>
    Asterisk and Kamailio is on the same ip and machine and public ip.
    different are ports. Kamailio-1 is another machine<br>
    <br>
    <br>
    INVITE : UAC1----->
    Kamailio-1:5060----->Kamailio-2:5061--->Asterisk:5060<br>
    <br>
    200 OK:  UAC1<-----
    Kamailio-1:5060<-----Kamailio-2:5061<---Asterisk:5060<br>
    <br>
    ACK    : UAC1----->
    Kamailio-1:5060----->Kamailio-2:5061--->Asterisk:10432<br>
    <br>
    200 OK:  UAC1<-----
    Kamailio-1:5060<-----Kamailio-2:5061<---Asterisk:5060<br>
    <br>
    ACK    : UAC1----->
    Kamailio-1:5060----->Kamailio-2:5061--->Asterisk:10432<br>
    <br>
    Retransmission.......<br>
    <br>
    <br>
    Here is ACK packet, is it about<u> port on RU?</u><br>
    <br>
    <br>
    Asteriskip:5060----------->Kamailio2-ip:5061<br>
    <br>
    SIP/2.0 200 OK<br>
    Via: SIP/2.0/UDP
kamailio2-ip:5061;branch=z9hG4bK4d2f.837f45483db59574c4dd70f70f8d0099.0;received=kamailio2-ip;rport=5061<br>
    Via: SIP/2.0/UDP
    kamailio1-ip-main;branch=z9hG4bK4d2f.fb781e8caa5f96426c82530a23c0cc97.0<br>
    Via: SIP/2.0/UDP
    uacip:5060;received=uacip;branch=z9hG4bK143c7384;rport=10432<br>
    Record-Route:
<sip:kamailio2-ip:5061;lr;ftag=as1c529e28;did=304.35c1;vsf=AAAAAAoBAQMLBQ4GAQN2A3kDFgQYABYeGRoyMDM-><br>
    Record-Route: <sip:kamailio1-ip-main;lr;ftag=as1c529e28><br>
    From: 903122977162
    <sip:903122977162@kamailio2-ip>;tag=as1c529e28<br>
    To: <a class="moz-txt-link-rfc2396E" href="mailto:sip:03129110911@tstxyz.netgsm.com.tr"><sip:03129110911@tstxyz.netgsm.com.tr></a>;tag=as39358508<br>
    Call-ID: 169f342556f4e956445dfe0e2ee8ecf2@uacip:5060<br>
    CSeq: 103 INVITE<br>
    Server: sipgw2<br>
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
    INFO, PUBLISH, MESSAGE<br>
    Supported: replaces, timer<br>
    Session-Expires: 1800;refresher=uas<br>
    Contact: <sip:10213129110911@kamailio2-ip:5060><br>
    Content-Type: application/sdp<br>
    Require: timer<br>
    Content-Length: 305<br>
    <br>
    v=0<br>
    o=root 455426546 455426546 IN IP4 kamailio2-ip<br>
    s=Asterisk PBX 11.21.2<br>
    c=IN IP4 kamailio2-ip<br>
    t=0 0<br>
    m=audio 15926 RTP/AVP 18 8 0 101<br>
    a=rtpmap:18 G729/8000<br>
    a=fmtp:18 annexb=no<br>
    a=rtpmap:8 PCMA/8000<br>
    a=rtpmap:0 PCMU/8000<br>
    a=rtpmap:101 telephone-event/8000<br>
    a=fmtp:101 0-16<br>
    a=ptime:20<br>
    <br>
    Kamailio2-ip:5061----> Asterisk:10432<br>
    ACK sip:10213129110911@kamailio2-ip:10432 SIP/2.0<br>
    Via: SIP/2.0/UDP
    kamailio2-ip:5061;branch=z9hG4bK4d2f.deb7bd96617c7067212dbc1673a216d2.0<br>
    Via: SIP/2.0/UDP
    kamailio1-ip-main;branch=z9hG4bK4d2f.acd6ee83df5babb9e8f53268a4b1b948.0<br>
    Via: SIP/2.0/UDP
    uacip:5060;received=uacip;branch=z9hG4bK59e2e846;rport=10432<br>
    Max-Forwards: 68<br>
    From: <sip:903122977162@kamailio2-ip>;tag=as1c529e28<br>
    To: <a class="moz-txt-link-rfc2396E" href="mailto:sip:03129110911@tstxyz.netgsm.com.tr"><sip:03129110911@tstxyz.netgsm.com.tr></a>;tag=as39358508<br>
    Call-ID: 169f342556f4e956445dfe0e2ee8ecf2@uacip:5060<br>
    CSeq: 103 ACK<br>
    User-Agent: Asterisk PBX 11.21.2<br>
    Content-Length: 0<br>
    <br>
    <br>
    <br>
    ietf :<br>
    <br>
    If the INVITE request whose response is being acknowledged had Route<br>
       header fields, those header fields MUST appear in the ACK.  This
    is<br>
       to ensure that the ACK can be routed properly through any
    downstream<br>
       stateless proxies.<br>
  </body>
</html>