-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nikolay
committed
Jul 24, 2020
1 parent
3a58709
commit cfd9392
Showing
8 changed files
with
110 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
dwgconfig.py | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
port = 12000 # DWG Gateway port | ||
login = 'test' # DWG API Login (from API 2.0) | ||
password = 'test' # DWG API Password (from API 2.0) | ||
income_path = '/var/spool/dwgp/incoming/' # SMS income path | ||
send_path = '/var/spool/dwgp/send/' # SMS send path | ||
ussd_income_path = '/var/spool/dwgp/ussd_incoming/' # USSD income path | ||
ussd_send_path = '/var/spool/dwgp/ussd_send' # USSD send path | ||
run_program = '/etc/local_scripts/radius2.php' # External program after receiving SMS | ||
debug = True # On/OFF Debug | ||
|
||
pidfile = '/var/run/dwg_server.pid' # PID file path (for daemon) | ||
logfile = '/var/log/dwg_server.log' # Log file path (for daemon) | ||
log_format = '[%(asctime)s] [%(levelname)s] %(message)s' # Log file format | ||
log_date_format = '%d.%m.%Y %H:%M:%S' # Log file date format | ||
|
||
if __name__ == '__main__': | ||
print 'Config file for Dinstar DWG Gateways!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
import dwgconfig | ||
|
||
|
||
def create_logger(debug=False): | ||
log = logging.getLogger() | ||
formatter = logging.Formatter(dwgconfig.log_format, datefmt=dwgconfig.log_date_format) | ||
log_level = logging.DEBUG | ||
if debug: | ||
log_handler = logging.StreamHandler() | ||
else: | ||
if not dwgconfig.debug: | ||
log_level = logging.INFO | ||
log_handler = logging.FileHandler(dwgconfig.logfile) | ||
log_handler.setLevel(log_level) | ||
log_handler.setFormatter(formatter) | ||
log.setLevel(log_level) | ||
log.addHandler(log_handler) |
cfd9392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello
i want to do smart panel for ussd recharge DINSTAR GW
HOW MUCH IT COST