Changeset 841

Show
Ignore:
Timestamp:
06/23/08 05:20:29 (7 months ago)
Author:
areski
Message:

little fixes on daemon, logging, debug,

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CallBack/callback-daemon-py/callback_daemon/a2b-callback-daemon.conf

    r838 r841  
    33; 
    44 
    5 # config for Database connection 
     5; config for Database connection 
    66[database_my] 
    77hostname = localhost 
     
    1010password = password 
    1111dbname = a2billing 
    12 # dbtype value : postgres / mysql 
     12; dbtype value : postgres / mysql 
    1313dbtype = mysql 
    1414 
     
    1919password =  
    2020dbname = a2b_13 
    21 # dbtype value : postgres / mysql 
     21; dbtype value : postgres / mysql 
    2222dbtype = postgres 
    2323 
    2424 
    25 # config for the daemon process 
     25; config for the daemon process 
    2626[daemon-info] 
    2727uid = 
    2828gid = 
    29 ;pidfile = /var/run/a2b-callback-daemon.pid 
    30 pidfile = ./a2b-callback-daemon.pid 
     29pidfile = /var/run/a2b-callback-daemon.pid 
     30;pidfile = ./a2b-callback-daemon.pid 
    3131 
    3232 
    33 # config for the logger 
    34 # article on http://www.red-dove.com/python_logging.html 
     33; config for the logger 
     34; article on http://www.red-dove.com/python_logging.html 
    3535[loggers] 
    3636keys=root,callbackLogger 
     
    4646 
    4747[logger_root] 
    48 level=DEBUG 
    49 #level=INFO 
     48;level=DEBUG 
     49level=INFO 
    5050handlers=consoleHandler,FileHandler 
    5151 
    5252 
    5353[logger_callbackLogger] 
    54 level=DEBUG 
    55 #level=INFO 
     54;level=DEBUG 
     55level=INFO 
    5656handlers=consoleHandler,FileHandler 
    5757qualname=callbackLogger 
  • trunk/CallBack/callback-daemon-py/callback_daemon/a2b_callback_daemon.py

    r838 r841  
    55Daemon to proceed Call-Back request from the a2billing plaftorm 
    66 
     7kill -9 `cat /var/run/a2b-callback-daemon.pid` 
     8sudo kill -9 `sudo cat /var/run/a2b-callback-daemon.pid` 
    79''' 
    810 
     
    3739 
    3840# Daemon Config File 
    39 CONFIG_FILE = './a2b-callback-daemon.conf' 
     41#CONFIG_FILE = './a2b-callback-daemon.conf' 
     42CONFIG_FILE = '/etc/asterisk/a2billing.conf' 
     43 
    4044 
    4145# The next 2 parameters will define the speed of the daemon 
     
    6670     
    6771    setup_logger() 
    68      
     72 
    6973 
    7074def setup_logger(): 
     
    7377    #create logger 
    7478    logger = logging.getLogger("callbackLogger") 
     79     
     80    # test logger 
     81    logger.debug("debug message") 
     82    logger.info("info message") 
     83    logger.warn("warn message") 
     84    logger.error("error message") 
     85    logger.critical("critical message") 
    7586 
    7687# 
     
    94105     
    95106    def run(self): 
    96              
     107         
     108        Init() 
     109         
    97110        inst_cb_db = CallBackDatabase() 
    98111        run_action = CallBackAction(inst_cb_db) 
     
    122135        perform_amount_request = 0 
    123136         
    124         request_list = self.inst_cb_db.find_callback_request('PENDING', 121212) 
    125         print "len(request_list) = " 
    126         print len(request_list) 
     137        request_list = self.inst_cb_db.find_callback_request('PENDING', 11124) 
    127138         
    128139        if (len(request_list) > 0) : 
     
    133144        for current_request in request_list: 
    134145             
    135             print current_request.id,' : ',current_request.channel,' : ',current_request.context,' : ',current_request.exten,' : ',current_request.priority,' : ' 
     146            #print current_request.id,' : ',current_request.channel,' : ',current_request.context,' : ',current_request.exten,' : ',current_request.priority,' : ' 
    136147            try: 
    137148                get_Server_Manager = self.inst_cb_db.find_server_manager_roundrobin(current_request.id_server_group) 
    138                 print get_Server_Manager.id,' : ',get_Server_Manager.id_group, ' :  ',get_Server_Manager.server_ip, ' : ',get_Server_Manager.manager_username 
     149                #print get_Server_Manager.id,' : ',get_Server_Manager.id_group, ' :  ',get_Server_Manager.server_ip, ' : ',get_Server_Manager.manager_username 
    139150            except: 
    140151                logging.error("ERROR to find the Server Manager for the Id group : " + str(current_request.id_server_group)) 
  • trunk/CallBack/callback-daemon-py/callback_daemon/database.py

    r838 r841  
    211211if __name__ == "__main__": 
    212212     
     213    """ 
    213214    print "\n\n" 
    214215    inst_cb_db = callback_database() 
    215216    print inst_cb_db.count_callback_spool() 
    216     """ 
     217     
    217218    print 
    218219    get_CallBack_Spool = inst_cb_db.find_callback_request('SENT', 121212) 


Google