oversip 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -9,3 +9,10 @@ CONTRIBUTORS
9
9
  ============
10
10
 
11
11
  - Jon Bonilla <manwe@aholab.ehu.es> (Github @manwe)
12
+ Lot of help with Debian package.
13
+
14
+ - Saúl Ibarra <saghul@gmail.com> (Github @saghul)
15
+ Testing, ideas, proposals, too much proposals.
16
+
17
+ - José Luis Millán <jmillan@aliax.net> (Github @jmillan)
18
+ Intensive testing with JsSIP library acting as client with OverSIP.
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- OverSIP
2
- =======
1
+ <a style="color: red" href="http://www.oversip.net"><img src="https://github.com/versatica/OverSIP/wiki/oversip-banner.png"/></a>
3
2
 
4
3
  **WEB UNDER CONSTRUCTION:** The code is stable and working. This web page and documentation is not... please wait a bit.
5
4
 
@@ -9,7 +9,7 @@ Standards-Version: 3.9.3
9
9
  Package: oversip
10
10
  Architecture: all
11
11
  Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, ruby1.9.1, ruby1.9.1-dev, make, g++, libssl-dev, libev-dev
12
- Recommends: unbound
12
+ Suggests: unbound
13
13
  Description: OverSIP (the SIP dreams factory) is an async SIP proxy/server programmable in Ruby language.
14
14
  Some features of OverSIP are:
15
15
  - SIP transports: UDP, TCP, TLS and WebSocket.
@@ -31,7 +31,7 @@ UBUNTU_LOGGING=0
31
31
 
32
32
 
33
33
  # Checks for the start action.
34
- if [ "$1" == "start" ] ; then
34
+ if [ "$1" == "start" ] || [ "$1" == "restart" ] || [ "$1" == "force-reload" ] ; then
35
35
 
36
36
  # Ensure that the admin has set RUN=yes in /etc/default/$NAME file.
37
37
  if [ "$RUN" != "yes" ] ; then
@@ -79,7 +79,7 @@ if [ -n "$GROUP" ] ; then
79
79
  fi
80
80
 
81
81
 
82
- check_homedir ()
82
+ check_homedir()
83
83
  {
84
84
  # Create HOMEDIR directory in case it doesn't exist.
85
85
  # Useful in Ubuntu as /var/run/ content is deleted in shutdown.
@@ -107,8 +107,22 @@ get_status() {
107
107
  }
108
108
 
109
109
 
110
- # TODO: mirar get_status() en vez de esperar a que oversip pete si estaba ya corriendo...
111
110
  start() {
111
+ set +e
112
+ get_status
113
+ case $? in
114
+ 0) # Already running, do nothing.
115
+ log_warning_msg "already running."
116
+ exit 0
117
+ ;;
118
+ 3) # Not running, start it.
119
+ ;;
120
+ 1) # Not running but PID file exists, remove it and start.
121
+ log_warning_msg "not running but PID file '$PIDFILE' exists, deleting it."
122
+ rm "$PIDFILE"
123
+ ;;
124
+ esac
125
+
112
126
  start-stop-daemon --start --quiet --pidfile $PIDFILE --quiet \
113
127
  --exec $DAEMON -- $OPTIONS
114
128
  res=$?
@@ -121,9 +135,6 @@ start() {
121
135
  log_failure_msg "error, failed to start."
122
136
  log_end_msg 1
123
137
  exit 1
124
- elif read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
125
- log_warning_msg "already running."
126
- exit 0
127
138
  else
128
139
  log_failure_msg "error, failed to start (and PID file '$PIDFILE' exists)."
129
140
  log_end_msg 1
@@ -189,18 +200,20 @@ case "$1" in
189
200
  ;;
190
201
 
191
202
  status)
203
+ set +e
192
204
  get_status
193
205
  case $? in
194
- 3)
195
- log_warning_msg "$DESC ($NAME) is not running."
206
+ 3) # Not running.
207
+ log_begin_msg "$DESC ($NAME) is not running."
208
+ [ $UBUNTU_LOGGING -eq 0 ] && echo
196
209
  exit 3
197
210
  ;;
198
- 0)
211
+ 0) # Running.
199
212
  log_begin_msg "$DESC ($NAME) is running."
200
213
  [ $UBUNTU_LOGGING -eq 0 ] && echo
201
214
  exit 0
202
215
  ;;
203
- 1)
216
+ 1) # Not running but PID file exists.
204
217
  log_warning_msg "$DESC ($NAME) is not running but PID file '$PIDFILE' exists."
205
218
  exit 1
206
219
  ;;
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ # preinst script can be called with arguments 'install', 'upgrade' and 'abort-upgrade'.
4
+
5
+ set -e
6
+
7
+ #DEBHELPER#
8
+
9
+ OVERSIP_GEM_VERSION="~>1.0.1"
10
+
11
+ case "$1" in
12
+
13
+ install)
14
+ # Add a Debian system user/group called "oversip".
15
+ adduser --quiet --system --group --disabled-password \
16
+ --shell /bin/false --gecos "OverSIP" \
17
+ --home /var/run/oversip oversip || true
18
+
19
+ # Install the Ruby gem.
20
+ echo "installing 'oversip' Ruby Gem (version $OVERSIP_GEM_VERSION)..."
21
+ gem1.9.1 install oversip --no-rdoc --no-ri -v $OVERSIP_GEM_VERSION
22
+ ;;
23
+
24
+ upgrade)
25
+ # Install the Ruby gem.
26
+ echo "installing 'oversip' Ruby Gem (version $OVERSIP_GEM_VERSION)..."
27
+ gem1.9.1 install oversip --no-rdoc --no-ri -v $OVERSIP_GEM_VERSION
28
+ ;;
29
+
30
+ esac
31
+
32
+ exit 0
33
+
34
+ #DEBHELPER#
@@ -135,7 +135,7 @@ module OverSIP
135
135
 
136
136
 
137
137
  def self.load conf_dir = nil
138
- @conf_dir ||= DEFAULT_CONFIG_DIR
138
+ @conf_dir ||= (conf_dir || DEFAULT_CONFIG_DIR)
139
139
 
140
140
  begin
141
141
  conf_yaml = ::YAML.load_file conf_file
@@ -5,7 +5,7 @@ module OverSIP
5
5
  module Version
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 1
8
+ TINY = 2
9
9
  end
10
10
 
11
11
  PROGRAM_NAME = "OverSIP"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oversip
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-13 00:00:00.000000000 Z
12
+ date: 2012-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine-le
16
- requirement: &11745940 !ruby/object:Gem::Requirement
16
+ requirement: &8648800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *11745940
24
+ version_requirements: *8648800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: iobuffer
27
- requirement: &11744480 !ruby/object:Gem::Requirement
27
+ requirement: &8648320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *11744480
35
+ version_requirements: *8648320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: em-posixmq
38
- requirement: &12616040 !ruby/object:Gem::Requirement
38
+ requirement: &8647860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.3
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *12616040
46
+ version_requirements: *8647860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: em-udns
49
- requirement: &12615400 !ruby/object:Gem::Requirement
49
+ requirement: &8647340 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.3.6
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *12615400
57
+ version_requirements: *8647340
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: escape_utils
60
- requirement: &12614940 !ruby/object:Gem::Requirement
60
+ requirement: &8646840 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.2.4
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *12614940
68
+ version_requirements: *8646840
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: term-ansicolor
71
- requirement: &12614500 !ruby/object:Gem::Requirement
71
+ requirement: &8646380 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *12614500
79
+ version_requirements: *8646380
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: posix-spawn
82
- requirement: &12613980 !ruby/object:Gem::Requirement
82
+ requirement: &8645760 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *12613980
90
+ version_requirements: *8645760
91
91
  description: ! "OverSIP is an async SIP server. Built on top of Ruby EventMachine\n
92
92
  \ library it follows the Reactor Pattern, allowing thousands of concurrent connections
93
93
  and requests\n handled by a single processor in a never-blocking fashion. It
@@ -234,8 +234,8 @@ files:
234
234
  - debian/oversip.init
235
235
  - debian/oversip.default
236
236
  - debian/changelog
237
- - debian/postinst
238
237
  - debian/control
238
+ - debian/preinst
239
239
  - Rakefile
240
240
  - README.md
241
241
  - AUTHORS
@@ -1,52 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
-
6
- #DEBHELPER#
7
-
8
- OVERSIP_GEM_VERSION="~>1.0.1"
9
-
10
- # summary of how this script can be called:
11
- # * <postinst> `configure' <most-recently-configured-version>
12
- # * <old-postinst> `abort-upgrade' <new version>
13
- # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14
- # <new-version>
15
- # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
16
- # <failed-install-package> <version> `removing'
17
- # <conflicting-package> <version>
18
- # for details, see http://www.debian.org/doc/debian-policy/ or
19
- # the debian-policy package
20
- #
21
- # quoting from the policy:
22
- # Any necessary prompting should almost always be confined to the
23
- # post-installation script, and should be protected with a conditional
24
- # so that unnecessary prompting doesn't happen if a package's
25
- # installation fails and the `postinst' is called with `abort-upgrade',
26
- # `abort-remove' or `abort-deconfigure'.
27
-
28
- case "$1" in
29
- configure)
30
- # Add a Debian system user/group called "oversip".
31
- adduser --quiet --system --group --disabled-password \
32
- --shell /bin/false --gecos "OverSIP" \
33
- --home /var/run/oversip oversip || true
34
-
35
- # Install the Ruby gem.
36
- # TODO: ACTIVAR
37
- #echo "installing 'oversip' Ruby Gem (version $OVERSIP_GEM_VERSION)..."
38
- #gem1.9.1 install oversip --no-rdoc --no-ri -v $OVERSIP_GEM_VERSION
39
- ;;
40
-
41
- abort-upgrade|abort-remove|abort-deconfigure)
42
- ;;
43
-
44
- *)
45
- echo "postinst called with unknown argument \`$1'" >&2
46
- exit 1
47
- ;;
48
- esac
49
-
50
- exit 0
51
-
52
- #DEBHELPER#