What I did before is use a global list to save pj_thread_desc and add thread register checking to every exported function call. regards, Gang On Wed, Oct 5, 2011 at 11:28 PM, taraniteja vishwanatha <taraniteja at gmail.com> wrote: > Hi all, > > I have a class and I am using PJLIB and PJMEDIA functions inside the public > methods of the class. > I am not creating any threads using pj_thread_create or using native win32 > API. I built the class as a static library and using it in another > application(console) to test it. > When I ran the exe, I got a run-time error: > > ?Assertion failed: !"Calling pjlib from unknown/external thread. You must " > "regi > ster external threads with pj_thread_register() " "before calling any pjlib > functions." > > I looked up the forums and found out that I had to register the current > thread with PJLIB to be able to use any of its methods. > > I wrote this code : > > pj_thread_desc rtpdesc; > pj_thread_t *thread; > pj_thread_register("RTPHost",rtpdesc,&thread); > > and called it in the application and every method in my class. Still I am > getting the runtime error. > > What I could I be doing wrong? > Appreciate your help.. > > Thanks, > Tarani. > > > _______________________________________________ > 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 > >