Hello,
I use kamailio set up an IMS on a cloud server in a public network, and have alice and bob registered on the server using ImsDroid in a private network.
When I use alice to call bob, I got "User offline" error.
Below are .pcap file captured from 4060 port and pcscf.log/icscf.log/scscf.log and all config files(in kamailio.zip)
4060.pcap http://sip-router.1086192.n5.nabble.com/file/n148166/4060.pcap pcscf.log http://sip-router.1086192.n5.nabble.com/file/n148166/pcscf.log icscf.log http://sip-router.1086192.n5.nabble.com/file/n148166/icscf.log scscf.log http://sip-router.1086192.n5.nabble.com/file/n148166/scscf.log kamailio.zip http://sip-router.1086192.n5.nabble.com/file/n148166/kamailio.zip
My kamailio version and debian operating system version is like below:
root@iZ94lg22es7Z:~# kamailio -version version: kamailio 4.4.0 (x86_64/linux) d4f23c flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: d4f23c compiled on 13:02:46 May 5 2016 with gcc 4.9.2 root@iZ94lg22es7Z:~#
root@iZ94lg22es7Z:~# cat /etc/issue Debian GNU/Linux 8 \n \l
root@iZ94lg22es7Z:~#
Can anybody give me some help?
Any suggestion will be appreciated!
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166.html Sent from the Users mailing list archive at Nabble.com.
Is this a NAT issue?
The network is like this:
alice--192.168.199.214 company ip--116.228.89.198 kamailio IMS(cloud server)--120.76.118.128 bob--192.168.199.124
I can see INVITE was sent from 116.228.89.198(alice) to 120.76.118.128(kamailio IMS), then 120.76.118.128(kamailio IMS) reply a 100 trying to 116.228.89.198(alice), after that 120.76.118.128(kamailio IMS) sent INVITE to 192.168.199.124(bob) However, I did not captured bob's 183/180 or 200 OK.
What should I do to let it run properly?
http://sip-router.1086192.n5.nabble.com/file/n148168/4060.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148168.html Sent from the Users mailing list archive at Nabble.com.
Is this a NAT issue?
The network is like this:
alice--192.168.199.214 company ip--116.228.89.198 kamailio IMS(cloud server)--120.76.118.128 bob--192.168.199.124
I can see INVITE was sent from 116.228.89.198(company ip) to 120.76.118.128(kamailio IMS), then 120.76.118.128(kamailio IMS) reply a 100 trying to 116.228.89.198(company ip), after that 120.76.118.128(kamailio IMS) sent INVITE to 192.168.199.124(private ip of bob), because 192.168.199.124 is a local ip address, I guess kamailio IMS in the public ip address can't find a route to this address. So, bob did not receive this INVITE message from alice.
Is my analysis right? What should I do to let the IMS run properly?
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148169.html Sent from the Users mailing list archive at Nabble.com.
Is this a NAT issue?
The network is like this:
alice--192.168.199.214 company ip--116.228.89.198 kamailio IMS(cloud server)--120.76.118.128 bob--192.168.199.124
I can see INVITE was sent from 116.228.89.198(company ip) to 120.76.118.128(kamailio IMS), then 120.76.118.128(kamailio IMS) reply a 100 trying to 116.228.89.198(company ip), after that 120.76.118.128(kamailio IMS) sent INVITE to 192.168.199.124(private ip of bob), because 192.168.199.124 is a local ip address, I guess kamailio IMS in the public ip address can't find a route to this address. So, bob did not receive this INVITE message from alice.
Is my analysis right? What should I do to let the IMS run properly?
http://sip-router.1086192.n5.nabble.com/file/n148172/4060.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148172.html Sent from the Users mailing list archive at Nabble.com.
hello; try to open nat_travesal module on registrar server. your analyz is right in my view. INVITE packets never reach to BOB.
cheers.
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148175.html Sent from the Users mailing list archive at Nabble.com.
Thanks for your reply!
I found nat_traversal.so in /usr/local/lib64/kamailio/modules/ directory. But didn't find a switch in pcscf.cfg or kamailio.cfg.
So how can I open nat_travesal module?
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148176.html Sent from the Users mailing list archive at Nabble.com.
Hello,ycaner!
Thanks for your advice!
I searched nat_traversal in kamailio.cfg in PCSCF module, and found that I should define WITH_NATPING.
After doing this, a new problem came. What does this line mean? What should I configure to replace "sip:keepalive@HOSTNAME" ? Is this HOSTNAME a turn/stun server?
modparam("nat_traversal", "keepalive_from", *"sip:keepalive@HOSTNAME"*)
#!ifdef WITH_NATPING # ----- nat_traversal params ----- # If another keepalive is wanted, this is the place modparam("nat_traversal", "keepalive_interval", 20) # If another method than NOTIFY is wanted: modparam("nat_traversal", "keepalive_method", "OPTIONS") # From? modparam("nat_traversal", "keepalive_from", "sip:keepalive@HOSTNAME") # Where we store information about keep-alives: modparam("nat_traversal", "keepalive_state_file", "/var/run/kamailio/keepalive_state") #!endif
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148177.html Sent from the Users mailing list archive at Nabble.com.
Hello; at registration route , you can use nat traversal function , there is a sample on kamailio.cfg that parameter is just adding from and request header for information on OPTIONS packet. you can add your 120.XXX.XXX.XXX
Cheers.
2016-05-06 08:59 tarihinde 王欣鑫 [via SIP Router] yazdı:
Hello,ycaner!
Thanks for your advice!
I searched nat_traversal in kamailio.cfg in PCSCF module, and found that I should define WITH_NATPING.
After doing this, a new problem came. What does this line mean? What should I configure to replace
"sip:keepalive@HOSTNAME" ? Is this HOSTNAME a turn/stun server?
modparam("nat_traversal", "keepalive_from", "sip:keepalive@HOSTNAME")
#!ifdef WITH_NATPING
# ----- nat_traversal params -----
# If another keepalive is wanted, this is the place
modparam("nat_traversal", "keepalive_interval", 20)
# If another method than NOTIFY is wanted:
modparam("nat_traversal", "keepalive_method", "OPTIONS")
# From?
modparam("nat_traversal", "keepalive_from", "sip:keepalive@HOSTNAME")
# Where we store information about keep-alives:
modparam("nat_traversal", "keepalive_state_file", "/var/run/kamailio/keepalive_state")
#!endif
If you reply to this email, your message will be added to the discussion below: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148177.html
To unsubscribe from User offline, click here . NAML
--
yasin-imza-2014.jpg (51K) http://sip-router.1086192.n5.nabble.com/attachment/148178/0/yasin-imza-2014.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148178.html Sent from the Users mailing list archive at Nabble.com.
Hello ycaner!
I did as you told me and finally it worked!
Here are my finall config files.
hss_config.zip http://sip-router.1086192.n5.nabble.com/file/n148179/hss_config.zip kamailio.zip http://sip-router.1086192.n5.nabble.com/file/n148179/kamailio.zip
Thank you very much!!!
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148179.html Sent from the Users mailing list archive at Nabble.com.
Hello,ycaner!
Now I use a real IMS user data to register this user(for example 18616278715) to China Unicom's IMS through kamailio.
I can register successsfully, and can make call using this number, the callee can pick up phone. However neither party can hear counter part.
So, this should be rtp problem. And I captured a .pcap file on port 5060 like below. In this, I see in SDP information it says 192.168.199.124, it's a private address. So maybe the callee can't setup a circuit to this ip, and thus no media was transfered?
Should I uncomment RTPPROXY_ADDRESS, as in my pcscf.cfg there are two lines:
# IP-Adress(es) of the RTP-Proxy ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222 udp:10.1.27.217:22222" ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222"
This is the .pcap file captured on port 5060. 5060.pcap http://sip-router.1086192.n5.nabble.com/file/n148182/5060.pcap
http://sip-router.1086192.n5.nabble.com/file/n148182/5060.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148182.html Sent from the Users mailing list archive at Nabble.com.
Hello,ycaner!
Now I use a real IMS user data to register this user(for example 18616278715) to China Unicom's IMS through kamailio.
I can register successsfully, and can make call using this number, the callee can pick up phone. However neither party can hear counter part.
So, this should be rtp problem. And I captured a .pcap file on port 5060 like below. In this, I see in SDP information it says 192.168.199.124, it's a private address. So maybe the callee can't setup a circuit to this ip, and thus no media was transfered?
Should I uncomment RTPPROXY_ADDRESS, as in my pcscf.cfg there are two lines. If I should do this, what ip and port should I use to replace "udp:10.1.2.186:22222 udp:10.1.27.217:22222" ?
# IP-Adress(es) of the RTP-Proxy ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222 udp:10.1.27.217:22222" ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222"
This is the .pcap file captured on port 5060. 5060.pcap http://sip-router.1086192.n5.nabble.com/file/n148183/5060.pcap
http://sip-router.1086192.n5.nabble.com/file/n148183/5060.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148183.html Sent from the Users mailing list archive at Nabble.com.
Hello; you can use rtpproxy or rtpengine. you need to search how to use on google. rtpproxy/rtpengine fixes sdp packets that has tons of flags and there is a lot of option on sdpops module to change it. for example; you can check with nat_uac_client(8) and fix sdp with rptproxy_offer/rtpproxy_manage("cor") function.
there is 2-3 sample about it , here is kamailio doc how to use functions.
http://www.kamailio.org/docs/modules/4.3.x/modules/rtpproxy.html#idp2564344 http://www.kamailio.org/docs/modules/4.3.x/modules/nathelper.html#nathelper....
-- samples --- http://saevolgo.blogspot.com.tr/2013/08/rtpproxy-revisited-kamailio-40.html http://www.fredposner.com/1457/kamailio-behind-nat/ http://nil.uniza.sk/sip/nat-fw/configuring-nat-traversal-using-kamailio-31-a...
Cheers.
2016-05-06 09:59 tarihinde 王欣鑫 [via SIP Router] yazdı:
Hello,ycaner!
Now I use a real IMS user data to register this user(for example 18616278715) to China Unicom's IMS through kamailio.
I can register successsfully, and can make call using this number, the callee can pick up phone. However neither party can hear counter part.
So, this should be rtp problem. And I captured a .pcap file on port 5060 like below. In this, I see in SDP information it says 192.168.199.124, it's a private address. So maybe the callee can't setup a circuit to this ip, and thus no media was transfered?
Should I uncomment RTPPROXY_ADDRESS, as in my pcscf.cfg there are two lines. If I should do this, what ip and port should I use to replace "udp:10.1.2.186:22222 udp:10.1.27.217:22222" ?
# IP-Adress(es) of the RTP-Proxy ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222 udp:10.1.27.217:22222" ##!define RTPPROXY_ADDRESS "udp:10.1.2.186:22222"
This is the .pcap file captured on port 5060. 5060.pcap
If you reply to this email, your message will be added to the discussion below: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148183.html
To unsubscribe from User offline, click here . NAML
--
yasin-imza-2014.jpg (51K) http://sip-router.1086192.n5.nabble.com/attachment/148184/0/yasin-imza-2014.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148184.html Sent from the Users mailing list archive at Nabble.com.
Hello ycaner!
Thank you very much!
Now, what I think is maybe I should setup a rtpproxy server first, and then modify some configuration in pcscf.cfg and kamailio.cfg.
But I will do a study into the reference you give me first.
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148188.html Sent from the Users mailing list archive at Nabble.com.
Hello ycaner!
I download rtpproxy-2.0-RC1.tar.gz from https://github.com/winer632/rtpproxy/releases/tag/V2.0-RC1 and did the following command:
tar -xzvf rtpproxy-2.0-RC1.tar.gz cd rtpproxy-2.0-RC1 ./configure make all make install
Then I start rtpproxy with this command:
rtpproxy -l 120.76.118.128 -s udp:localhost:7722
Then I edit kamailio.cfg in PCSCF module like this(added this line*loadmodule "rtpproxy"* and *modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722") * )
#!ifdef WITH_NAT loadmodule "path" loadmodule "rtpengine" *loadmodule "rtpproxy"* loadmodule "nathelper" #!endif
#!ifdef WITH_NAT # ----- rtpproxy-ng params ----- #modparam("rtpengine", "rtpengine_sock", RTPPROXY_ADDRESS) #modparam("path", "use_received", 1) *modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")* #!endif
Next, I register a real number(18616278715) in China unicom's IMS , this step was success.Then call another real number 18019398639, no phone ringing, but failed with "Status-Line: SIP/2.0 407 Proxy Authentication Required". Before I add rtpproxy, there is no 407 error.
5060_unicom_407_error.pcap http://sip-router.1086192.n5.nabble.com/file/n148198/5060_unicom_407_error.pcap
Before I add rtpproxy, I can hear the callee phone ringing, and the SIP route is like this:
5060_unicom.pcap http://sip-router.1086192.n5.nabble.com/file/n148198/5060_unicom.pcap
Am I doing wrong with rtpproxy? Maybe the problem is not here?
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148198.html Sent from the Users mailing list archive at Nabble.com.
hello; you can start rtpproxy like "rtpproxy -l 120.76.118.128 -s udp:127.0.0.1:7722 -F -m 10000 -M 20000 -d DBUG:LOG_DAEMON" and check message log.
After authantication , test only INVITE packets with nat_uac_client(8) , rtpproxy_manage can handle INVITE packet with "co" flags ( rtpproxy_manage("co") ) as specified on docs. you can check 200 OK packet with t_on_reply packets. the same logic can you handle sdp packets.
Cheers
2016-05-06 13:14 tarihinde 王欣鑫 [via SIP Router] yazdı:
Hello ycaner!
I download rtpproxy-2.0-RC1.tar.gz from https://github.com/winer632/rtpproxy/releases/tag/V2.0-RC1 and did the following command:
tar -xzvf rtpproxy-2.0-RC1.tar.gz
cd rtpproxy-2.0-RC1
./configure
make all
make install
Then I start rtpproxy with this command:
rtpproxy -l 120.76.118.128 -s udp:localhost:7722
Then I edit kamailio.cfg in PCSCF module like this(added this lineloadmodule "rtpproxy" and modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722") )
#!ifdef WITH_NAT
loadmodule "path"
loadmodule "rtpengine"
loadmodule "rtpproxy" loadmodule "nathelper"
#!endif
#!ifdef WITH_NAT
# ----- rtpproxy-ng params -----
#modparam("rtpengine", "rtpengine_sock", RTPPROXY_ADDRESS)
#modparam("path", "use_received", 1)
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722") #!endif
Next, I register a real number(18616278715) in China unicom's IMS , this step was success.Then call another real number 18019398639, no phone ringing, but failed with "Status-Line: SIP/2.0 407 Proxy Authentication Required". Before I add rtpproxy, there is no 407 error.
5060_unicom_407_error.pcap
Before I add rtpproxy, I can hear the callee phone ringing, and the SIP route is like this:
5060_unicom.pcap
Am I doing wrong with rtpproxy? Maybe the problem is not here?
If you reply to this email, your message will be added to the discussion below: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148198.html
To unsubscribe from User offline, click here . NAML
--
yasin-imza-2014.jpg (51K) http://sip-router.1086192.n5.nabble.com/attachment/148204/0/yasin-imza-2014.jpg
-- View this message in context: http://sip-router.1086192.n5.nabble.com/User-offline-tp148166p148204.html Sent from the Users mailing list archive at Nabble.com.