How to setup STUN settings in PJSUA ios application?

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

 



I understand you are building a client, but you will need SIP and TURN 
servers with public IPs to get connections, so you can build and run 
them yourself (hence my links), or use another service. The errors 
suggest there isn't a TURN server running at that IP, looks suspiciously 
like a 192.168.x.x private address.

Bill

On 8/28/2014 3:39 PM, Telesonic Telesonic wrote:
> Hello Bill!
>
> Maybe we don't understand each other.
> I'm making sip client app. Not server.
> Now I switch on ICE and TURN like this and disable STUN.
>
>          // ICE
>          mediaConfig.enable_ice = 1;
>          mediaConfig.snd_auto_close_time = 1;
>          //TURN
>          mediaConfig.enable_turn = 1;
>          mediaConfig.turn_server = pj_str("192.158.29.39:3478");
>          mediaConfig.turn_auth_cred.data.static_cred.username = pj_str("28224511");
>          mediaConfig.turn_auth_cred.data.static_cred.data = pj_str("1379330808");
>
> but with TURN I have this message in logs and now now call even starts -
> .TURN allocation failed: STUN transaction has timed out
> pjsua_call.c  Error initializing media channel: STUN transaction has timed out (PJNATH_ESTUNTIMEDOUT) [status=370004]
>
>
> 28.08.2014, 18:36, "Bill Gardner" <billg at wavearts.com>:
>> PJSIP supports ICE and TURN, so if all your clients will be PJSIP then
>> you are set but you need to enable the functions. For SIP server, an
>> example is:
>>
>> http://www.kamailio.org/w/
>>
>> For TURN server, an example is:
>>
>> https://code.google.com/p/rfc5766-turn-server/
>>
>> Bill
>>
>> On 8/28/2014 10:14 AM, Telesonic Telesonic wrote:
>>>   Hi Bill!
>>>
>>>   That is great!!! Thank you very much!!!
>>>
>>>   Maybe you have some examples how to built-in ICE+TURN and proxy?
>>>
>>>   28.08.2014, 00:55, "Bill Gardner" <billg at wavearts.com>:
>>>>   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
>>>>   _______________________________________________
>>>>   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
>>>   _______________________________________________
>>>   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
>> _______________________________________________
>> 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
> _______________________________________________
> 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