class HelloLiveEverything(AsteriskServerListener, PropertyChangeListener):
    def __init__(self):
        self.asteriskServer = DefaultAsteriskServer("localhost", "manager", "pa55word")

    def run(self):
        # Listen for new events
        self.asteriskServer.addAsteriskServerListener(self)

        # Add property change listeners to existing objects
        for asteriskChannel in self.asteriskServer.getChannels():
            print(asteriskChannel)
            asteriskChannel.addPropertyChangeListener(self)

        for asteriskQueue in self.asteriskServer.getQueues():
            print(asteriskQueue)
            for asteriskChannel in asteriskQueue.getEntries():
                asteriskChannel.addPropertyChangeListener(self)

        for meetMeRoom in self.asteriskServer.getMeetMeRooms():
            print(meetMeRoom)
            for user in meetMeRoom.getUsers():
                user.addPropertyChangeListener(self)

    def onNewAsteriskChannel(self, channel):
        print(channel)
        channel.addPropertyChangeListener(self)

    def onNewMeetMeUser(self, user):
        print(user)
        user.addPropertyChangeListener(self)

    def propertyChange(self, propertyChangeEvent):
        print(propertyChangeEvent)
示例#2
0
class HelloLive:
    def __init__(self):
        self.asteriskServer = DefaultAsteriskServer("localhost", "manager", "pa55word")

    def run(self):
        for asteriskChannel in self.asteriskServer.getChannels():
            print(asteriskChannel)
        for asteriskQueue in self.asteriskServer.getQueues():
            print(asteriskQueue)
        for meetMeRoom in self.asteriskServer.getMeetMeRooms():
            print(meetMeRoom)
class HelloLiveEvents(AsteriskServerListener):
    def __init__(self):
        self.asteriskServer = DefaultAsteriskServer("localhost", "manager", "pa55word")

    def run(self):
        self.asteriskServer.addAsteriskServerListener(self)

    def onNewAsteriskChannel(self, channel):
        print(channel)

    def onNewMeetMeUser(self, user):
        print(user)
 def __init__(self):
     self.asteriskServer = DefaultAsteriskServer("localhost", "manager", "pa55word")