<div><div dir="auto">Why not just receiving with kamailio and transparently proxying to the pbx after capturing? I.e.: kamailio in the middle</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 26 Oct 2019 at 14:46, Igor Olhovskiy <<a href="mailto:igorolhovskiy@gmail.com">igorolhovskiy@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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" target="_blank">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>:5062,</span> but no luck</div><br><div>listen=udp:<a href="http://127.0.0.1:5062" target="_blank">127.0.0.1:5062</a></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 alt="Sent from Mailspring" width="0" height="0" style="border:0;width:0;height:0" src="https://link.getmailspring.com/open/AB5F9D36-533D-4A52-ADE3-FB76B813163C@getmailspring.com?me=dd9955d4&recipient=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn">_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div>