<HTML>
<HEAD>
<TITLE>Embedding sipsimple in a MacOS application</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
I’m running the sipsimple engine inside a MacOS application in a similar manner to what Blink is doing except that this application has much of the driving code written in objective-c unlike Blink client who has little C code(used only for initialization). The problem that I’m experiencing is more of a Python embedding in C rather than a sipsimple problem but I believe that you still may be able to answer/give me a hint.<BR>
<BR>
So...problem is something like this. If I start the application’s event loop using the NSApplicationMain() function and initalize sipsimple objects using the PyRun_SimpleString() I do not receive the SIPApplicationWillStart, DidStart, etc or any other notification from the NotificationCenter. On the other hand if I start the event loop using PyRun_SimpleString(“AppHelper.runEventLoop(argv=[])”) than I am able to receive all the notifications and sipsimple seems to work. However the PyRun_SimpleString() call does not exit since it holds the event loop and another call of PyRun_SimpleString inside this call of the same function crashes the application. I have tried changing PyRun_SimpleString with PyEval_CallObject() but I get the same results, application crashes for nested calls.<BR>
<BR>
My question is how could I make sipsimple objects(from python code) receive notifications from NotificationCenter and have the main loop started using NSApplicationMain()(to avoid nested python embedding in c API calls)?<BR>
<BR>
The python code that uses the sipsimple API works fine if it is run in the interpretor, not embedded in a C application.<BR>
<BR>
Thank you,<BR>
Mihai Richard</SPAN></FONT>
</BODY>
</HTML>