opensips-mi 0.0.11 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fc7093889a67efa9694b4fbd1617044d7fab88d876e7aba8ba20b5385ba67f5
4
- data.tar.gz: a03613f39146e109c1de1949b48802fdcf84b2a73ae41247858dcab5429b38b6
3
+ metadata.gz: e13c9966a4b4c84d25ec9e900d1b640f3650f6d33989c152070ccd67a707cc51
4
+ data.tar.gz: e22c248064c8ae003c45a84dc871d24c4070f01ac1951ffcf7504e2351792cc3
5
5
  SHA512:
6
- metadata.gz: 955848e500a74ebe27065494ad83353ae04c8c0710f824242d02195b3dfdffefb0a2a8d984b73dd7b4bb578bcf26dcf7f799e79d31e54d10598657fb70ffdc3f
7
- data.tar.gz: b24b7f8e3f27c9b9bc4f544bd0f60c63da346cbd759a61e2be5628907d671782e564fa013ba930465f3ebb23b27313c8fb55588d4e10920c05f494c856a4aa28
6
+ metadata.gz: 77fefce67ccc8ef925daeca1726e8efb22fc1746889108aa6fbbb571f07857b305b9ccf4de62a2cf229481cf7bbf628a5bfc3e5df8a9a04a03bb281fa0667e29
7
+ data.tar.gz: 552c0cbfaaf7d5c38bf0a931acd1a05bd6eb5f6649d23175943ca291a19474e62ceaaeb36e74f1d89cb157f2d90aee9d39663e57dcfd40c30d2060e21355f215
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ staskobzar@gmail.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,7 @@
1
+ ## Contributing
2
+
3
+ 1. Fork it
4
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
5
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
6
+ 4. Push to the branch (`git push origin my-new-feature`)
7
+ 5. Create new Pull Request
data/Gemfile CHANGED
@@ -1,7 +1,12 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
1
+ # frozen_string_literal: true
4
2
 
5
- gem 'simplecov', require: false, group: :test
3
+ source "https://rubygems.org"
6
4
 
5
+ # Specify your gem's dependencies in opensips-mi.gemspec
7
6
  gemspec
7
+
8
+ gem "rake", "~> 13.0", group: :development
9
+ gem "rspec", "~> 3.0", group: :development
10
+ gem "rubocop", "~> 1.21", group: :development
11
+ gem "simplecov", require: false, group: :test
12
+ gem "webmock", group: :test
data/README.md CHANGED
@@ -1,18 +1,21 @@
1
1
  # Opensips::Mi
2
- [![Build Status](https://travis-ci.org/staskobzar/opensips-mi.png?branch=master)](https://travis-ci.org/staskobzar/opensips-mi)
2
+
3
+ [![Ruby Build](https://github.com/staskobzar/opensips-mi/actions/workflows/main.yml/badge.svg)](https://github.com/staskobzar/opensips-mi/actions/workflows/main.yml)
3
4
  [![Code Climate](https://codeclimate.com/github/staskobzar/opensips-mi.png)](https://codeclimate.com/github/staskobzar/opensips-mi)
4
5
  [![Gem Version](https://badge.fury.io/rb/opensips-mi.png)](http://badge.fury.io/rb/opensips-mi)
5
6
  [![Coverage Status](https://coveralls.io/repos/staskobzar/opensips-mi/badge.png?branch=master)](https://coveralls.io/r/staskobzar/opensips-mi)
6
7
 
7
- OpenSIPs management interface library.
8
+ OpenSIPs management interface library.
8
9
  This library supports following management interfaces OpenSIPs modules:
9
10
 
10
- * mi_fifo
11
- * mi_datagram
12
- * mi_xmlrpc
11
+ - mi_datagram
12
+ - mi_fifo
13
+ - mi_http
14
+ - mi_xmlrpc
13
15
 
14
- ## Disclamer
15
- This is old version and works only with olde openisips versions (older then v3)
16
+ > version 1+ supports only new MI jsonrpc used by opensips v3+.
17
+ > if you need older version with a plain text MI protocol install
18
+ > this library version 0.0.11
16
19
 
17
20
  ## Installation
18
21
 
@@ -33,26 +36,40 @@ Or install it yourself as:
33
36
  ### Generic function to connect mi
34
37
 
35
38
  Using generic function to connect management interface:
39
+
36
40
  ```ruby
37
41
  require 'opensips/mi'
38
42
  Opensips::MI.connect INTERFACE, PARAMS
39
43
  ```
44
+
40
45
  Parameters:
41
46
 
42
- *INTRFACE* - interface name. One of the following:
47
+ _INTRFACE_ - interface name. One of the following:
43
48
 
44
- * :fifo
45
- * :datagram
46
- * :xmlrpc
49
+ - :datagram
50
+ - :fifo
51
+ - :http
52
+ - :xmlrpc
47
53
 
48
- *PARAMS* - connection parameters. Depends on interface. See below.
54
+ _PARAMS_ - connection parameters. Depends on interface. See below.
49
55
 
50
56
  This function will raise exceptions if there are parameters' or environment errors.
51
- Function returns instance of one of the following classes:
52
57
 
53
- * Opensips::MI::Transport::Fifo
54
- * Opensips::MI::Transport::Datagram
55
- * Opensips::MI::Transport::Xmlrpc
58
+ ### Datagram
59
+
60
+ ```ruby
61
+ require 'opensips/mi'
62
+ opensips = Opensips::MI.connect :datagram,
63
+ :host => "199.188.10.100",
64
+ :port => 8809,
65
+ :timeout => 3
66
+ ```
67
+
68
+ **Parameters hash:**
69
+
70
+ - host: Hostname or IP address of OpenSIPs server
71
+ - port: Datagram port. See mi_datagram module configuration parameter: `modparam("mi_datagram", "socket_name", "udp:192.168.2.133:8080")`
72
+ - timeout: (OPTIONAL) Timeout in seconds to wait send/recv commands. Default 5 seconds.
56
73
 
57
74
  ### FIFO
58
75
 
@@ -67,108 +84,129 @@ opensips = Opensips::MI.connect :fifo,
67
84
 
68
85
  **Parameters hash:**
69
86
 
70
- * fifo_name: OpenSIPs fifo file. See mi_fifo module parameter: `modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")`.
71
- * reply_fifo: (OPTIONAL) Name of the reply fifo file. If not used, will generate random file in *reply_dir* and delete after use.
72
- * reply_dir: (OPTIONAL) Path to directory of reply fifo file.
87
+ - fifo_name: OpenSIPs fifo file. See mi_fifo module parameter: `modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")`.
88
+ - reply_dir: (OPTIONAL) Path to directory of reply fifo file. This directory is defined by opensips module parameter
89
+ `modparam("mi_fifo", "reply_dir", "/home/opensips/tmp/")`. Default is "/tmp"
90
+ - timeout: (OPTIONAL) Timeout in seconds read/write file timeout. Default 5 seconds.
91
+
92
+ ### HTTP
73
93
 
74
- ### Datagram
75
94
  ```ruby
76
95
  require 'opensips/mi'
77
- opensips = Opensips::MI.connect :datagram,
78
- :host => "sipproxy.com",
79
- :port => 8809,
96
+ opensips = Opensips::MI.connect :http,
97
+ :url => "http://192.168.0.1:8000/mi",
80
98
  :timeout => 5
81
99
  ```
100
+
82
101
  **Parameters hash:**
83
102
 
84
- * host: Hostname or IP address of OpenSIPs server
85
- * port: Datagram port. See mi_datagram module configuration parameter: `modparam("mi_datagram", "socket_name", "udp:192.168.2.133:8080")`
86
- * timeout: Timeout in seconds to wait send/recv commands. Optional. Default 3 seconds.
103
+ - url: HTTP MI url. Check OpenSIPS module mi_http for setting of IP, port and root path.
104
+ - timeout: Timeout in seconds to wait send/recv commands. Optional. Default 5 seconds.
105
+ - timeout: (OPTIONAL) Timeout in seconds to wait send/recv commands. Default 5 seconds.
87
106
 
88
107
  ### XMLRPC
108
+
89
109
  ```ruby
90
110
  require 'opensips/mi'
91
- opensips = Opensips::MI.connect :xmlrpc,
92
- :host => "192.168.2.133",
93
- :port => 8080
111
+ opensips = Opensips::MI.connect :xmlrpc,
112
+ :url => "http://192.168.0.1/rpc",
113
+ :timeout => 5
94
114
  ```
115
+
95
116
  **Parameters hash:**
96
117
 
97
- * host: Hostname or IP address of OpenSIPs server
98
- * port: Datagram port. See mi_xmlrpc module configuration parameter: `modparam("mi_xmlrpc", "port", 8080)`
118
+ - url: HTTP MI url. Check OpenSIPS module mi_http for setting of IP, port and root path.
119
+ - timeout: (OPTIONAL) Timeout in seconds to wait send/recv commands. Default 5 seconds.
99
120
 
100
121
  ### Command function
101
122
 
102
- Function "*command*" expects fifo command as a first argument, followed by command parameters.
103
- Command parameters' description can be found in module documentation. For example: http://www.opensips.org/html/docs/modules/1.8.x/dialog.html#id295450
104
- Usage example:
123
+ Function "_command_" expects fifo command as a first argument, followed by command parameters.
124
+ Command parameters' description can be found in module documentation. For example:
105
125
 
106
126
  ```ruby
107
127
  require 'opensips/mi'
108
- opensips = Opensips::MI.connect :fifo,
109
- :fifo_name => '/tmp/opensips_fifo'
110
-
128
+ opensips = Opensips::MI.connect :http,
129
+ :url => 'http://10.0.0.1/mi'
130
+
111
131
  opensips.command('which')
112
132
  opensips.command('get_statistics', 'dialog','tm')
113
133
  ```
114
134
 
115
135
  ### Command method interface
116
136
 
117
- It is also possible to use command names as a method interface:
137
+ It is also possible to use command names as a method interface. Parameters can be passed as array or hash too.
138
+ Library will automatically fit it to defined protocol.
139
+
118
140
  ```ruby
119
141
  require 'opensips/mi'
120
- opensips = Opensips::MI.connect :datagram,
121
- :host => "192.168.122.128",
142
+ opensips = Opensips::MI.connect :datagram,
143
+ :host => "192.168.122.128",
122
144
  :port => 8809
123
-
145
+
124
146
  opensips.which
125
147
  opensips.get_statistics('dialog','tm')
126
148
  opensips.uptime
127
149
  opensips.ul_show_contact('location', 'alice')
128
- ```
150
+ opensips.lb_status([1, 0])
129
151
 
130
- Those methods first of all verify if mi function exists using `which` mi command.
152
+ # NOTE: named parametters can be used in hash.
153
+ # Make sure you are using correct names
154
+ opensips.log_level({level: 3, pid: 1})
155
+ ```
131
156
 
132
157
  ### Response
133
158
 
134
- Command function returns `Opensips::MI::Response` class. This class containe following class members which can be used to process responses:
159
+ Command function returns hash with root key `:result` and hash/array of respons data
160
+ or root key `:error` with message or more data.
135
161
 
136
- * code: *Integer* Response code: 200, 404 etc
137
- * message: *String* Response messages: "OK", "Bad headers" etc.
138
- * rawdata: *Array* Raw response data as array
139
- * result: *Mixed* Struct/Hash/Array/Nil. This member is used by helper response methods for pretty formatted result. See below.
140
-
141
- ### Response helpers methods
162
+ Example of response of "uptime" command:
142
163
 
143
- There are several helper methods which return conveniently formatted data:
144
- * ul_dump
145
- * uptime
146
- * cache_fetch
147
- * ul_show_contact
148
- * dlg_list
149
- * ps
164
+ ```ruby
165
+ {:result=>{
166
+ "Now"=>"Wed Aug 9 19:41:28 2023",
167
+ "Up since"=>"Wed Aug 9 18:44:18 2023",
168
+ "Up time"=>"3430 [sec]"
169
+ }
170
+ }
171
+ ```
150
172
 
151
- See example files for details.
173
+ Error response example:
174
+
175
+ ```ruby
176
+ {:error=>{
177
+ "code"=>-32602,
178
+ "message"=>"Invalid params",
179
+ "data"=>"Bad PID"
180
+ }
181
+ }
182
+ ```
183
+
184
+ ### Helper methods
152
185
 
153
186
  ## Dialog methods
154
187
 
155
- Dialog methods are interface to `t_uac_dlg` function of OpenSIPs' *tm* (transactions) module.
188
+ Dialog methods are interface to `t_uac_dlg` function of OpenSIPs' _tm_ (transactions) module.
156
189
 
157
190
  ### Interface to t_uac_dlg function of transaction (tm) module
191
+
158
192
  Very cool method from OpenSIPs. Can generate and send SIP request method to a destination UAC.
159
193
  Example of usage:
160
- * Send NOTIFY with special Event header to force restart SIP phone (equivalent of Asterisk's "sip notify peer")
161
- * Send PUBLISH to trigger notification which changes device state
162
- * Send REFER to transfer call
163
- * etc., etc., etc.
194
+
195
+ - Send NOTIFY with special Event header to force restart SIP phone (equivalent of Asterisk's "sip notify peer")
196
+ - Send PUBLISH to trigger notification which changes device state
197
+ - Send REFER to transfer call
198
+ - etc., etc., etc.
164
199
 
165
200
  **Headers**
166
201
 
167
202
  Headers parameter "hf" is a hash of headers of format:
203
+
168
204
  ```
169
205
  header-name => header-value
170
206
  ```
207
+
171
208
  Example:
209
+
172
210
  ```
173
211
  hf["From"] => "Alice Liddell <sip:alice@wanderland.com>;tag=843887163"
174
212
  ```
@@ -179,29 +217,34 @@ because t_uac_dlg expects body parameter as an xml only.
179
217
 
180
218
  Thus, using multiple headers with same header-name is not possible.
181
219
  However, it is possible to use multiple header-values comma separated (rfc3261, section 7.3.1):
220
+
182
221
  ```
183
222
  hf["Route"] => "<sip:alice@atlanta.com>, <sip:bob@biloxi.com>"
184
223
  ```
224
+
185
225
  Which is equivalent to:
226
+
186
227
  ```
187
228
  Route: <sip:alice@atlanta.com>
188
229
  Route: <sip:bob@biloxi.com>
189
230
  ```
231
+
190
232
  If there are no To and From headers found, then exception ArgumentError is raised. Also when
191
233
  body part is present, Content-Type and Content-length fields are required.
192
234
 
193
235
  **Parameters**
194
236
 
195
- * method: SIP request method (NOTIFY, PUBLISH etc)
196
- * ruri: Request URI, ex.: sip:555@10.0.0.55:5060
197
- * hf: Headers array. Additional headers will be added to request. At least "From" and "To" headers must be present. Headers' names are case-insensitive.
198
- * nhop: Next hop SIP URI (OBP); use "." if no value.
199
- * socket: Local socket to be used for sending the request; use "." if no value. Ex.: udp:10.130.8.21:5060
200
- * body: (optional, may not be present) request body (if present, requires the "Content-Type" and "Content-length" headers)
237
+ - method: SIP request method (NOTIFY, PUBLISH etc)
238
+ - ruri: Request URI, ex.: sip:555@10.0.0.55:5060
239
+ - hf: Headers array. Additional headers will be added to request. At least "From" and "To" headers must be present. Headers' names are case-insensitive.
240
+ - nhop: Next hop SIP URI (OBP); use "." if no value.
241
+ - socket: Local socket to be used for sending the request; use "." if no value. Ex.: udp:10.130.8.21:5060
242
+ - body: (optional, may not be present) request body (if present, requires the "Content-Type" and "Content-length" headers)
201
243
 
202
244
  **Example of usage**
245
+
203
246
  ```ruby
204
- opensips.uac_dlg "NOTIFY", "sip:alice@127.0.0.1:5066",
247
+ opensips.uac_dlg "NOTIFY", "sip:alice@127.0.0.1:5066",
205
248
  {
206
249
  "From" => "<sip:alice@wanderland.com>;tag=8755a8d01a12f7e903a6f4ccaf393f04",
207
250
  "To" => "<sip:alice@wanderland.com>",
@@ -210,47 +253,50 @@ opensips.uac_dlg "NOTIFY", "sip:alice@127.0.0.1:5066",
210
253
  ```
211
254
 
212
255
  ### NOTIFY check-sync like event
213
- NOTIFY Events to restart phone, force configuration reload or report for some SIP IP phone models.
256
+
257
+ NOTIFY Events to restart phone, force configuration reload or report for some SIP IP phone models.
214
258
  Wrapper to `uac_dlg` function.
215
259
  The events list was taken from Asterisk configuration file (sip_notify.conf)
216
260
  Note that SIP IP phones usually should be configured to accept special notify
217
261
  event. For example, Polycom configuration option to enable special event would be:
218
- ```
262
+
263
+ ```
219
264
  voIpProt.SIP.specialEvent.checkSync.alwaysReboot="1"
220
265
  ```
221
266
 
222
- This function will generate To/From/Event headers. Will use random tag for From header.
267
+ This function will generate To/From/Event headers. Will use random tag for From header.
223
268
 
224
- *NOTE*: This function will not generate To header tag. This is not complying with
225
- SIP protocol specification (rfc3265). NOTIFY must be part of a subscription
269
+ _NOTE_: This function will not generate To header tag. This is not complying with
270
+ SIP protocol specification (rfc3265). NOTIFY must be part of a subscription
226
271
  dialog. However, it works for the most of the SIP IP phone models.
227
272
 
228
273
  **Parameters**
229
274
 
230
- * uri: Valid client contact URI (sip:alice@10.0.0.100:5060). To get client URI use *ul_show_contact => contact* function
231
- * event: One of the events from EVENTNOTIFY constant hash
232
- * hf: Header fields. Add To/From header fields here if you do not want them to be auto-generated. Header field example: `hf['To'] => '<sip:alice@wanderland.com>'`
275
+ - uri: Valid client contact URI (sip:alice@10.0.0.100:5060). To get client URI use _ul_show_contact => contact_ function
276
+ - event: One of the events from EVENTNOTIFY constant hash
277
+ - hf: Header fields. Add To/From header fields here if you do not want them to be auto-generated. Header field example: `hf['To'] => '<sip:alice@wanderland.com>'`
233
278
 
234
279
  **Example of usage**
235
280
  Will reboot Polycom phone:
281
+
236
282
  ```ruby
237
283
  opensips.event_notify 'sip:alice@127.0.0.1:5060', :polycom_check_cfg
238
284
  ```
239
285
 
240
286
  **List of available events' keys:**
241
287
 
242
- * :astra_check_cfg
243
- * :aastra_xml
244
- * :digium_check_cfg
245
- * :linksys_cold_restart
246
- * :linksys_warm_restart
247
- * :polycom_check_cfg
248
- * :sipura_check_cfg
249
- * :sipura_get_report
250
- * :snom_check_cfg
251
- * :snom_reboot
252
- * :cisco_check_cfg
253
- * :avaya_check_cfg
288
+ - :astra_check_cfg
289
+ - :aastra_xml
290
+ - :digium_check_cfg
291
+ - :linksys_cold_restart
292
+ - :linksys_warm_restart
293
+ - :polycom_check_cfg
294
+ - :sipura_check_cfg
295
+ - :sipura_get_report
296
+ - :snom_check_cfg
297
+ - :snom_reboot
298
+ - :cisco_check_cfg
299
+ - :avaya_check_cfg
254
300
 
255
301
  ### Presence MWI
256
302
 
@@ -258,32 +304,15 @@ Send message-summary NOTIFY Event to update phone voicemail status.
258
304
 
259
305
  **Parameters**
260
306
 
261
- * uri: Request URI (sip:alice@wanderland.com:5060). To get client URI use `ul_show_contact` function, *contact* value
262
- * vmaccount:Message Account value. Ex.: sip:*97@asterisk.com
263
- * new: Number of new messages. If more than 0 then Messages-Waiting header will be "yes". Set to 0 to clear phone MWI
264
- * old: (optional) Old messages
265
- * urg_new: (optional) New urgent messages
266
- * urg_old: (optional) Old urgent messages
307
+ - uri: Request URI (sip:alice@wanderland.com:5060). To get client URI use `ul_show_contact` function, _contact_ value
308
+ - vmaccount:Message Account value. Ex.: sip:\*97@asterisk.com
309
+ - new: Number of new messages. If more than 0 then Messages-Waiting header will be "yes". Set to 0 to clear phone MWI
310
+ - old: (optional) Old messages
311
+ - urg_new: (optional) New urgent messages
312
+ - urg_old: (optional) Old urgent messages
267
313
 
268
314
  **Example of usage**
315
+
269
316
  ```ruby
270
317
  opensips.mwi_update 'sip:alice@wanderland.com:5060', 'sip:*97@voicemail.pbx.com', 5
271
318
  ```
272
-
273
- ## Examples
274
-
275
- There are some sample files in *examples* directory.
276
-
277
- ## TODO:
278
-
279
- Support for mi_xmlrpc_ng
280
-
281
- ----
282
- ## Contributing
283
-
284
- 1. Fork it
285
- 2. Create your feature branch (`git checkout -b my-new-feature`)
286
- 3. Commit your changes (`git commit -am 'Add some feature'`)
287
- 4. Push to the branch (`git push origin my-new-feature`)
288
- 5. Create new Pull Request
289
-
data/Rakefile CHANGED
@@ -1,16 +1,12 @@
1
- require "bundler/gem_tasks"
2
- require "rake/clean"
3
- require 'opensips/mi/version'
4
- require 'rspec/core/rake_task'
1
+ # frozen_string_literal: true
5
2
 
6
- require "rdoc/task"
7
- Rake::RDocTask.new do |rd|
8
- rd.rdoc_dir = 'rdoc'
9
- rd.main = "README.md"
10
- rd.rdoc_files.include("README.md","lib/**/*.rb")
11
- rd.title = "OpenSIPs management interface " << Opensips::MI::VERSION
12
- end
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
13
5
 
14
6
  RSpec::Core::RakeTask.new(:spec)
15
7
 
16
- task :default => :spec
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]