PJSIP does not use TURN as its last resort!

曹贵林
Fri, Feb 10, 2017 11:34 AM

Hi friends,
I have used PJSIP for my project for months. I succeed to send RTP packets
between different NAT, both in RELAY and P2P mode. It works fine! Thanks to
the great job by the PJSIP team!

But I found a strange issue: PJSIP does not use TURN as its last resort!

[Test 1]

  • TURN is DISABLED in pjsua_media_config:

Result: SIP call works between SIP clients in different NATs. As a result, P2P
connection can be established between these TWO NATs.


[Test 2]

  • Set up turnserver on host-hp01;
  • ENABLE TURN in pjsua_media_config;
  • SAME network and hardware as [Test 1];

Result: SIP call works between different NATs. But tcpdump on host-hp01 shows
that it is relaying packets between SIP clients! Why does PJSIP not use P2P mode?


Guilin Cao

Hi friends, I have used PJSIP for my project for months. I succeed to send RTP packets between different NAT, both in RELAY and P2P mode. It works fine! Thanks to the great job by the PJSIP team! But I found a strange issue: PJSIP does not use TURN as its last resort! -------------------------------------------------------------------------------- [Test 1] - TURN is DISABLED in pjsua_media_config: Result: SIP call works between SIP clients in different NATs. As a result, P2P connection can be established between these TWO NATs. -------------------------------------------------------------------------------- [Test 2] - Set up turnserver on host-hp01; - ENABLE TURN in pjsua_media_config; - SAME network and hardware as [Test 1]; Result: SIP call works between different NATs. But tcpdump on host-hp01 shows that it is relaying packets between SIP clients! Why does PJSIP not use P2P mode? ------------------ Guilin Cao