Hi everyone,
I'm experiencing some issues with Kamailio and RTP Engine.
Here's the setup: A user initiates a call, and the traffic goes through a router. The router forwards the traffic to a machine at 192.168.1.75, which runs Kamailio and RTP Engine. Kamailio uses a dispatcher to forward calls to 192.168.1.190, a Kubernetes node running an Asterisk container.
The problem: When I'm inside the network, everything works fine — I can send and receive audio. But when I'm outside the network, the call connects, but there's no audio in either direction (no send or receive).
Some Configs: Kamailio.conf: modparam("rtpengine", "rtpengine_sock", "udp:0.0.0.0:2223") listen=udp:192.168.1.75:5060 listen=tcp:192.168.1.75:5060 listen=udp:127.0.0.1:5060 # ----- dispatcher params ----- modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list") modparam("dispatcher", "flags", 2) modparam("dispatcher", "xavp_dst", "_dsdst_") modparam("dispatcher", "xavp_ctx", "_dsctx_") modparam("dispatcher", "ds_ping_from", "sip:proxy@kamailio.org") modparam("dispatcher", "ds_ping_interval", 60) modparam("dispatcher", "ds_probing_mode", 1) modparam("dispatcher", "ds_timer_mode", 1)
rtpengine.conf: interface = 192.168.1.75 listen-udp = 0.0.0.0:2223 port-min = 10000 port-max = 20000
Firewall: To Action From -- ------ ---- 22 ALLOW Anywhere 12222/udp ALLOW Anywhere 5060/udp ALLOW Anywhere 10000:20000/udp ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 12222/udp (v6) ALLOW Anywhere (v6) 5060/udp (v6) ALLOW Anywhere (v6) 10000:20000/udp (v6) ALLOW Anywhere (v6)
Also router has all this ports open
Thank you.
Hi, You should check SDP in SIP Invites to see where it sends audio. Maybe it points to a wrong IP/port It's easy to do with sngrep / asterisk pjsip history
Hope it helps
-----Mensaje original----- De: fernandolopes20003--- via sr-users sr-users@lists.kamailio.org Enviado el: lunes, 7 de abril de 2025 16:48 Para: sr-users@lists.kamailio.org CC: fernandolopes20003@gmail.com Asunto: [SR-Users] Kamailio + RTP Engine question
Hi everyone,
I'm experiencing some issues with Kamailio and RTP Engine.
Here's the setup: A user initiates a call, and the traffic goes through a router. The router forwards the traffic to a machine at 192.168.1.75, which runs Kamailio and RTP Engine. Kamailio uses a dispatcher to forward calls to 192.168.1.190, a Kubernetes node running an Asterisk container.
The problem: When I'm inside the network, everything works fine — I can send and receive audio. But when I'm outside the network, the call connects, but there's no audio in either direction (no send or receive).
Some Configs: Kamailio.conf: modparam("rtpengine", "rtpengine_sock", "udp:0.0.0.0:2223") listen=udp:192.168.1.75:5060 listen=tcp:192.168.1.75:5060 listen=udp:127.0.0.1:5060 # ----- dispatcher params ----- modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list") modparam("dispatcher", "flags", 2) modparam("dispatcher", "xavp_dst", "_dsdst_") modparam("dispatcher", "xavp_ctx", "_dsctx_") modparam("dispatcher", "ds_ping_from", "sip:proxy@kamailio.org") modparam("dispatcher", "ds_ping_interval", 60) modparam("dispatcher", "ds_probing_mode", 1) modparam("dispatcher", "ds_timer_mode", 1)
rtpengine.conf: interface = 192.168.1.75 listen-udp = 0.0.0.0:2223 port-min = 10000 port-max = 20000
Firewall: To Action From -- ------ ---- 22 ALLOW Anywhere 12222/udp ALLOW Anywhere 5060/udp ALLOW Anywhere 10000:20000/udp ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 12222/udp (v6) ALLOW Anywhere (v6) 5060/udp (v6) ALLOW Anywhere (v6) 10000:20000/udp (v6) ALLOW Anywhere (v6)
Also router has all this ports open
Thank you. __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Hi Fernando!
You're behind NAT, and your SDP probably doesn't know that, so it sends SDP info with private IP addresses. Your router probably doesn't change that (check if your router supports SIP ALG and if yes, try to enable it ( i personally hate that SIP ALG...) . It might help (hopefully)
And also check if your RTP Engine is properly set with the public IP address.
Anyways, SIP + NAT + K8 = HELL^2
:)
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua*
On Mon, Apr 7, 2025 at 4:27 PM Samuel Moya Tinoco via sr-users < sr-users@lists.kamailio.org> wrote:
Hi, You should check SDP in SIP Invites to see where it sends audio. Maybe it points to a wrong IP/port It's easy to do with sngrep / asterisk pjsip history
Hope it helps
-----Mensaje original----- De: fernandolopes20003--- via sr-users sr-users@lists.kamailio.org Enviado el: lunes, 7 de abril de 2025 16:48 Para: sr-users@lists.kamailio.org CC: fernandolopes20003@gmail.com Asunto: [SR-Users] Kamailio + RTP Engine question
Hi everyone,
I'm experiencing some issues with Kamailio and RTP Engine.
Here's the setup: A user initiates a call, and the traffic goes through a router. The router forwards the traffic to a machine at 192.168.1.75, which runs Kamailio and RTP Engine. Kamailio uses a dispatcher to forward calls to 192.168.1.190, a Kubernetes node running an Asterisk container.
The problem: When I'm inside the network, everything works fine — I can send and receive audio. But when I'm outside the network, the call connects, but there's no audio in either direction (no send or receive).
Some Configs: Kamailio.conf: modparam("rtpengine", "rtpengine_sock", "udp:0.0.0.0:2223") listen=udp:192.168.1.75:5060 listen=tcp:192.168.1.75:5060 listen=udp:127.0.0.1:5060 # ----- dispatcher params ----- modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list") modparam("dispatcher", "flags", 2) modparam("dispatcher", "xavp_dst", "_dsdst_") modparam("dispatcher", "xavp_ctx", "_dsctx_") modparam("dispatcher", "ds_ping_from", "sip:proxy@kamailio.org") modparam("dispatcher", "ds_ping_interval", 60) modparam("dispatcher", "ds_probing_mode", 1) modparam("dispatcher", "ds_timer_mode", 1)
rtpengine.conf: interface = 192.168.1.75 listen-udp = 0.0.0.0:2223 port-min = 10000 port-max = 20000
Firewall: To Action From
22 ALLOW Anywhere 12222/udp ALLOW Anywhere 5060/udp ALLOW Anywhere 10000:20000/udp ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 12222/udp (v6) ALLOW Anywhere (v6) 5060/udp (v6) ALLOW Anywhere (v6) 10000:20000/udp (v6) ALLOW Anywhere (v6)
Also router has all this ports open
Thank you. __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
I've taken Samuel Moya's recommendation and ran sudo sngrep -d any. It looks like the issue is indeed caused by NAT — just like you mentioned. I'm currently working on fixing it.
I've taken your recommendation and ran sudo sngrep -d any. It looks like the issue is indeed caused by NAT. I'm currently working on fixing it.
Hi there,
rtpengine.conf: interface = 192.168.1.75
Looks like you define a single interface here which works on the local network, but you need to do some NAT if you are going outside of your network using direction flags.
Somethng like this: interface = private/{{ privateIP }};public/{{ privateIP }}!{{ publicIP }}
Documented here: https://rtpengine.readthedocs.io/en/latest/rtpengine.html#interface-names
As well as your Kamailio understanding internal and external traffic for example.
A simple way to manage this could be to use a conditional statement for parsing any rfc 1918 addresses from the $si. Or any addresses in a list (permissions module address list) to know if the traffic is going to or coming from the asterisk container.
Thanks,
John.
On Mon, 7 Apr 2025 at 16:12, fernandolopes20003--- via sr-users < sr-users@lists.kamailio.org> wrote:
Hi everyone,
I'm experiencing some issues with Kamailio and RTP Engine.
Here's the setup: A user initiates a call, and the traffic goes through a router. The router forwards the traffic to a machine at 192.168.1.75, which runs Kamailio and RTP Engine. Kamailio uses a dispatcher to forward calls to 192.168.1.190, a Kubernetes node running an Asterisk container.
The problem: When I'm inside the network, everything works fine — I can send and receive audio. But when I'm outside the network, the call connects, but there's no audio in either direction (no send or receive).
Some Configs: Kamailio.conf: modparam("rtpengine", "rtpengine_sock", "udp:0.0.0.0:2223") listen=udp:192.168.1.75:5060 listen=tcp:192.168.1.75:5060 listen=udp:127.0.0.1:5060 # ----- dispatcher params ----- modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list") modparam("dispatcher", "flags", 2) modparam("dispatcher", "xavp_dst", "_dsdst_") modparam("dispatcher", "xavp_ctx", "_dsctx_") modparam("dispatcher", "ds_ping_from", "sip:proxy@kamailio.org") modparam("dispatcher", "ds_ping_interval", 60) modparam("dispatcher", "ds_probing_mode", 1) modparam("dispatcher", "ds_timer_mode", 1)
rtpengine.conf: interface = 192.168.1.75 listen-udp = 0.0.0.0:2223 port-min = 10000 port-max = 20000
Firewall: To Action From
22 ALLOW Anywhere 12222/udp ALLOW Anywhere 5060/udp ALLOW Anywhere 10000:20000/udp ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) 12222/udp (v6) ALLOW Anywhere (v6) 5060/udp (v6) ALLOW Anywhere (v6) 10000:20000/udp (v6) ALLOW Anywhere (v6)
Also router has all this ports open
Thank you. __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
I got this logs, where I'm calling from outside the network, and somehow getting 192.168.1.116, but when I use STUN server in my microsip I get the right IP but still can't get any audio. (Also, I tried some NAT configuration but got nowhere.) 2025/04/08 13:42:21.555465 2.8x.xx.1xx:59562 -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 2.8x.xx.1xx::59562;rport;branch=z9hG4bKPj07ed0f1e24a24527975338cf71bcc110 Max-Forwards: 70 From: "6002" sip:6002@192.168.1.75:5060;tag=f8b88d99599e446ebe47d0cdc9840ab6 To: sip:100@192.168.1.75:5060 Contact: sip:6002@2.8x.xx.1xx::59562;ob;+sip.ice Call-ID: 6ce76cbe901743528564f548cd18d340 CSeq: 7290 INVITE Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Supported: replaces, 100rel, timer, norefersub Session-Expires: 1800 Min-SE: 90 User-Agent: MicroSIP/3.21.5 Content-Type: application/sdp Content-Length: 537
v=0 o=- 3953112142 3953112142 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4034 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4015 IN IP4 192.168.1.116 a=sendrecv a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ssrc:1610032891 cname:299e26ba5e0e5e84 a=ice-ufrag:655f198d a=ice-pwd:46c3068f42d6652a5a210314 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4034 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4015 typ host