Example #1
0
 def go_offline(self):
     #print 'go_offline', self
     if self.online:
         self.global_config['_sip_logger'].write('RTPproxy "%s" has changed ' \
           'status from online to offline' % self.name)
         self.stats_cache = {}
         if self.on_state_change != None:
             self.on_state_change(self, False)
     Rtp_proxy_client.go_offline(self)
Example #2
0
 def go_offline(self):
     #print 'go_offline', self
     if self.online:
         self.global_config['_sip_logger'].write('RTPproxy "%s" has changed ' \
           'status from online to offline' % self.name)
         self.stats_cache = {}
         if self.on_state_change != None:
             self.on_state_change(self, False)
     Rtp_proxy_client.go_offline(self)
Example #3
0
 def go_online(self):
     #print 'go_online', self
     online_pre = self.online
     # Rtp_proxy_client may or may not decide to change actual status
     Rtp_proxy_client.go_online(self)
     if online_pre or not self.online:
         return
     self.global_config['_sip_logger'].write('RTPproxy "%s" has changed ' \
       'status from offline to online' % self.name)
     if self.on_state_change != None:
         self.on_state_change(self, True)
Example #4
0
 def go_online(self):
     #print 'go_online', self
     online_pre = self.online
     # Rtp_proxy_client may or may not decide to change actual status
     Rtp_proxy_client.go_online(self)
     if online_pre or not self.online:
         return
     self.global_config['_sip_logger'].write('RTPproxy "%s" has changed ' \
       'status from offline to online' % self.name)
     if self.on_state_change != None:
         self.on_state_change(self, True)
Example #5
0
 def __init__(self, name, global_config, address, cmd_out_address, **kwargs):
     self.call_id_map = []
     self.call_id_map_old = []
     self.name = name
     self.global_config = global_config
     self.asess_filtered = rc_filter(0.5)
     self.cmd_out_address = cmd_out_address
     self.stats_cache = {}
     if cmd_out_address != None:
         bind_address = (cmd_out_address, 0)
     else:
         bind_address = None
     Rtp_proxy_client.__init__(self, global_config, address,
       bind_address = bind_address, **kwargs)
     self.timer = TimeoutInact(self.call_id_map_aging, 600, -1)
     self.timer.spread_runs(0.1)
     self.timer.go()
Example #6
0
 def __init__(self, name, global_config, address, cmd_out_address,
              **kwargs):
     self.call_id_map = []
     self.call_id_map_old = []
     self.name = name
     self.global_config = global_config
     self.asess_filtered = rc_filter(0.5)
     self.cmd_out_address = cmd_out_address
     self.stats_cache = {}
     if cmd_out_address != None:
         bind_address = (cmd_out_address, 0)
     else:
         bind_address = None
     Rtp_proxy_client.__init__(self,
                               global_config,
                               address,
                               bind_address=bind_address,
                               **kwargs)
     self.timer = TimeoutInact(self.call_id_map_aging, 600, -1)
     self.timer.spread_runs(0.1)
     self.timer.go()
Example #7
0
 def reconnect(self, address):
     if self.cmd_out_address != None:
         bind_address = (self.cmd_out_address, 0)
     else:
         bind_address = None
     Rtp_proxy_client.reconnect(self, address, bind_address = bind_address)
Example #8
0
 def update_active(self, active_sessions, *more_args):
     self.asess_filtered.apply(active_sessions)
     if self.active_sessions != active_sessions and self.on_active_update != None:
         self.on_active_update(self, active_sessions)
     Rtp_proxy_client.update_active(self, active_sessions, *more_args)
Example #9
0
 def reconnect(self, address):
     if self.cmd_out_address != None:
         bind_address = (self.cmd_out_address, 0)
     else:
         bind_address = None
     Rtp_proxy_client.reconnect(self, address, bind_address=bind_address)
Example #10
0
 def update_active(self, active_sessions, *more_args):
     self.asess_filtered.apply(active_sessions)
     if self.active_sessions != active_sessions and self.on_active_update != None:
         self.on_active_update(self, active_sessions)
     Rtp_proxy_client.update_active(self, active_sessions, *more_args)