Hi Gaurav, thanks again for your thoughts - I respond inline: On Feb 5, 2013, at 18:24 , gaurav.srivastava2 at agnity.com wrote: > Hi Thomas, > As per my understanding, you are correct.You can not get hold of turn state while using PJSUA. I was afraid of that. > 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) > } I am not sure, whether I am following you correctly - are you proposing a patch ? Thanks again and best regards, -Thomas > 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 > _______________________________________________ > 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