Exemple #1
0
    def __init__(self, address, handle_class, filter=None):
        self.log = FileLogger(logfile='/var/log/billing.log')
        #self.log = StdoutLogger()

        self.log.info("Start server %s ..." % str(address))

        self.conn = DBConnection()
        self.conn_portabilidade = DBConnection(host='186.226.87.8', database='portabilidade', limit=30)
        self.sim_calls = 0
        
        OutboundServer.__init__(self, address, handle_class, filter)
Exemple #2
0
    def __init__(self, address, handle_class, filter=None):
        self.log = FileLogger(logfile='/var/log/billing.log')
        #self.log = StdoutLogger()

        self.log.info("Start server %s ..." % str(address))

        self.conn = DBConnection()
        self.conn_portabilidade = DBConnection(host='186.226.87.8',
                                               database='portabilidade',
                                               limit=30)
        self.sim_calls = 0

        OutboundServer.__init__(self, address, handle_class, filter)
 def __init__(self, configfile, daemon=False, pidfile="/tmp/plivo_outbound.pid", filter=None):
     self._request_id = 0
     self._daemon = daemon
     self._run = False
     self._pidfile = pidfile
     # load config
     self._config = helpers.get_config(configfile)
     # create logger
     self.create_logger()
     # create outbound server
     self.fs_outbound_address = helpers.get_conf_value(self._config, "freeswitch", "FS_OUTBOUND_ADDRESS")
     fs_host, fs_port = self.fs_outbound_address.split(":", 1)
     fs_port = int(fs_port)
     self.default_answer_url = helpers.get_conf_value(self._config, "freeswitch", "DEFAULT_ANSWER_URL")
     self.auth_id = helpers.get_conf_value(self._config, "rest_server", "AUTH_ID")
     self.auth_token = helpers.get_conf_value(self._config, "rest_server", "AUTH_TOKEN")
     self.default_hangup_url = helpers.get_conf_value(self._config, "freeswitch", "DEFAULT_HANGUP_URL")
     # default hangup_url is answer_url
     if not self.default_hangup_url:
         self.default_hangup_url = self.default_answer_url
     # This is where we define the connection with the
     # Plivo XML grammar Processor
     OutboundServer.__init__(self, (fs_host, fs_port), PlivoOutboundEventSocket, filter)
 def __init__(self, address, handle_class, filter=None):
     self.log = StdoutLogger()
     self.log.info("Start server %s ..." % str(address))
     OutboundServer.__init__(self, address, handle_class, filter)
 def __init__(self, address, handle_class, filter=None):
     self.log = StdoutLogger()
     self.log.info("Start server %s ..." % str(address))
     OutboundServer.__init__(self, address, handle_class, filter)