[SIP Beyond VoIP] SIP Simple in existing reactor loop

Chris Maciejewski chris at wima.co.uk
Tue Jan 7 20:38:30 CET 2014


Hi,

I am having a hard time running SIP Simple in Twisted based GTK+ 3.0
application:

https://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html#auto12

Example code below:

from twisted.internet import gtk3reactor
gtk3reactor.install()

from gi.repository import Gtk, Gio
from zope.interface import implements
from sipsimple.application import SIPApplication
from sipsimple.storage import MemoryStorage

class SipSimpleTestApp(Gtk.Application):

  def __init__(self):
    Gtk.Application.__init__(self,
application_id="apps.test.SipSimpleTestApp",
flags=Gio.ApplicationFlags.FLAGS_NONE)
    self.connect("activate", self.on_activate)

  def on_activate(self, data=None):

    window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL)
    window.set_title("SIP Simple Hello World")
    label = Gtk.Label("SIP Simple Hello World")
    window.add(label)
    window.show_all()

    self.add_window(window)

    self.sip = SIPApplication();
    self.sip.start(MemoryStorage());

if __name__ == "__main__":
    app = SipSimpleTestApp()
    from twisted.internet import reactor
    reactor.registerGApplication(app)
    reactor.run()

Throws ReactorAlreadyRunning exception.

Any suggestions what would be the best approach to run SIPApplication
inside of GTK reactor GUI very much appreciated.

Regards,
Chris


More information about the SIPBeyondVoIP mailing list