Why not just receiving with kamailio and transparently proxying to the pbx after capturing? I.e.: kamailio in the middle

On Sat, 26 Oct 2019 at 14:46, Igor Olhovskiy <igorolhovskiy@gmail.com> wrote:
Hi!

I'm trying to get Kamailio working as a traffic capture on a same machine with other PBX software installed.

Actually, traffic is mirrored with

iptables -A PREROUTING -t mangle -i eth0 -p udp --dport 5060 -j TEE --gateway 127.0.0.2
iptables -t nat -A PREROUTING -d 127.0.0.2 -p udp --dport 5060 -j DNAT --to 127.0.0.1:5062

Kamailio request route is super simple
request_route {
    xlog("L_ALERT", "[SIP-PACKET] Got packet [F=$fu R=$ru D=$du M=$rm IP=($si:$sp $Ri:$Rp) ID=$ci]\n");
    drop;
}

I was trying to get Kamailio just listen on interface 127.0.0.1:5062, but no luck

listen=udp:127.0.0.1:5062

Next was to use sipcapture module with following parameters

loadmodule "sipcapture.so"
modparam("sipcapture", "db_url", "text:///tmp/")
modparam("sipcapture", "raw_socket_listen", "127.0.0.1:5060-5062")
modparam("sipcapture", "raw_interface", "lo")
modparam("sipcapture", "promiscious_on", 1)

Also no luck. Means Kamailio can't see packets, but I see em with wireshark on lo interface.

What is best way to get it working? Or I'm missing something?

Thanks!
Sent from Mailspring_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Regards,

David Villasmil
email: david.villasmil.work@gmail.com
phone: +34669448337