Changeset 841
- Timestamp:
- 06/23/08 05:20:29 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CallBack/callback-daemon-py/callback_daemon/a2b-callback-daemon.conf
r838 r841 3 3 ; 4 4 5 #config for Database connection5 ; config for Database connection 6 6 [database_my] 7 7 hostname = localhost … … 10 10 password = password 11 11 dbname = a2billing 12 #dbtype value : postgres / mysql12 ; dbtype value : postgres / mysql 13 13 dbtype = mysql 14 14 … … 19 19 password = 20 20 dbname = a2b_13 21 #dbtype value : postgres / mysql21 ; dbtype value : postgres / mysql 22 22 dbtype = postgres 23 23 24 24 25 #config for the daemon process25 ; config for the daemon process 26 26 [daemon-info] 27 27 uid = 28 28 gid = 29 ;pidfile = /var/run/a2b-callback-daemon.pid30 pidfile = ./a2b-callback-daemon.pid29 pidfile = /var/run/a2b-callback-daemon.pid 30 ;pidfile = ./a2b-callback-daemon.pid 31 31 32 32 33 #config for the logger34 #article on http://www.red-dove.com/python_logging.html33 ; config for the logger 34 ; article on http://www.red-dove.com/python_logging.html 35 35 [loggers] 36 36 keys=root,callbackLogger … … 46 46 47 47 [logger_root] 48 level=DEBUG49 #level=INFO48 ;level=DEBUG 49 level=INFO 50 50 handlers=consoleHandler,FileHandler 51 51 52 52 53 53 [logger_callbackLogger] 54 level=DEBUG55 #level=INFO54 ;level=DEBUG 55 level=INFO 56 56 handlers=consoleHandler,FileHandler 57 57 qualname=callbackLogger trunk/CallBack/callback-daemon-py/callback_daemon/a2b_callback_daemon.py
r838 r841 5 5 Daemon to proceed Call-Back request from the a2billing plaftorm 6 6 7 kill -9 `cat /var/run/a2b-callback-daemon.pid` 8 sudo kill -9 `sudo cat /var/run/a2b-callback-daemon.pid` 7 9 ''' 8 10 … … 37 39 38 40 # Daemon Config File 39 CONFIG_FILE = './a2b-callback-daemon.conf' 41 #CONFIG_FILE = './a2b-callback-daemon.conf' 42 CONFIG_FILE = '/etc/asterisk/a2billing.conf' 43 40 44 41 45 # The next 2 parameters will define the speed of the daemon … … 66 70 67 71 setup_logger() 68 72 69 73 70 74 def setup_logger(): … … 73 77 #create logger 74 78 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") 75 86 76 87 # … … 94 105 95 106 def run(self): 96 107 108 Init() 109 97 110 inst_cb_db = CallBackDatabase() 98 111 run_action = CallBackAction(inst_cb_db) … … 122 135 perform_amount_request = 0 123 136 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) 127 138 128 139 if (len(request_list) > 0) : … … 133 144 for current_request in request_list: 134 145 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,' : ' 136 147 try: 137 148 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_username149 #print get_Server_Manager.id,' : ',get_Server_Manager.id_group, ' : ',get_Server_Manager.server_ip, ' : ',get_Server_Manager.manager_username 139 150 except: 140 151 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 211 211 if __name__ == "__main__": 212 212 213 """ 213 214 print "\n\n" 214 215 inst_cb_db = callback_database() 215 216 print inst_cb_db.count_callback_spool() 216 """217 217 218 print 218 219 get_CallBack_Spool = inst_cb_db.find_callback_request('SENT', 121212)
