<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hello Igor,</p>
<p>both methods (just capturing/logging with Kamailio or using sipcapture module) should work as well.<br>
</p>
<p>You listen statement looks ok. Do you actually see the packets entering Kamailio when you activate debug logging?</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<div class="moz-cite-prefix">Am 26.10.19 um 15:45 schrieb Igor Olhovskiy:<br>
</div>
<blockquote type="cite" cite="mid:AB5F9D36-533D-4A52-ADE3-FB76B813163C@getmailspring.com">
<div>Hi!</div>
<br>
<div>I'm trying to get Kamailio working as a traffic capture on a same machine with other PBX software installed.</div>
<br>
<div>Actually, traffic is mirrored with</div>
<br>
<div>iptables -A PREROUTING -t mangle -i eth0 -p udp --dport 5060 -j TEE --gateway
<a href="https://link.getmailspring.com/link/AB5F9D36-533D-4A52-ADE3-FB76B813163C@getmailspring.com/0?redirect=127.0.0.2&recipient=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn" title="127.0.0.2" moz-do-not-send="true">
127.0.0.2</a><br>
iptables -t nat -A PREROUTING -d 127.0.0.2 -p udp --dport 5060 -j DNAT --to <a href="https://link.getmailspring.com/link/AB5F9D36-533D-4A52-ADE3-FB76B813163C@getmailspring.com/1?redirect=127.0.0.1%3A5062&recipient=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn" title="127.0.0.1:5062" moz-do-not-send="true">
127.0.0.1:5062</a><br>
</div>
<br>
<div>Kamailio request route is super simple</div>
<div>request_route {</div>
<div> xlog("L_ALERT", "[SIP-PACKET] Got packet [F=$fu R=$ru D=$du M=$rm IP=($si:$sp $Ri:$Rp) ID=$ci]\n");</div>
<div> drop;</div>
<div>}</div>
<br>
<div>I was trying to get Kamailio just listen on interface 127.0.0.1<span data-emoji-typing="true">:5062,</span> but no luck</div>
<br>
<div>listen=udp:127.0.0.1:5062</div>
<br>
<div>Next was to use sipcapture module with following parameters</div>
<br>
<div>loadmodule "sipcapture.so"</div>
<div>modparam("sipcapture", "db_url", "text:///tmp/")</div>
<div>modparam("sipcapture", "raw_socket_listen", "127.0.0.1:5060-5062")</div>
<div>modparam("sipcapture", "raw_interface", "lo")</div>
<div>modparam("sipcapture", "promiscious_on", 1)</div>
<br>
<div>Also no luck. Means Kamailio can't see packets, but I see em with wireshark on lo interface.</div>
<br>
<div>What is best way to get it working? Or I'm missing something?</div>
<br>
<div>Thanks!</div>
<img class="mailspring-open" alt="Sent from Mailspring" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/AB5F9D36-533D-4A52-ADE3-FB76B813163C@getmailspring.com?me=dd9955d4&recipient=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn" moz-do-not-send="true" width="0" height="0">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Kamailio Merchandising - <a class="moz-txt-link-freetext" href="https://skalatan.de/merchandising/">https://skalatan.de/merchandising/</a>
Kamailio services - <a class="moz-txt-link-freetext" href="https://skalatan.de/services">https://skalatan.de/services</a>
Henning Westerholt - <a class="moz-txt-link-freetext" href="https://skalatan.de/blog/">https://skalatan.de/blog/</a></pre>
</body>
</html>