Python thread problem

KF
Kjeld Flarup
Sun, May 24, 2020 9:33 PM

I'm trying to remove the TK part of this example pjsip-apps/src/pygui
But it seems that pjsua2 depends on some thread handling, and the
example uses TK threads for this.

Thus I create a thread to execute the application in but then

def startApp():
    app = Application()
    app.start()

def main():
    daemon = threading.Thread(name='PJSUAapp',
                      target=startApp)
    daemon.start()

But then I get this error

python3: ../src/pj/os_core_unix.c:692: pj_thread_this: Assertion
`!"Calling pjlib from unknown/external thread. You must " "register
external threads with pj_thread_register() " "before calling any pjlib
functions."' failed.

How to do this from python?

--
-------------------- Med Liberalistiske Hilsner ----------------------
Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk

I'm trying to remove the TK part of this example pjsip-apps/src/pygui But it seems that pjsua2 depends on some thread handling, and the example uses TK threads for this. Thus I create a thread to execute the application in but then def startApp():     app = Application()     app.start() def main():     daemon = threading.Thread(name='PJSUAapp',                       target=startApp)     daemon.start() But then I get this error python3: ../src/pj/os_core_unix.c:692: pj_thread_this: Assertion `!"Calling pjlib from unknown/external thread. You must " "register external threads with pj_thread_register() " "before calling any pjlib functions."' failed. How to do this from python? -- -------------------- Med Liberalistiske Hilsner ---------------------- Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49 Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk