How to setup STUN settings in PJSUA ios application?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In general STUN is not much help for NAT traversal. In some cases it can 
fix things, but as you've seen it can also break things when both 
clients are on LAN. STUN also doesn't help with symmetric NATs. I 
recommend using a SIP registrar/proxy which has a public IP address that 
will relay the call signaling, and using ICE+TURN to connect the RTP 
media. There's really no way to reliably connect clients behind NATs 
without a SIP proxy and TURN relay that have public IP addresses.

Bill

On 8/27/2014 2:42 PM, Telesonic Telesonic wrote:
> Hello!
>
> I have voip application based on pjsua. It works fine except that I don't know how to set up STUN settings correct.
>
> Now I connect STUN before pjsua init -
>
> cfg.stun_host = pj_str(&stunAdr);
> after that all works fine if clients not in the same network. But when they in the same network, they don't use NAT and therefore they don't need STUN but STUN is connected and used and clients don't hear each other.
>
> So how to set up using of STUN only when it needed? Depends on NAT present between clients of not?
>
> I'm also using this -
>
> cfg.cb.on_nat_detect = &on_nat;
>
> static void on_nat(const pj_stun_nat_detect_result *result) {
>      if (result->status != PJ_SUCCESS) {
>          pjsua_perror(THIS_FILE, "NAT detection failed", result->status);
>
>
>      } else {
>
>          PJ_LOG(3, (THIS_FILE, "NAT detected as %s", result->nat_type_name));
>
>      }
> }
> its work fine also, detect NAT but how to use it..
> Please help!
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux