opensipscli 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.1
2
+ Name: opensipscli
3
+ Version: 0.3.1
4
+ Summary: OpenSIPS Command Line Interface
5
+ Home-page: https://github.com/OpenSIPS/opensips-cli
6
+ Download-URL: https://github.com/OpenSIPS/opensips-cli/archive/master.zip
7
+ Author: OpenSIPS Project
8
+ Author-email: project@opensips.org
9
+ Maintainer: Razvan Crainea
10
+ Maintainer-email: razvan@opensips.org
11
+ Project-URL: Source Code, https://github.com/OpenSIPS/opensips-cli
12
+ Project-URL: Issues Tracker, https://github.com/OpenSIPS/opensips-cli/issues
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
15
+ Classifier: Operating System :: OS Independent
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: opensips
19
+ Requires-Dist: mysqlclient<1.4.0rc1
20
+ Requires-Dist: sqlalchemy<2,>=1.3.3
21
+ Requires-Dist: sqlalchemy-utils
22
+
23
+ # OpenSIPS CLI (Command Line Interface)
24
+
25
+ OpenSIPS CLI is an interactive command line tool that can be used to control
26
+ and monitor **OpenSIPS SIP servers**. It uses the Management Interface
27
+ exported by OpenSIPS over JSON-RPC to gather raw information from OpenSIPS and
28
+ display it in a nicer, more structured manner to the user.
29
+
30
+ The tool is very flexible and has a modular design, consisting of multiple
31
+ modules that implement different features. New modules can be easily added by
32
+ creating a new module that implements the [OpenSIPS CLI
33
+ Module](opensipscli/module.py) Interface.
34
+
35
+ OpenSIPS CLI is an interactive console that features auto-completion and
36
+ reverse/forward command history search, but can also be used to execute
37
+ one-liners for automation purposes.
38
+
39
+ OpenSIPS CLI can communicate with an OpenSIPS server using different transport
40
+ methods, such as fifo or http.
41
+
42
+ # Compatibility
43
+
44
+ This tool uses the new JSON-RPC interface added in OpenSIPS 3.0, therefore
45
+ it can only be used with OpenSIPS versions higher than or equal to 3.0. For older
46
+ versions of OpenSIPS, use the classic `opensipsctl` tool from the `opensips` project.
47
+
48
+ ## Usage
49
+
50
+ ### Tool
51
+
52
+ Simply run `opensips-cli` tool directly in your cli.
53
+ By default the tool will start in interactive mode.
54
+
55
+ OpenSIPS CLI accepts the following arguments:
56
+ * `-h|--help` - used to display information about running `opensips-cli`
57
+ * `-v|--version` - displays the version of the running tool
58
+ * `-d|--debug` - starts the `opensips-cli` tool with debugging enabled
59
+ * `-f|--config` - specifies a configuration file (see [Configuration
60
+ Section](#configuration) for more information)
61
+ * `-i|--instance INSTANCE` - changes the configuration instance (see [Instance
62
+ Module](docs/modules/instance.md) Documentation for more information)
63
+ * `-o|--option KEY=VALUE` - sets/overwrites the `KEY` configuration parameter
64
+ with the specified `VALUE`. Works for both core and modules parameters. Can be
65
+ used multiple times, for different options
66
+ * `-x|--execute` - executes the command specified and exits
67
+
68
+ In order to run `opensips-cli` without installing it, you have to export the
69
+ `PYTHONPATH` variable to the root of the `opensips-cli` and `python-opensips`
70
+ packages. If you installed the two packages under `/usr/local/src`, simply do:
71
+
72
+ ```
73
+ export PYTHONPATH=/usr/local/src/opensips-cli:/usr/local/src/python-opensips
74
+ /usr/local/src/opensips-cli/bin/opensips-cli
75
+ ```
76
+
77
+ ### Python Module
78
+
79
+ The module can be used as a python module as well. A simple snippet of running
80
+ an MI command using the tool is:
81
+
82
+ ```
83
+ from opensipscli import cli
84
+
85
+ opensipscli = cli.OpenSIPSCLI()
86
+ print(opensipscli.mi('ps'))
87
+ ```
88
+
89
+ The OpenSIPSCLI object can receive a set of arguments/modifiers through the
90
+ `OpenSIPSCLIArgs` class, i.e.:
91
+
92
+ ```
93
+ from opensipscli import args
94
+ ...
95
+ args = OpenSIPSCLIArgs(debug=True)
96
+ opensipscli = cli.OpenSIPSCLI(args)
97
+ ...
98
+ ```
99
+
100
+ Custom settings can be provided thourgh the arguments, i.e.:
101
+ ```
102
+ # run commands over http
103
+ args = OpenSIPSCLIArgs(communcation_type = "http",
104
+ url="http://127.0.0.1:8080/mi")
105
+ ...
106
+ ```
107
+
108
+ ### Docker Image
109
+
110
+ The OpenSIPS CLI tool can be run in a Docker container. The image is available
111
+ on Docker Hub at [opensips/opensips-cli](https://hub.docker.com/r/opensips/opensips-cli).
112
+ For more information on how to run the tool in a Docker container, please refer to the
113
+ [OpenSIPS CLI Docker Image](docker/docker.md) documentation.
114
+
115
+ ## Configuration
116
+
117
+ OpenSIPS CLI accepts a configuration file, formatted as an `ini` or `cfg`
118
+ file, that can store certain parameters that influence the behavior of the
119
+ OpenSIPS CLI tool. You can find [here](etc/default.cfg) an example of a
120
+ configuration file that behaves exactly as the default parameters. The set of
121
+ default values used, when no configuration file is specified, can be found
122
+ [here](opensipscli/defaults.py).
123
+
124
+ The configuration file can have multiple sections/instances, managed by the
125
+ [Instance](docs/modules/instance.md) module. One can choose different
126
+ instances from the configuration file by specifying the `-i INSTANCE` argument
127
+ when starting the cli tool.
128
+
129
+ If no configuration file is specified by the `-f|--config` argument, OpenSIPS
130
+ CLI searches for one in the following locations:
131
+
132
+ * `~/.opensips-cli.cfg` (highest precedence)
133
+ * `/etc/opensips-cli.cfg`
134
+ * `/etc/opensips/opensips-cli.cfg` (lowest precedence)
135
+
136
+ If no file is found, it starts with the default configuration.
137
+
138
+ The OpenSIPS CLI core can use the following parameters:
139
+
140
+ * `prompt_name`: The name of the OpenSIPS CLI prompt (Default: `opensips-cli`)
141
+ * `prompt_intro`: Introduction message when entering the OpenSIPS CLI
142
+ * `prompt_emptyline_repeat_cmd`: Repeat the last command on an emptyline (Default: `False`)
143
+ * `history_file`: The path of the history file (Default: `~/.opensips-cli.history`)
144
+ * `history_file_size`: The backlog size of the history file (Default: `1000`)
145
+ * `log_level`: The level of the console logging (Default: `WARNING`)
146
+ * `communication_type`: Communication transport used by OpenSIPS CLI (Default: `fifo`)
147
+ * `fifo_file`: The OpenSIPS FIFO file to which the CLI will write commands
148
+ (Default: `/var/run/opensips/opensips_fifo`)
149
+ * `fifo_file_fallback`: A fallback FIFO file that is being used when the `fifo_file`
150
+ is not found - this has been introduces for backwards compatibility when the default
151
+ `fifo_file` has been changed from `/tmp/opensips_fifo` (Default: `/tmp/opensips_fifo`)
152
+ * `fifo_reply_dir`: The default directory where `opensips-cli` will create the
153
+ fifo used for the reply from OpenSIPS (Default: `/tmp`)
154
+ * `url`: The default URL used when `http` `communication_type` is used
155
+ (Default: `http://127.0.0.1:8888/mi`).
156
+ * `datagram_ip`: The default IP used when `datagram` `communication_type` is used (Default: `127.0.0.1`)
157
+ * `datagram_port`: The default port used when `datagram` `communication_type` is used (Default: `8080`)
158
+
159
+ Each module can use each of the parameters above, but can also declare their
160
+ own. You can find in each module's documentation page the parameters that they
161
+ are using.
162
+
163
+ Configuration parameters can be overwritten using the `-o/--option` arguments,
164
+ as described in the [Usage](#tool) section.
165
+
166
+ It is also possible to set a parameters dynamically, using the `set` command.
167
+ This configuration is only available during the current interactive session,
168
+ and also gets cleaned up when an instance is switched.
169
+
170
+ ## Modules
171
+
172
+ The OpenSIPS CLI tool consists of the following modules:
173
+ * [Management Interface](docs/modules/mi.md) - run MI commands
174
+ * [Database](docs/modules/database.md) - commands to create, modify, drop, or
175
+ migrate an OpenSIPS database
176
+ * [Diagnose](docs/modules/diagnose.md) - instantly diagnose OpenSIPS instances
177
+ * [Instance](docs/modules/instance.md) - used to switch through different
178
+ instances/configuration within the config file
179
+ * [User](docs/modules/user.md) - utility used to add and remove OpenSIPS users
180
+ * [Trace](docs/modules/trace.md) - trace calls information from users
181
+ * [Trap](docs/modules/trap.md) - use `gdb` to take snapshots of OpenSIPS workers
182
+ * [TLS](docs/modules/tls.md) - utility to generate certificates for TLS
183
+
184
+ ## Communication
185
+
186
+ OpenSIPS CLI can communicate with an OpenSIPS instance through MI using
187
+ different transports. Supported transports at the moment are:
188
+ * `FIFO` - communicate over the `mi_fifo` module
189
+ * `HTTP` - use JSONRPC over HTTP through the `mi_http` module
190
+ * `DATAGRAM` - communicate over UDP using the `mi_datagram` module
191
+
192
+ ## Installation
193
+
194
+ Please follow the details provided in the
195
+ <a href="docs/INSTALLATION.md">Installation</a> section, for a complete guide
196
+ on how to install `opensips-cli` as a replacement for the deprecated
197
+ `opensipsctl` shell script.
198
+
199
+ ## Contribute
200
+
201
+ Feel free to contribute to this project with any module, or functionality you
202
+ find useful by opening a pull request.
203
+
204
+ ## History
205
+
206
+ This project was started by **Dorin Geman**
207
+ ([dorin98](https://github.com/dorin98)) as part of the [ROSEdu
208
+ 2018](http://soc.rosedu.org/2018/) program. It has later been adapted to the
209
+ new OpenSIPS 3.0 MI interface and became the main external tool for managing
210
+ OpenSIPS.
211
+
212
+ ## License
213
+
214
+ <!-- License source -->
215
+ [License-GPLv3]: https://www.gnu.org/licenses/gpl-3.0.en.html "GNU GPLv3"
216
+ [Logo-CC_BY]: https://i.creativecommons.org/l/by/4.0/88x31.png "Creative Common Logo"
217
+ [License-CC_BY]: https://creativecommons.org/licenses/by/4.0/legalcode "Creative Common License"
218
+
219
+ The `opensips-cli` source code is licensed under the [GNU General Public License v3.0][License-GPLv3]
220
+
221
+ All documentation files (i.e. `.md` extension) are licensed under the [Creative Common License 4.0][License-CC_BY]
222
+
223
+ ![Creative Common Logo][Logo-CC_BY]
224
+
225
+ © 2018 - 2020 OpenSIPS Solutions
@@ -0,0 +1,28 @@
1
+ opensipscli/__init__.py,sha256=6Z2ET3BI44KCY0QUESzylWtRs3_UwL4uc_xL2suJUjs,798
2
+ opensipscli/args.py,sha256=Kq86vRMqREqLj6NfcTd926LInNpN95f1ce6Y0WKFzo0,1589
3
+ opensipscli/cli.py,sha256=6pDWTbUzRhpJ2C4RYLvxEp3GfM83cKs0ruHgJ1FZJ4g,16203
4
+ opensipscli/comm.py,sha256=g0-kZxBjxjekCOARBc1Mhk06VG2G3bSFxFzzZDlJu_E,1839
5
+ opensipscli/config.py,sha256=uvPTGofjmH6AHnETOJ5amBys1W1W2F0vFFB1AVfI9Cw,5530
6
+ opensipscli/db.py,sha256=BMynjtnTYR55d1jICQ4NGbFw0hZjWu9MFzR-tmtiMoA,34480
7
+ opensipscli/defaults.py,sha256=A0M9HhO_VZTkp0tlTzmFnrPaE7jJoBS_mZHT1am2rZM,2601
8
+ opensipscli/logger.py,sha256=tP7_yp17R5a6W1Qcpk5xG0K_krd_IyznwObYbtw93yQ,2728
9
+ opensipscli/main.py,sha256=UE6dlE1TE3PCuC17gt_gxqeY26QxoXPhgfK5U9FvxZA,3241
10
+ opensipscli/module.py,sha256=qZrL5giIncwQsJ_GYsOryCYB2i6uZ1jGRgcDcn-efeE,2308
11
+ opensipscli/version.py,sha256=d9Wcli7rDEgqY19HFh2gVgTCF6c7UTlkviAtHsSwoiM,842
12
+ opensipscli/libs/__init__.py,sha256=ZTn6Sx1WtBE2_DiYc6R1E8QXJcOXOxeLUw5E45gvzxY,811
13
+ opensipscli/libs/sqlalchemy_utils.py,sha256=28qUGMfOO5f6cJ0bwFqUsyg-joRVwXMJM_5QAjWr0OI,8756
14
+ opensipscli/modules/__init__.py,sha256=L1JxeMhlOyxfRDHrSvlioAoIdvpsK4X9ySrFhUoOihA,947
15
+ opensipscli/modules/database.py,sha256=LrnWfEL8qN2tOXaLQbHuW3fJ0nKMOCn7fX5-1oUQAvg,31324
16
+ opensipscli/modules/diagnose.py,sha256=KEHORYtmoWeSOlEbO6o_ZPfZzDQ7JCiN-54JGDonOkk,38924
17
+ opensipscli/modules/instance.py,sha256=1B9cr6cpwGCRY03xA4LGF2adtsc9yxahS5wjlX6tJUE,1828
18
+ opensipscli/modules/mi.py,sha256=jMYXKX6LimGWaMTejfubcIQMEyRbN09q5Xxygh7O1v8,7156
19
+ opensipscli/modules/tls.py,sha256=ruuvWN_C1gZBNV8RU6kqchEZWkzl_uVV6DQ19lW6Ul0,13144
20
+ opensipscli/modules/trace.py,sha256=TZginhQRUKXAjGG73ks5jlkS8yfxjf-qy5TbHecrsPE,9910
21
+ opensipscli/modules/trap.py,sha256=7PTwgSzjXhMz8iF7Xlr5_wQcmqt_G-q16lGZQreBL2k,4899
22
+ opensipscli/modules/user.py,sha256=BKA2ZAtBSFKYSw1m5zXziRDKDbtSZQieArqAj33qTDY,9731
23
+ opensipscli-0.3.1.data/scripts/opensips-cli,sha256=MBWQGtfrRCHDAz2F3C5Pxk9FJ04-g8e5KoGRpgBHE4I,121
24
+ opensipscli-0.3.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
25
+ opensipscli-0.3.1.dist-info/METADATA,sha256=n1xMywKi5PxK2VCT6mZKeIBY4WzdxdDobey-cjUhjkg,9513
26
+ opensipscli-0.3.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
+ opensipscli-0.3.1.dist-info/top_level.txt,sha256=ngBDjeE6-dpEr_7WF1J3wM4r33TjJpegoGWiU0sq0UQ,12
28
+ opensipscli-0.3.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.6.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ opensipscli