cdrdelivery

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2019 License: MIT Imports: 7 Imported by: 0

README

CDR Delivery

GitHub repo size GitHub contributors GitHub stars GitHub forks

CDR Delivery is a utility that allows Asterisk developers to do queries in cdr database directly from the command line.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have a Windows, Linux or Mac machine or Docker installed.
  • You have experience with Asterisk CDR.

Install

To install CDR Delivery, Simply download the executable from the releases page, rename the environment file called .env.example to only .env and edit it according to the CDR data source.

# Visit https://github.com/ctvoicer/cdrdelivery/releases/latest page
# Download the tar gzipped file corresponding to your OS.
# In this example we will use Linux.

# Extract the file contents
tar -xzf cdrdelivery_Linux_v1.x.x.tgz

# Inside the app folder, rename .env.example file to only .env
mv .env.example .env

# Change settings in .env file
vim .env

# Run the app
./cdrdelivery

Using

With -h or --help flags you can see the parameters used to filter CDR rows:

./cdrdelivery --help
CDR filter options
--period-start value           Filters calls from this date. (default: 1 month ago from now)
--period-end value             Filters calls to this date. (default: now)
--source value, -s value       Filters calls by their source.
--destination value, -d value  Filters calls by their destination.
--lastdata value               Filters calls by lastdata data.
--disposition value            Filters calls by disposition status.
--uniqueid value, --uid value  Filters calls by uniqueid.
--linkedid value, --lid value  Filters calls by linkedid.
--limit value, -l value        Maximum amount of results.

Contributing

To contribute to CDR Delivery, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin cdrdelivery/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

License

This project uses the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MysqlConnect

func MysqlConnect(options map[string]string) (db *sql.DB, err error)

MysqlConnect creates a MySQL connection

Types

type Call

type Call struct {
	Calldate    string `json:"calldate"`
	Clid        string `json:"clid"`
	Src         string `json:"src"`
	Dst         string `json:"dst"`
	Dcontext    string `json:"dcontext"`
	Channel     string `json:"channel"`
	Dstchannel  string `json:"dstchannel"`
	Lastapp     string `json:"lastapp"`
	Lastdata    string `json:"lastdata"`
	Duration    int    `json:"duration"`
	Billsec     int    `json:"billsec"`
	Disposition string `json:"disposition"`
	Amaflags    int    `json:"amaflags"`
	Accountcode string `json:"accountcode"`
	Userfield   string `json:"userfield"`
	Uniqueid    string `json:"uniqueid"`
	Linkedid    string `json:"linkedid"`
	Sequence    string `json:"sequence"`
	Peeraccount string `json:"peeraccount"`
}

Call represents a CDR row

type Source

type Source struct {
	Type    string
	Options map[string]string
}

Source represents the data source

func SetConnection

func SetConnection(sourceType string, options map[string]string) (source *Source)

SetConnection specifies the data source

func (*Source) GetCalls

func (source *Source) GetCalls(filters map[string]string) (calls []Call, err error)

GetCalls will search the calls according to the entered filters.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL