oversip 1.4.1 → 2.0.0
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.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/Rakefile +10 -11
- data/bin/oversip +10 -27
- data/etc/tls/ca/cacert.pem +717 -718
- data/ext/sip_parser/common_headers.h +1 -0
- data/ext/sip_parser/sip_message_parser.c +43 -42
- data/ext/sip_parser/sip_parser_ruby.c +10 -0
- data/ext/utils/ip_utils.h +2 -0
- data/ext/utils/utils_ruby.h +2 -1
- data/ext/websocket_framing_utils/ws_framing_utils.h +2 -1
- data/ext/websocket_framing_utils/ws_framing_utils_ruby.c +1 -1
- data/lib/oversip/config.rb +6 -6
- data/lib/oversip/default_server.rb +0 -10
- data/lib/oversip/launcher.rb +29 -67
- data/lib/oversip/logger.rb +29 -108
- data/lib/oversip/sip/launcher.rb +7 -7
- data/lib/oversip/syslog.rb +22 -12
- data/lib/oversip/version.rb +5 -5
- data/lib/oversip/websocket/launcher.rb +7 -7
- data/lib/oversip.rb +61 -15
- data/test/oversip_test_helper.rb +0 -1
- metadata +154 -215
- data/lib/oversip/master_process.rb +0 -67
- data/lib/oversip/posix_mq.rb +0 -126
- data/lib/oversip/ruby_ext/process.rb +0 -9
- data/lib/oversip/syslogger_process.rb +0 -80
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2ffc558d45b3c66904ddf72623d171b91d5e7b96
|
4
|
+
data.tar.gz: 489269bf59afa251db14f087ed07a38d7ff29dd5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 78d3f9a887a7d42ffdb8d2de56a26c27a213fa258df5ca8fcf5ec08b99a5769f6690dc3383d6bf1e12b4e88286181438f5901cbd15493328a2e12ed8df3da2b0
|
7
|
+
data.tar.gz: 6798f11724f21433d7fe722aa20acff3b73777b9aa8861e55791c9081acec0bef2620bc671b23cb7603e8fee8a5d6db81545a5f7223ac1eac9f2532797ca8a5c
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@ OverSIP is a powerful and flexible SIP proxy & server by the authors of [draft-i
|
|
17
17
|
* SIP over UDP, TCP, TLS and WebSocket (use true SIP in your web apps)
|
18
18
|
* Full support for IPv4, IPv6 and DNS resolution (NAPTR, SRV, A, AAAA)
|
19
19
|
* The perfect Outbound Edge Proxy
|
20
|
-
* Written by the authors of [
|
20
|
+
* Written by the authors of [RFC 7118 "The WebSocket Protocol as a Transport for SIP"](http://tools.ietf.org/html/rfc7118) and [JsSIP](http://jssip.net)
|
21
21
|
|
22
22
|
|
23
23
|
## Documentation
|
@@ -39,4 +39,4 @@ OverSIP is a powerful and flexible SIP proxy & server by the authors of [draft-i
|
|
39
39
|
|
40
40
|
## License
|
41
41
|
|
42
|
-
OverSIP is released under the [MIT license](http://www.oversip.net/license).
|
42
|
+
OverSIP is released under the [MIT license](http://www.oversip.net/license).
|
data/Rakefile
CHANGED
@@ -3,25 +3,25 @@ require "rake/clean"
|
|
3
3
|
|
4
4
|
|
5
5
|
OVERSIP_EXTENSIONS = [
|
6
|
-
{ :dir => "ext/sip_parser", :
|
7
|
-
{ :dir => "ext/stun", :
|
8
|
-
{ :dir => "ext/utils", :
|
9
|
-
{ :dir => "ext/websocket_framing_utils", :
|
10
|
-
{ :dir => "ext/websocket_http_parser", :
|
6
|
+
{ :dir => "ext/sip_parser", :lib => "sip_parser.#{RbConfig::CONFIG["DLEXT"]}", :dest => "lib/oversip/sip" },
|
7
|
+
{ :dir => "ext/stun", :lib => "stun.#{RbConfig::CONFIG["DLEXT"]}", :dest => "lib/oversip" },
|
8
|
+
{ :dir => "ext/utils", :lib => "utils.#{RbConfig::CONFIG["DLEXT"]}", :dest => "lib/oversip" },
|
9
|
+
{ :dir => "ext/websocket_framing_utils", :lib => "ws_framing_utils.#{RbConfig::CONFIG["DLEXT"]}", :dest => "lib/oversip/websocket" },
|
10
|
+
{ :dir => "ext/websocket_http_parser", :lib => "ws_http_parser.#{RbConfig::CONFIG["DLEXT"]}", :dest => "lib/oversip/websocket" },
|
11
11
|
]
|
12
12
|
|
13
13
|
OVERSIP_EXTENSIONS.each do |ext|
|
14
|
-
file ext[:
|
14
|
+
file ext[:lib] => Dir.glob(["#{ext[:dir]}/*{.c,.h}"]) do
|
15
15
|
Dir.chdir(ext[:dir]) do
|
16
16
|
ruby "extconf.rb"
|
17
17
|
sh "make"
|
18
18
|
end
|
19
|
-
cp "#{ext[:dir]}/#{ext[:
|
19
|
+
cp "#{ext[:dir]}/#{ext[:lib]}", "#{ext[:dest]}/"
|
20
20
|
end
|
21
21
|
|
22
|
-
CLEAN.include("#{ext[:dir]}/*{.o,.log,.so,.a}")
|
22
|
+
CLEAN.include("#{ext[:dir]}/*{.o,.log,.so,.a,.bundle}")
|
23
23
|
CLEAN.include("#{ext[:dir]}/Makefile")
|
24
|
-
CLEAN.include("#{ext[:dest]}/#{ext[:
|
24
|
+
CLEAN.include("#{ext[:dest]}/#{ext[:lib]}")
|
25
25
|
end
|
26
26
|
|
27
27
|
# Stud stuff.
|
@@ -37,8 +37,7 @@ CLEAN.include("thirdparty/stud/mkmf.log")
|
|
37
37
|
CLEAN.include("bin/oversip_stud")
|
38
38
|
|
39
39
|
|
40
|
-
OVERSIP_COMPILE_ITEMS = OVERSIP_EXTENSIONS.map {|e| e[:
|
41
|
-
|
40
|
+
OVERSIP_COMPILE_ITEMS = OVERSIP_EXTENSIONS.map {|e| e[:lib]} << "bin/oversip_stud"
|
42
41
|
|
43
42
|
task :default => :compile
|
44
43
|
|
data/bin/oversip
CHANGED
@@ -49,7 +49,7 @@ module OverSIP
|
|
49
49
|
options[:pid_file] = value
|
50
50
|
end
|
51
51
|
|
52
|
-
opts.on("-p", "--process-name NAME", "Change the running process name
|
52
|
+
opts.on("-p", "--process-name NAME", "Change the running process name (default 'oversip')") do |value|
|
53
53
|
options[:process_name] = value
|
54
54
|
$0 = options[:process_name]
|
55
55
|
::OverSIP::Logger.load_methods
|
@@ -75,23 +75,6 @@ module OverSIP
|
|
75
75
|
options[:colorize] = false
|
76
76
|
end
|
77
77
|
|
78
|
-
opts.on("--remove-mqueue MQUEUE", "Destroy the Posix Message Queue with the given name and exit") do |value|
|
79
|
-
require "posix_mq"
|
80
|
-
|
81
|
-
begin
|
82
|
-
::POSIX_MQ.unlink value
|
83
|
-
rescue ::Errno::ENOENT
|
84
|
-
rescue ::Errno::EACCES => e
|
85
|
-
::OverSIP::Launcher.fatal "cannot remove '#{value}' posix message queue due file permissions"
|
86
|
-
exit 1
|
87
|
-
rescue ::Errno::EINVAL => e
|
88
|
-
::OverSIP::Launcher.fatal "cannot remove '#{value}' posix message queue, invalid name"
|
89
|
-
exit 1
|
90
|
-
ensure
|
91
|
-
exit
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
78
|
opts.separator "\nRuby options:"
|
96
79
|
|
97
80
|
opts.on("-d", "--debug", "Set debugging flags ($DEBUG = true)") do
|
@@ -148,7 +131,10 @@ module OverSIP
|
|
148
131
|
|
149
132
|
# Ignore user/group if the launcher is not being running as root.
|
150
133
|
unless ::Process.euid == 0
|
151
|
-
|
134
|
+
if options[:user] or options[:group]
|
135
|
+
log_system_warn "ignoring user/group parameters when not running as root"
|
136
|
+
end
|
137
|
+
|
152
138
|
options.delete :user
|
153
139
|
options.delete :group
|
154
140
|
else
|
@@ -173,23 +159,20 @@ module OverSIP
|
|
173
159
|
# or to the script filename otherwise.
|
174
160
|
::OverSIP.master_name = options[:process_name] || ::File.basename(__FILE__)
|
175
161
|
$0 = ::OverSIP.master_name
|
176
|
-
log_system_info "
|
162
|
+
log_system_info "process name: #{::OverSIP.master_name}"
|
177
163
|
|
178
164
|
::OverSIP::Config.load options[:config_dir], options[:config_file]
|
179
165
|
::OverSIP::Config.print options[:colorize]
|
180
166
|
|
181
|
-
|
167
|
+
::OverSIP::Logger::load_methods
|
168
|
+
|
182
169
|
begin
|
183
170
|
::Process.setrlimit Process::RLIMIT_NOFILE, 65536, 65536
|
184
171
|
rescue => e
|
185
|
-
::OverSIP::Launcher.fatal e
|
172
|
+
# ::OverSIP::Launcher.fatal e
|
173
|
+
log_system_error "error increasing rlimits for 'nofiles': #{e.message} (#{e.class})"
|
186
174
|
end
|
187
175
|
|
188
|
-
log_system_info "creating Posix Message Queue for communicating master and syslogger processes"
|
189
|
-
::OverSIP.syslogger_mq_name = "/#{OverSIP.master_name}_syslogger"
|
190
|
-
::OverSIP::Logger.init_logger_mq options[:group]
|
191
|
-
::OverSIP::Logger.load_methods
|
192
|
-
|
193
176
|
::OverSIP::Launcher.daemonize!(options)
|
194
177
|
::OverSIP::Launcher.run(options)
|
195
178
|
|