oversip 1.4.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,6 +1,6 @@
1
1
  Name: OverSIP
2
2
  Maintainer: Iñaki Baz Castillo <ibc@aliax.net>
3
- Copyright (c) 2012-2013 Iñaki Baz Castillo - Versatica <http://www.versatica.com>
3
+ Copyright (c) 2012-2014 Iñaki Baz Castillo
4
4
 
5
5
 
6
6
  License: The MIT License
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 [draft-ietf-sipcore-sip-websocket](http://tools.ietf.org/html/draft-ietf-sipcore-sip-websocket) and [JsSIP](http://jssip.net)
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", :so => "sip_parser.so", :dest => "lib/oversip/sip" },
7
- { :dir => "ext/stun", :so => "stun.so", :dest => "lib/oversip" },
8
- { :dir => "ext/utils", :so => "utils.so", :dest => "lib/oversip" },
9
- { :dir => "ext/websocket_framing_utils", :so => "ws_framing_utils.so", :dest => "lib/oversip/websocket" },
10
- { :dir => "ext/websocket_http_parser", :so => "ws_http_parser.so", :dest => "lib/oversip/websocket" },
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[:so] => Dir.glob(["#{ext[:dir]}/*{.c,.h}"]) do
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[:so]}", "#{ext[:dest]}/"
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[:so]}")
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[:so]} << "bin/oversip_stud"
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, also affects to syslogger process and Posix Message Queue name (default 'oversip')") do |value|
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
- log_system_warn "ignoring user/group parameters when not running as root"
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 "master process name: #{::OverSIP.master_name}"
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
- log_system_info "increasing rlimits for 'nofiles'"
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