1 from ipypbx import models, state
4 class BaseHandler(object):
6 Base class for various entity handlers.
8 Doesn't do anything useful on its own.
13 def __init__(self, parent):
17 class ConnectionsHandler(BaseHandler):
21 def select(self, index):
23 Select another connection as current.
25 state.currentConnection = state.connections[index]
29 TODO: Clone an existing connection.
31 This creates a new connection with bound data copied from another one.
38 state.currentConnection = None
39 self.parent.ui.connectionName.setText('')
40 self.parent.ui.connectionLocalIpAddress.setText('')
41 self.parent.ui.connectionLocalPort.setText('')
42 self.parent.ui.connectionFreeswitchIpAddress.setText('')
43 self.parent.ui.connectionFreeswitchPort.setText('')
46 connection = models.Connection(
47 name=self.parent.ui.connectionName.getText(),
48 local_ip_address=self.parent.ui.connectionLocalIpAddress.\
50 local_port=self.parent.ui.connectionLocalPort.getText(),
51 freeswitch_ip_address=self.parent.ui.\
52 connectionFreeswitchIpAddress.getText(),
53 freeswitch_port=self.parent.ui.connectionFreeswitchPort.getText()
55 #state.currentConnection =