<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<div>
<p>Dear Kamailio mailing list<br>
</p>
<p><br>
</p>
<p>I've a problem with a simple Kamailio-Asterisk setup. I tried to find a solution and found several posts, but was not able to fix my problem!<br>
</p>
<p><br>
</p>
<p>I'm using the following setup:<br>
</p>
<p>- SIP device registered to Kamailio (IP 10.40.6.188)<br>
</p>
<p>- Kamailio (port 5070) and Asterisk (port 5060) on the same host (IP 10.40.8.104)<br>
</p>
<p>- I tried to forward calls from Kamailio to Asterisk with with standard PSTN call routing and dispatcher module, but the result was the same<br>
</p>
<p>- Asterisk has a trunk to Kamailio<br>
</p>
<p>- SIP device registered to Asterisk <span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">(IP 10.40.6.214)</span>​<br>
</p>
<p><br>
</p>
<p>Calls from the Asterisk phone towards the Kamailio phone work without any issue.<br>
</p>
<p>Calls from the Kamailio phone towards the Asterisk phone are successfully established and the voice works in both directions. The problem here is, that the Kamailio phone sends an ACK upon 200 OK, but the ACK is not forwarded to Asterisk. After 6 seconds,
 the call is terminated.<br>
</p>
<p><br>
</p>
<p>If I remove record_route() or add a second IP to the same interface for Asterisk (10.40.8.106), then the call signaling works without any issue.<br>
</p>
<p><br>
</p>
<p>Does anyone have an idea what I'm doing wrong here?<br>
</p>
<p><br>
</p>
<p>I'm using more or less a standard Kamailio config file without rtpproxy. Please let me know if I shall post the full config or just some relevant snippets.​<br>
</p>
<p><br>
</p>
<p>Best regards<br>
</p>
<p>Mathias<br>
</p>
<p><br>
</p>
<p>Following are two snippets of the relevant ACK. The first shows the situation where the ACK was not forwarded to Asterisk and the second with a different IP for Asterisk works.<br>
</p>
<p><br>
</p>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    752 17.269019      10.40.8.104           10.40.8.104           SIP/SDP  1135   Status: 200 OK | </div>
<div><br>
</div>
<div>Frame 752: 1135 bytes on wire (9080 bits), 1135 bytes captured (9080 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.104, Dst: 10.40.8.104</div>
<div>User Datagram Protocol, Src Port: 5060, Dst Port: 5070</div>
<div>Session Initiation Protocol (200)</div>
<div>    Status-Line: SIP/2.0 200 OK</div>
<div>        Status-Code: 200</div>
<div>        [Resent Packet: False]</div>
<div>        [Request Frame: 304]</div>
<div>        [Response Time (ms): 2093]</div>
<div>    Message Header</div>
<div>        Via: SIP/2.0/UDP 10.40.8.104:5070;branch=z9hG4bKda4f.48918e0ef9372ba1a38655eb93742e46.0;received=10.40.8.104</div>
<div>        Via: SIP/2.0/UDP 10.40.6.188:56960;received=10.40.6.188;rport=56960;branch=z9hG4bKPjVtFCvs26liH-aJoGn8CaLg4kWqml5LH.</div>
<div>        Record-Route: <sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61></div>
<div>        From: <sip:proxydevice@10.40.8.104>;tag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC</div>
<div>        To: <sip:004112345@10.40.8.104>;tag=as5e5c287c</div>
<div>        Call-ID: a6T0GAwBL69m5gsc215EgXi61Oorwxik</div>
<div>        CSeq: 10909 INVITE</div>
<div>        Server: Asterisk PBX 12.3.2</div>
<div>        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE</div>
<div>        Supported: replaces, timer</div>
<div>        Session-Expires: 1800;refresher=uas</div>
<div>        Contact: <sip:004112345@10.40.8.104:5060></div>
<div>        Content-Type: application/sdp</div>
<div>        Require: timer</div>
<div>        Content-Length: 271</div>
<div>    Message Body</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    764 17.270668      10.40.8.104           10.40.6.188           SIP/SDP  1025   Status: 200 OK | </div>
<div><br>
</div>
<div>Frame 764: 1025 bytes on wire (8200 bits), 1025 bytes captured (8200 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.104, Dst: 10.40.6.188</div>
<div>User Datagram Protocol, Src Port: 5070, Dst Port: 56960</div>
<div>Session Initiation Protocol (200)</div>
<div>    Status-Line: SIP/2.0 200 OK</div>
<div>        Status-Code: 200</div>
<div>        [Resent Packet: False]</div>
<div>        [Request Frame: 259]</div>
<div>        [Response Time (ms): 2115]</div>
<div>    Message Header</div>
<div>        Via: SIP/2.0/UDP 10.40.6.188:56960;received=10.40.6.188;rport=56960;branch=z9hG4bKPjVtFCvs26liH-aJoGn8CaLg4kWqml5LH.</div>
<div>        Record-Route: <sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61></div>
<div>        From: <sip:proxydevice@10.40.8.104>;tag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC</div>
<div>        To: <sip:004112345@10.40.8.104>;tag=as5e5c287c</div>
<div>        Call-ID: a6T0GAwBL69m5gsc215EgXi61Oorwxik</div>
<div>        CSeq: 10909 INVITE</div>
<div>        Server: Asterisk PBX 12.3.2</div>
<div>        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE</div>
<div>        Supported: replaces, timer</div>
<div>        Session-Expires: 1800;refresher=uas</div>
<div>        Contact: <sip:004112345@10.40.8.104:5060></div>
<div>        Content-Type: application/sdp</div>
<div>        Require: timer</div>
<div>        Content-Length: 271</div>
<div>    Message Body</div>
<div><br>
</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    786 17.402987      10.40.6.188           10.40.8.104           SIP      486    Request: ACK sip:004112345@10.40.8.104:5060 | </div>
<div><br>
</div>
<div>Frame 786: 486 bytes on wire (3888 bits), 486 bytes captured (3888 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.6.188, Dst: 10.40.8.104</div>
<div>User Datagram Protocol, Src Port: 56960, Dst Port: 5070</div>
<div>Session Initiation Protocol (ACK)</div>
<div>    Request-Line: ACK sip:004112345@10.40.8.104:5060 SIP/2.0</div>
<div>        Method: ACK</div>
<div>        Request-URI: sip:004112345@10.40.8.104:5060</div>
<div>        [Resent Packet: False]</div>
<div>        [Request Frame: 259]</div>
<div>        [Response Time (ms): 2247]</div>
<div>    Message Header</div>
<div>        Via: SIP/2.0/UDP 10.40.6.188:56960;rport;branch=z9hG4bKPjM2GQWjVep2XhpLxJD-cxNh75Qtep-sN3</div>
<div>        Max-Forwards: 70</div>
<div>        From: <sip:proxydevice@10.40.8.104>;tag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC</div>
<div>        To: <sip:004112345@10.40.8.104>;tag=as5e5c287c</div>
<div>        Call-ID: a6T0GAwBL69m5gsc215EgXi61Oorwxik</div>
<div>        CSeq: 10909 ACK</div>
<div>        Route: <sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61></div>
<div>        Content-Length:  0</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    787 17.404480      10.40.8.104           10.40.8.104           SIP      561    Request: ACK sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61 | </div>
<div><br>
</div>
<div>Frame 787: 561 bytes on wire (4488 bits), 561 bytes captured (4488 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.104, Dst: 10.40.8.104</div>
<div>User Datagram Protocol, Src Port: 5070, Dst Port: 5070</div>
<div>Session Initiation Protocol (ACK)</div>
<div>    Request-Line: ACK sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61 SIP/2.0</div>
<div>        Method: ACK</div>
<div>        Request-URI: sip:10.40.8.104:5070;lr;ftag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC;did=17a.4f61</div>
<div>        [Resent Packet: False]</div>
<div>    Message Header</div>
<div>        Via: SIP/2.0/UDP 10.40.8.104:5070;branch=z9hG4bKda4f.f914ac9def098ece9a50d53389574f85.0</div>
<div>        Via: SIP/2.0/UDP 10.40.6.188:56960;received=10.40.6.188;rport=56960;branch=z9hG4bKPjM2GQWjVep2XhpLxJD-cxNh75Qtep-sN3</div>
<div>        Max-Forwards: 69</div>
<div>        From: <sip:proxydevice@10.40.8.104>;tag=NCP2N5E7OZuppblpkCCNZziEmpiTRsQC</div>
<div>        To: <sip:004112345@10.40.8.104>;tag=as5e5c287c</div>
<div>        Call-ID: a6T0GAwBL69m5gsc215EgXi61Oorwxik</div>
<div>        CSeq: 10909 ACK</div>
<div>        Content-Length:  0<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>In this case I used a second IP on the same interface for Asterisk and this call works without any issue:<br>
</div>
<div><br>
</div>
<div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    939 8.849431       10.40.8.106           10.40.6.214           SIP      473    Request: ACK sip:004112345@10.40.6.214:49316;ob | </div>
<div><br>
</div>
<div>Frame 939: 473 bytes on wire (3784 bits), 473 bytes captured (3784 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.106, Dst: 10.40.6.214</div>
<div>User Datagram Protocol, Src Port: 5060, Dst Port: 49316</div>
<div>Session Initiation Protocol (ACK)</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    946 8.850293       10.40.8.106           10.40.8.104           SIP/SDP  1136   Status: 200 OK | </div>
<div><br>
</div>
<div>Frame 946: 1136 bytes on wire (9088 bits), 1136 bytes captured (9088 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.106, Dst: 10.40.8.104</div>
<div>User Datagram Protocol, Src Port: 5060, Dst Port: 5070</div>
<div>Session Initiation Protocol (200)</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    956 8.851703       10.40.8.104           10.40.6.188           SIP/SDP  1026   Status: 200 OK | </div>
<div><br>
</div>
<div>Frame 956: 1026 bytes on wire (8208 bits), 1026 bytes captured (8208 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.104, Dst: 10.40.6.188</div>
<div>User Datagram Protocol, Src Port: 5070, Dst Port: 60223</div>
<div>Session Initiation Protocol (200)<br>
</div>
<div><br>
</div>
<div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    989 9.095859       10.40.6.188           10.40.8.104           SIP      485    Request: ACK sip:004112345@10.40.8.106:5060 | </div>
<div><br>
</div>
<div>Frame 989: 485 bytes on wire (3880 bits), 485 bytes captured (3880 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.6.188, Dst: 10.40.8.104</div>
<div>User Datagram Protocol, Src Port: 60223, Dst Port: 5070</div>
<div>Session Initiation Protocol (ACK)</div>
<div><br>
</div>
<div>No.     Time           Source                Destination           Protocol Length Info</div>
<div>    991 9.097228       10.40.8.104           10.40.8.106           SIP      516    Request: ACK sip:004112345@10.40.8.106:5060 | </div>
<div><br>
</div>
<div>Frame 991: 516 bytes on wire (4128 bits), 516 bytes captured (4128 bits)</div>
<div>Linux cooked capture</div>
<div>Internet Protocol Version 4, Src: 10.40.8.104, Dst: 10.40.8.106</div>
<div>User Datagram Protocol, Src Port: 5070, Dst Port: 5060</div>
<div>Session Initiation Protocol (ACK)<br>
</div>
<br>
</div>
<br>
</div>
</div>
</div>
</body>
</html>