TURN server authentication

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

 



Hi Thomas,

As per my understanding, you are correct.You can not get hold
of turn state while using PJSUA.

We can do something like there are few
callbacks in pjsua_callback structure in order to take access of TURN state
we can install a new call back sth like on_alloc_fail.

Now in callback of
on_state which is turn_on_state

where we come to the point 

 else {

PJ_PERROR(4,(comp->ice_st->obj_name, info.last_status,
 "Comp %d: TURN
allocation failed, retrying",
 comp->comp_id));

 /* Our Desired Code */


add_update_turn(comp->ice_st, comp);

/*Our Desired
code*/

=================

if (ice_st->cb.on_alloc_fail)

(*ice_st->cb.on_alloc_fail)(ice_st, op, status);

Definition of
on_alloc_fail in your application as
:

on_alloc_fail(ice_st,op,status)

{

if
(op==TURN_ALLOC_FAIL)

print("Allocation failed and status is
%d",status)

}

Thanks and Regards,

Gaurav

On Mon, 4 Feb 2013 21:40:34
+0100, Thomas Martin wrote:
> Hi Gaurav,
> 
> thank you very much for your
prompt response.
> 
> I can indeed see the "on_state" callback-stub inside
of struct
> "pj_turn_sock_cb".
> 
> However, I do not see, how I can gain
access to that "pj_turn_sock_cb"
> structure,
> in a situation, where TURN
is configured through "pjsua_media_config" and
> the 
> allocation is
initiated and conducted under the control (and "hood") of 
>
pjsua_init().
> 
> I am probably overlooking something ...? - Any hint is
appreciated.
> 
> Best regards,
> 
> Thomas
> 
> On Feb 4, 2013, at 17:34 ,
gaurav.srivastava2 at agnity.com wrote:
> 
>> Hi Thomas,
>> 
>> 
>> If the
TURN allocation fails you will 401 Unauthorized response for STUN
>>
Allocate Request.
>> 
>> In order to keep track of current TURN state you
can install callback
>> turn_on_state ()
>> 
>> and after the state of TURN
client changes from Allocating to Ready
>> means allocation is successful
and if it changes from Allocation to
>> Deallocating with error response of
401
>> means Authorization failed.
>> 
>> Regards,
>> Gaurav
>> 
>> 
>> 
>>
On Mon, 4 Feb 2013 16:30:38 +0100, Thomas Martin wrote:
>> > Hi
everybody,
>> > 
>> > in order to utilise TURN with PJSUA, a turn-server
with login
>> > credentials
>> > must be specified in e.g.
pjsua_media_config.
>> > 
>> > Question: 
>> > 
>> > How can be determined,
whether the authentication with the particular
>> > TURN
>> > server was
actually successful (and TURN is available) 
>> > or has failed e.g.
because of incorrect credentials, or other reasons? 
>> > 
>> > There does
not seem to be a dedicated callback for that.
>> > 
>> > Thanks in advance
for responding.
>> > 
>> > Regards,
>> > 
>> > -Thomas
>> >
_______________________________________________
>> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130205/2665cc20/attachment-0001.html>


[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