Fake SMDR server, emulating Panasonic PBX SMDR server behavior
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Golikov Ivan 875b767489 Strip only EOL symbols at the end of generated line instead of simple rstrip() 2 years ago
samples Created sample file with randomly generated numbers 2 years ago
.gitignore Initial commit 2 years ago
README.md Added logging feature 2 years ago
requirements.txt Created requirements.txt 2 years ago
smdr_server.py Strip only EOL symbols at the end of generated line instead of simple rstrip() 2 years ago
utils.py Skipping special symbols at the left of command or password input 2 years ago

README.md

SMDR server

This is fake SMDR server, emulating Panasonic PBX SMDR server behavior. It provides access to SMDR data over telnet. It can be used to test SMDR analyzing software.

Calls data is taken from sample file. You can find examples with randomly generated data in samples folder.

How to run

Minimum required Python version is 3.3

  1. Install dependencies:
    pip3 install -r requirements.txt
  2. Run server:
    python3 smdr_server.py -f samples/sample1.log

Command-line options

-f, --file — path to sample log file. Required argument.
-H, --host — server IP address. Default localhost.
-P, --port — default 2300.
-p, --password — prompt for a password to change it from default pccsmdr. Clients are prompted for this password to access SMDR data.
-e, --eol — EOL sequence. Choices are CR, LF, CR+LF. Default is CR+LF.
-n, --records_on_page — number of records per page. Pages are separated by special headers.
-v, --loglevel — set server loglevel. Choices are CRITICAL, ERROR, WARNING, INFO, DEBUG (from less to more verbose). Default is WARNING. Log is sent to stderr.

Usage

Telnet commands:

  • smdr — get smdr data
  • q — close connection
  • help — show available commands