Hello Everyone, I'm having some trouble getting my SIP setup to work properly.
π My Call Flow: SIP Client initiates a call The call reaches my router, which forwards it to Kamailio + RTPengine running on 192.168.1.75:5060, which then forwards it to A Kubernetes machine at 192.168.1.190:32210, where Asterisk is running
π§ Network Setup: Router has the following ports forwarded: UDP 5060 UDP 10000β20000 (for RTP) STUN is enabled on the SIP client
β What Works: When Iβm connected through a VPN (i.e., inside the local network), everything works fine β both incoming and outgoing audio.
β The Problem: When calling from outside the network, signaling works and the call connects, but I canβt receive or send any audio.
Here is a little of my config of kamailio modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223") modparam("rtpengine", "setid_avp", "$avp(setid)") listen=udp:192.168.1.75:5060 advertise 62.2x.xxx.xxx:5060 listen=tcp:192.168.1.75:5060 advertise 62.2x.xxx.xxx:5060 listen=udp:127.0.0.1:5060 #Nat Helper modparam("nathelper", "force_socket", "192.168.1.75:5060") modparam("nathelper", "natping_interval", 10) modparam("nathelper", "ping_nated_only", 0) modparam("nathelper", "nat_addr_mode", 1)
request_route{ ... route(init); ... if(is_method("INVITE|ACK|BYE|CANCEL|OPTIONS|INFO|UPDATE|PRACK")){ route(handle_sip); exit; } } route[init]{ ... if (nat_uac_test("19")){ setflag(FLT_NAT); fix_nated_contact(); force_rport(); } } route[handle_sip]{ if ($rm == "INVITE"){ if (isflagset(FLT_NAT)){ route(natmanage); }
if (!ds_select_dst("1", "4")){ sl_send_reply("500", "No destination"); exit; }
$ru = "sip:" + $rU + "@" + $rd; # Keeps sip:100@domain $du = "sip:192.168.1.190:32210"; # Matches your dispatcher list
route(relay); }
if ($rm == "BYE" || $rm == "CANCEL"){ if (isflagset(FLT_NAT)){ rtpengine_delete(); }
route(relay); }
if ($rm == "ACK"){ if (isflagset(FLT_NAT)){ route(natmanage); }
route(relay); } route(relay); } route[natmanage]{ if (is_request()){ if (has_body("application/sdp")){ rtpengine_offer("replace-origin replace-session-connection ICE=remove"); } force_rport(); fix_nated_contact(); }else{ rtpengine_answer("replace-origin replace-session-connection ICE=remove"); } } rtpengine.conf
[rtpengine] table = 0 interface = internal/192.168.1.75 listen-ng = 127.0.0.1:2223 log-level = 7
timeout = 60 silent-timeout = 3600 tos = 184
port-min = 10000 port-max = 40000
And here are some logs when I call from outside
2025/04/13 15:58:33.407265 2.8x.xx.xxx:59396 -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj92490d6b6d0c4cd88dac9f0043b1642e Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.412683 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP 62.2x.2xx.xxx:5060;branch=z9hG4bK6362.26a75297a4ccf4984dd1f68644c2148f.0 Via: SIP/2.0/UDP 192.168.1.116:59396;received=2.8x.xx.xxx;rport=59396;branch=z9hG4bKPj92490d6b6d0c4cd88dac9f0043b1642e Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
2025/04/13 15:58:33.428169 2.8x.xx.xxx:59396 -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 537
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.430593 192.168.1.75:5060 -> 2.8x.xx.xxx:59396 SIP/2.0 100 trying -- your call is important to us Via: SIP/2.0/UDP 192.168.1.116:59396;rport=59396;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f;received=2.8x.xx.xxx From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 INVITE Server: kamailio (5.7.4 (x86_64/linux)) Content-Length: 0
2025/04/13 15:58:33.461894 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP 62.2x.2xx.xxx:5060;branch=z9hG4bK3362.72f5db87deeeccee7fea924753af3da0.0 Via: SIP/2.0/UDP 192.168.1.116:59396;received=2.8x.xx.xxx;rport=59396;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
Please Help me, Thank you.
Hi Fernando,
You should try to enable ICE. In your configuration it's currently disabled (ICE=remove) With this parameter enabled SDP should offer multiple options to contact. The problem you have is not related to NAT because you can send and receive SIP messages between your client and server. The problem is that your SDP only indicates private IP, and your client and server are not in the same private network.
Hope it helps
-----Mensaje original----- De: Fernando Lopes via sr-users sr-users@lists.kamailio.org Enviado el: domingo, 13 de abril de 2025 18:06 Para: sr-users@lists.kamailio.org CC: Fernando Lopes fernandolopes20003@gmail.com Asunto: [SR-Users] Nat Problems Kamailio
Hello Everyone, I'm having some trouble getting my SIP setup to work properly.
π My Call Flow: SIP Client initiates a call The call reaches my router, which forwards it to Kamailio + RTPengine running on 192.168.1.75:5060, which then forwards it to A Kubernetes machine at 192.168.1.190:32210, where Asterisk is running
π§ Network Setup: Router has the following ports forwarded: UDP 5060 UDP 10000β20000 (for RTP) STUN is enabled on the SIP client
β What Works: When Iβm connected through a VPN (i.e., inside the local network), everything works fine β both incoming and outgoing audio.
β The Problem: When calling from outside the network, signaling works and the call connects, but I canβt receive or send any audio.
Here is a little of my config of kamailio modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223") modparam("rtpengine", "setid_avp", "$avp(setid)") listen=udp:192.168.1.75:5060 advertise https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f62.2x.xxx.xxx%3a5060&... listen=tcp:192.168.1.75:5060 advertise https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f62.2x.xxx.xxx%3a5060&... listen=udp:127.0.0.1:5060 #Nat Helper modparam("nathelper", "force_socket", "192.168.1.75:5060") modparam("nathelper", "natping_interval", 10) modparam("nathelper", "ping_nated_only", 0) modparam("nathelper", "nat_addr_mode", 1)
request_route{ ... route(init); ... if(is_method("INVITE|ACK|BYE|CANCEL|OPTIONS|INFO|UPDATE|PRACK")){ route(handle_sip); exit; } } route[init]{ ... if (nat_uac_test("19")){ setflag(FLT_NAT); fix_nated_contact(); force_rport(); } } route[handle_sip]{ if ($rm == "INVITE"){ if (isflagset(FLT_NAT)){ route(natmanage); }
if (!ds_select_dst("1", "4")){ sl_send_reply("500", "No destination"); exit; }
$ru = "sip:" + $rU + "@" + $rd; # Keeps sip:100@domain $du = "sip:192.168.1.190:32210"; # Matches your dispatcher list
route(relay); }
if ($rm == "BYE" || $rm == "CANCEL"){ if (isflagset(FLT_NAT)){ rtpengine_delete(); }
route(relay); }
if ($rm == "ACK"){ if (isflagset(FLT_NAT)){ route(natmanage); }
route(relay); } route(relay); } route[natmanage]{ if (is_request()){ if (has_body("application/sdp")){ rtpengine_offer("replace-origin replace-session-connection ICE=remove"); } force_rport(); fix_nated_contact(); }else{ rtpengine_answer("replace-origin replace-session-connection ICE=remove"); } } rtpengine.conf
[rtpengine] table = 0 interface = internal/192.168.1.75 listen-ng = 127.0.0.1:2223 log-level = 7
timeout = 60 silent-timeout = 3600 tos = 184
port-min = 10000 port-max = 40000
And here are some logs when I call from outside
2025/04/13 15:58:33.407265 https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx%3a59396&... -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj92490d6b6d0c4cd88dac9f0043b1642e Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fsip.ice&c=E,1,bmYYCS... Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.412683 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f62.2x.2xx.xxx%3a5060&... Via: SIP/2.0/UDP 192.168.1.116:59396;received=https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx&c=E,1,IZ... Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fsip.ice&c=E,1,ZknIye... Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
2025/04/13 15:58:33.428169 https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx%3a59396&... -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fsip.ice&c=E,1,WEwhdR... Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 537
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.430593 192.168.1.75:5060 -> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx%3a59396&... SIP/2.0 100 trying -- your call is important to us Via: SIP/2.0/UDP 192.168.1.116:59396;rport=59396;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f;received=https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx&c=E,1,QX... From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 INVITE Server: kamailio (5.7.4 (x86_64/linux)) Content-Length: 0
2025/04/13 15:58:33.461894 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f62.2x.2xx.xxx%3a5060&... Via: SIP/2.0/UDP 192.168.1.116:59396;received=https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f2.8x.xx.xxx&c=E,1,PQ... Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fsip.ice&c=E,1,_Y0zCc... Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
Please Help me, 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!
Hello,
try to add the proper advertise setting also to the rtpengine cfg, it looks like its missing there. Refer to the default cfg of the project for details.
Cheers,
Henning
-----Original Message----- From: Fernando Lopes via sr-users sr-users@lists.kamailio.org Sent: Sunday, April 13, 2025 6:06 PM To: sr-users@lists.kamailio.org Cc: Fernando Lopes fernandolopes20003@gmail.com Subject: [SR-Users] Nat Problems Kamailio
Hello Everyone, I'm having some trouble getting my SIP setup to work properly.
π My Call Flow: SIP Client initiates a call The call reaches my router, which forwards it to Kamailio + RTPengine running on 192.168.1.75:5060, which then forwards it to A Kubernetes machine at 192.168.1.190:32210, where Asterisk is running
π§ Network Setup: Router has the following ports forwarded: UDP 5060 UDP 10000β20000 (for RTP) STUN is enabled on the SIP client
β What Works: When Iβm connected through a VPN (i.e., inside the local network), everything works fine β both incoming and outgoing audio.
β The Problem: When calling from outside the network, signaling works and the call connects, but I canβt receive or send any audio.
Here is a little of my config of kamailio modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223") modparam("rtpengine", "setid_avp", "$avp(setid)") listen=udp:192.168.1.75:5060 advertise 62.2x.xxx.xxx:5060 listen=tcp:192.168.1.75:5060 advertise 62.2x.xxx.xxx:5060 listen=udp:127.0.0.1:5060 #Nat Helper modparam("nathelper", "force_socket", "192.168.1.75:5060") modparam("nathelper", "natping_interval", 10) modparam("nathelper", "ping_nated_only", 0) modparam("nathelper", "nat_addr_mode", 1)
request_route{ ... route(init); ... if(is_method("INVITE|ACK|BYE|CANCEL|OPTIONS|INFO|UPDATE|PRACK")){ route(handle_sip); exit; } } route[init]{ ... if (nat_uac_test("19")){ setflag(FLT_NAT); fix_nated_contact(); force_rport(); } } route[handle_sip]{ if ($rm == "INVITE"){ if (isflagset(FLT_NAT)){ route(natmanage); }
if (!ds_select_dst("1", "4")){ sl_send_reply("500", "No destination"); exit; }
$ru = "sip:" + $rU + "@" + $rd; # Keeps sip:100@domain $du = "sip:192.168.1.190:32210"; # Matches your dispatcher list
route(relay); }
if ($rm == "BYE" || $rm == "CANCEL"){ if (isflagset(FLT_NAT)){ rtpengine_delete(); }
route(relay); }
if ($rm == "ACK"){ if (isflagset(FLT_NAT)){ route(natmanage); }
route(relay); } route(relay); } route[natmanage]{ if (is_request()){ if (has_body("application/sdp")){ rtpengine_offer("replace-origin replace-session-connection ICE=remove"); } force_rport(); fix_nated_contact(); }else{ rtpengine_answer("replace-origin replace-session-connection ICE=remove"); } } rtpengine.conf
[rtpengine] table = 0 interface = internal/192.168.1.75 listen-ng = 127.0.0.1:2223 log-level = 7
timeout = 60 silent-timeout = 3600 tos = 184
port-min = 10000 port-max = 40000
And here are some logs when I call from outside
2025/04/13 15:58:33.407265 2.8x.xx.xxx:59396 -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj92490d6b6d0c4cd88dac9f0043b1642e Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.412683 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP 62.2x.2xx.xxx:5060;branch=z9hG4bK6362.26a75297a4ccf4984dd1f68644c2148f.0 Via: SIP/2.0/UDP 192.168.1.116:59396;received=2.8x.xx.xxx;rport=59396;branch=z9hG4bKPj92490d6b6d0c4cd88dac9f0043b1642e Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8963 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: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
2025/04/13 15:58:33.428169 2.8x.xx.xxx:59396 -> 192.168.1.75:5060 INVITE sip:100@192.168.1.75:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.116:59396;rport;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f Max-Forwards: 70 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@192.168.1.116:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 537
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.116 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4032 RTP/AVP 8 0 101 c=IN IP4 192.168.1.116 b=TIAS:64000 a=rtcp:4017 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:1567952351 cname:73284f1717045a81 a=ice-ufrag:37e51dc0 a=ice-pwd:49f7442b5078148140877b44 a=candidate:Hc0a80174 1 UDP 2130706431 192.168.1.116 4032 typ host a=candidate:Hc0a80174 2 UDP 2130706430 192.168.1.116 4017 typ host
2025/04/13 15:58:33.430593 192.168.1.75:5060 -> 2.8x.xx.xxx:59396 SIP/2.0 100 trying -- your call is important to us Via: SIP/2.0/UDP 192.168.1.116:59396;rport=59396;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f;received=2.8x.xx.xxx From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 INVITE Server: kamailio (5.7.4 (x86_64/linux)) Content-Length: 0
2025/04/13 15:58:33.461894 192.168.1.75:5060 -> 192.168.1.190:32210 INVITE sip:100@192.168.1.75 SIP/2.0 Via: SIP/2.0/UDP 62.2x.2xx.xxx:5060;branch=z9hG4bK3362.72f5db87deeeccee7fea924753af3da0.0 Via: SIP/2.0/UDP 192.168.1.116:59396;received=2.8x.xx.xxx;rport=59396;branch=z9hG4bKPj14c6f24b814e4d158014cc80b1fa5f8f Max-Forwards: 69 From: "6001" sip:6005@192.168.1.75:5060;tag=0397d2bdc3ef47f5b6e498126a360b0f To: sip:100@192.168.1.75:5060 Contact: "6001" sip:6005@2.8x.xx.xxx:59396;ob;+sip.ice Call-ID: 83a804569c3f489088607c729485cdbd CSeq: 8964 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 Authorization: Digest username="6005", realm="asterisk", nonce="1744559913/dab8894e3f31e038d7a969a6349a11c2", uri="sip:100@62.2x.2xx.xxx", response="2ce500d6a1583f05f6344bdf1f712fc7", algorithm=MD5, cnonce="808fc766135d40589dd68032bcaab5c6", opaque="2232aa9c42080f12", qop=auth, nc=00000001 Content-Type: application/sdp Content-Length: 322
v=0 o=- 3953552313 3953552313 IN IP4 192.168.1.75 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 12156 RTP/AVP 8 0 101 c=IN IP4 192.168.1.75 b=TIAS:64000 a=ssrc:1567952351 cname:73284f1717045a81 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=sendrecv a=rtcp:12157
Please Help me, 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!
Thank you For the response Henning, I've removed "ICE=remove" and still isn't working, do you possible might know what it is.
Here are some more logs: Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Content-Length: 0
2025/04/14 08:30:33.525867 192.168.1.190:32210 -> 192.168.1.75:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 62.2x.2xx.1xx:5060;rport=65292;received=10.244.9.1;branch=z9hG4bK1399.6b1ac532febeace921e5787620c20aac.0 Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:33.526688 192.168.1.75:5060 -> 2.8x.7x.1xx:65171 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:34.026672 192.168.1.190:32210 -> 192.168.1.75:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 62.2x.2xx.1xx:5060;rport=65292;received=10.244.9.1;branch=z9hG4bK1399.6b1ac532febeace921e5787620c20aac.0 Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:34.027943 192.168.1.75:5060 -> 2.8x.7x.1xx:65171 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
Hello Fernando,
the ICE=remove change should be actually not necessary. Please check the rtpengine cfg, as said in the previous e-mail.
Cheers,
Henning
-----Original Message----- From: Fernando Lopes via sr-users sr-users@lists.kamailio.org Sent: Monday, April 14, 2025 10:36 AM To: sr-users@lists.kamailio.org Cc: Fernando Lopes fernandolopes20003@gmail.com Subject: [SR-Users] Re: Nat Problems Kamailio
Thank you For the response Henning, I've removed "ICE=remove" and still isn't working, do you possible might know what it is.
Here are some more logs: Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Content-Length: 0
2025/04/14 08:30:33.525867 192.168.1.190:32210 -> 192.168.1.75:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 62.2x.2xx.1xx:5060;rport=65292;received=10.244.9.1;branch=z9hG4bK1399.6b1ac532febeace921e5787620c20aac.0 Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:33.526688 192.168.1.75:5060 -> 2.8x.7x.1xx:65171 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:34.026672 192.168.1.190:32210 -> 192.168.1.75:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 62.2x.2xx.1xx:5060;rport=65292;received=10.244.9.1;branch=z9hG4bK1399.6b1ac532febeace921e5787620c20aac.0 Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv
2025/04/14 08:30:34.027943 192.168.1.75:5060 -> 2.8x.7x.1xx:65171 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.116:65171;rport=65171;received=2.8x.7x.1xx;branch=z9hG4bKPjc16ac23762a1469692eba9aa91b63e50 Call-ID: f04ad8c5440e41ad9528667dee401877 From: "6001" sip:6005@192.168.1.75;tag=2e67816627ad4f009cae5bb4896a60d6 To: sip:100@192.168.1.75;tag=69340f54-fa9a-4676-b6ee-e0b4d2200634 CSeq: 94 INVITE Server: Asterisk PBX 18.24.3 Contact: sip:10.244.9.101:5060 Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800;refresher=uac Require: timer Content-Type: application/sdp Content-Length: 461
v=0 o=- 3953611833 3953611835 IN IP4 10.244.9.101 s=Asterisk c=IN IP4 10.244.9.101 t=0 0 m=audio 13290 RTP/AVP 0 101 a=ice-ufrag:5f7345fb4c0fed0258b2d2366fc99035 a=ice-pwd:45a08eba16bcd7485247f64b4f3c5865 a=candidate:Haf40965 1 UDP 2130706431 10.244.9.101 13290 typ host a=candidate:Haf40965 2 UDP 2130706430 10.244.9.101 13291 typ host a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:140 a=sendrecv __________________________________________________________ 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 checked the documentation and changed the RTPengine setting to: interface = 192.168.1.75!62.2x.2xx.xxx as stated https://rtpengine.readthedocs.io/en/latest/rtpengine.html#advertised-address. However, it still doesn't work.
If you think it might be something else, I'm happy to test further. If not, thank you for everything. Thank you Henning,
Fernando Lopes
Hello Fernando,
if you look to the SDP, it should then show the advertised IP also there, after a rtpengine restart.
If not, maybe the rtpengine logs show something.
Cheers,
Henning
-----Original Message----- From: Fernando Lopes via sr-users sr-users@lists.kamailio.org Sent: Monday, April 14, 2025 11:12 AM To: sr-users@lists.kamailio.org Cc: Fernando Lopes fernandolopes20003@gmail.com Subject: [SR-Users] Re: Nat Problems Kamailio
I've checked the documentation and changed the RTPengine setting to: interface = 192.168.1.75!62.2x.2xx.xxx as stated https://rtpengine.readthedocs.io/en/latest/rtpengine.html#advertised-address. However, it still doesn't work.
If you think it might be something else, I'm happy to test further. If not, thank you for everything. Thank you Henning,
Fernando Lopes __________________________________________________________ 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!
This is my rtpengine logs
2025-04-14T09:30:40.077794+00:00 sip00 systemd[1]: sysstat-collect.service: Deactivated successfully. 2025-04-14T09:30:40.078392+00:00 sip00 systemd[1]: Finished sysstat-collect.service - system activity accounting tool. 2025-04-14T09:30:58.758983+00:00 sip00 systemd[1]: Stopping rtpengine-daemon.service - RTP/media Proxy Daemon... 2025-04-14T09:30:58.761992+00:00 sip00 rtpengine[9317]: INFO: [core] Version 11.5.1.18-1ubuntu1 shutting down 2025-04-14T09:30:58.945186+00:00 sip00 systemd[1]: rtpengine-daemon.service: Deactivated successfully. 2025-04-14T09:30:58.945475+00:00 sip00 systemd[1]: Stopped rtpengine-daemon.service - RTP/media Proxy Daemon. 2025-04-14T09:30:58.945637+00:00 sip00 systemd[1]: Starting rtpengine-daemon.service - RTP/media Proxy Daemon... 2025-04-14T09:30:59.167973+00:00 sip00 rtpengine[9430]: INFO: [crypto] Generating new DTLS certificate 2025-04-14T09:30:59.205433+00:00 sip00 rtpengine[9430]: INFO: [core] Startup complete, version 11.5.1.18-1ubuntu1 2025-04-14T09:30:59.211613+00:00 sip00 systemd[1]: Started rtpengine-daemon.service - RTP/media Proxy Daemon. 2025-04-14T09:31:03.909036+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Received command 'offer' from 127.0.0.1:49375 2025-04-14T09:31:03.910293+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [core] Creating new call 2025-04-14T09:31:03.913348+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Replying to 'offer' from 127.0.0.1:49375 (elapsed time 0.004626 sec) 2025-04-14T09:31:03.951308+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: peer for component 1 is 192.168.1.164:4035 2025-04-14T09:31:03.951390+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: local interface 192.168.1.75 2025-04-14T09:31:03.951432+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: peer for component 2 is 192.168.1.164:4013 2025-04-14T09:31:03.954171+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Received command 'offer' from 127.0.0.1:44587 2025-04-14T09:31:03.954436+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Replying to 'offer' from 127.0.0.1:44587 (elapsed time 0.000201 sec) 2025-04-14T09:31:03.977804+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10678]: [core] STUN authentication mismatch from 192.168.1.164:4035 2025-04-14T09:31:03.977856+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [core] STUN authentication mismatch from 192.168.1.164:4013 2025-04-14T09:31:11.890424+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Received command 'offer' from 127.0.0.1:52017 2025-04-14T09:31:11.890513+00:00 sip00 rtpengine[9430]: NOTICE: [33e9510a2d214c3dac97b1a20f94cfbe]: [core] Creating new call 2025-04-14T09:31:11.892825+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Replying to 'offer' from 127.0.0.1:52017 (elapsed time 0.001621 sec) 2025-04-14T09:31:11.905389+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Received command 'offer' from 127.0.0.1:46110 2025-04-14T09:31:11.905704+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Replying to 'offer' from 127.0.0.1:46110 (elapsed time 0.000278 sec)
Thank you.
Looks like it's only receiving offers, no answers. Either your answers are mistakenly processed as offers, or they're not processed at all. Enable debug logging to see which SDPs they are, and investigate if the offer/answer distinction in your Kamailio script is working correctly.
Cheers
On 14/04/2025 05.32, Fernando Lopes via sr-users wrote:
This is my rtpengine logs
2025-04-14T09:30:40.077794+00:00 sip00 systemd[1]: sysstat-collect.service: Deactivated successfully. 2025-04-14T09:30:40.078392+00:00 sip00 systemd[1]: Finished sysstat-collect.service - system activity accounting tool. 2025-04-14T09:30:58.758983+00:00 sip00 systemd[1]: Stopping rtpengine-daemon.service - RTP/media Proxy Daemon... 2025-04-14T09:30:58.761992+00:00 sip00 rtpengine[9317]: INFO: [core] Version 11.5.1.18-1ubuntu1 shutting down 2025-04-14T09:30:58.945186+00:00 sip00 systemd[1]: rtpengine-daemon.service: Deactivated successfully. 2025-04-14T09:30:58.945475+00:00 sip00 systemd[1]: Stopped rtpengine-daemon.service - RTP/media Proxy Daemon. 2025-04-14T09:30:58.945637+00:00 sip00 systemd[1]: Starting rtpengine-daemon.service - RTP/media Proxy Daemon... 2025-04-14T09:30:59.167973+00:00 sip00 rtpengine[9430]: INFO: [crypto] Generating new DTLS certificate 2025-04-14T09:30:59.205433+00:00 sip00 rtpengine[9430]: INFO: [core] Startup complete, version 11.5.1.18-1ubuntu1 2025-04-14T09:30:59.211613+00:00 sip00 systemd[1]: Started rtpengine-daemon.service - RTP/media Proxy Daemon. 2025-04-14T09:31:03.909036+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Received command 'offer' from 127.0.0.1:49375 2025-04-14T09:31:03.910293+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [core] Creating new call 2025-04-14T09:31:03.913348+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Replying to 'offer' from 127.0.0.1:49375 (elapsed time 0.004626 sec) 2025-04-14T09:31:03.951308+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: peer for component 1 is 192.168.1.164:4035 2025-04-14T09:31:03.951390+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: local interface 192.168.1.75 2025-04-14T09:31:03.951432+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [ice] ICE negotiated: peer for component 2 is 192.168.1.164:4013 2025-04-14T09:31:03.954171+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Received command 'offer' from 127.0.0.1:44587 2025-04-14T09:31:03.954436+00:00 sip00 rtpengine[9430]: INFO: [d4ecb9ad83ea4fba982917ae24a0c4ad]: [control] Replying to 'offer' from 127.0.0.1:44587 (elapsed time 0.000201 sec) 2025-04-14T09:31:03.977804+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10678]: [core] STUN authentication mismatch from 192.168.1.164:4035 2025-04-14T09:31:03.977856+00:00 sip00 rtpengine[9430]: NOTICE: [d4ecb9ad83ea4fba982917ae24a0c4ad/867e0193685c48ba89876dfd734be12e/1 port 10679]: [core] STUN authentication mismatch from 192.168.1.164:4013 2025-04-14T09:31:11.890424+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Received command 'offer' from 127.0.0.1:52017 2025-04-14T09:31:11.890513+00:00 sip00 rtpengine[9430]: NOTICE: [33e9510a2d214c3dac97b1a20f94cfbe]: [core] Creating new call 2025-04-14T09:31:11.892825+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Replying to 'offer' from 127.0.0.1:52017 (elapsed time 0.001621 sec) 2025-04-14T09:31:11.905389+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Received command 'offer' from 127.0.0.1:46110 2025-04-14T09:31:11.905704+00:00 sip00 rtpengine[9430]: INFO: [33e9510a2d214c3dac97b1a20f94cfbe]: [control] Replying to 'offer' from 127.0.0.1:46110 (elapsed time 0.000278 sec)
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!