[opensips] Ver. 1.7.2

Peter Lemenkov peter at fedoraproject.org
Thu Apr 19 09:00:57 UTC 2012


commit f0d75b006069d01800683ce6dda8ca01f2fb839a
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Thu Apr 19 13:00:48 2012 +0400

    Ver. 1.7.2
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 .gitignore                                         |    1 +
 ...ps-0001-Check-for-stale-nonce-in-pre_auth.patch |    8 +-
 ...-unknown-options-to-be-passed-to-rtpproxy.patch |   31 ++++++++++
 opensips.service                                   |   12 ++++
 opensips.spec                                      |   61 ++++++++++++++++++-
 sources                                            |    2 +-
 6 files changed, 106 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ff5ccec..03666aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ opensips-1.6.3-tls_src.tar.gz
 /opensips-1.6.4-2-tls_src.tar.gz
 /opensips-1.7.0_src.tar.gz
 /opensips-1.7.1_src.tar.gz
+/opensips-1.7.2_src.tar.gz
diff --git a/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch b/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
index 9f66368..b69595a 100644
--- a/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
+++ b/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
@@ -1,12 +1,12 @@
-From 5ce7165bfb2869300258193fdabbdf442435362b Mon Sep 17 00:00:00 2001
+From f77330c94cf71152b36ae201658c9fe8dfbb2563 Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Mon, 6 Dec 2010 15:56:54 +0300
-Subject: [PATCH 1/3] Check for stale nonce in pre_auth
+Subject: [PATCH 1/2] Check for stale nonce in pre_auth
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
 ---
  modules/auth/api.c |   35 ++++++++++++++++++-----------------
- 1 files changed, 18 insertions(+), 17 deletions(-)
+ 1 file changed, 18 insertions(+), 17 deletions(-)
 
 diff --git a/modules/auth/api.c b/modules/auth/api.c
 index f076e85..ea54f20 100644
@@ -66,5 +66,5 @@ index f076e85..ea54f20 100644
  
  }
 -- 
-1.7.6
+1.7.10
 
diff --git a/opensips-0002-Permit-unknown-options-to-be-passed-to-rtpproxy.patch b/opensips-0002-Permit-unknown-options-to-be-passed-to-rtpproxy.patch
new file mode 100644
index 0000000..a8d642d
--- /dev/null
+++ b/opensips-0002-Permit-unknown-options-to-be-passed-to-rtpproxy.patch
@@ -0,0 +1,31 @@
+From d9702cbf17ef80f0e8cf76cc94a7c3c4d62ce668 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Wed, 10 Aug 2011 17:05:22 +0400
+Subject: [PATCH 2/2] Permit unknown options to be passed to rtpproxy
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ modules/rtpproxy/rtpproxy.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c
+index 2ccc26e..6bd9b53 100644
+--- a/modules/rtpproxy/rtpproxy.c
++++ b/modules/rtpproxy/rtpproxy.c
+@@ -3026,8 +3026,11 @@ force_rtp_proxy_body(struct sip_msg* msg, struct force_rtpp_args *args)
+ 			break;
+ 
+ 		default:
+-			LM_ERR("unknown option `%c'\n", *cp);
+-			FORCE_RTP_PROXY_RET (-1);
++			LM_WARN("unknown option `%c'\n", *cp);
++			if (append_opts(&opts, *cp) == -1) {
++				LM_ERR("out of pkg memory\n");
++				FORCE_RTP_PROXY_RET (-1);
++			}
+ 		}
+ 	}
+ 
+-- 
+1.7.10
+
diff --git a/opensips.service b/opensips.service
new file mode 100644
index 0000000..ba016ed
--- /dev/null
+++ b/opensips.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenSIPS is a very fast and flexible SIP (RFC3261) server
+After=network.target mysqld.service postgresql.service rtpproxy.service
+
+[Service]
+Type=forking
+#User=opensips
+#Group=opensips
+EnvironmentFile=-/etc/sysconfig/opensips
+PIDFile=/var/run/opensips.pid
+ExecStart=/usr/sbin/opensips -P /var/run/opensips.pid -f /etc/opensips/opensips.cfg $OPTIONS
+
diff --git a/opensips.spec b/opensips.spec
index b2bacd0..d75b6d4 100644
--- a/opensips.spec
+++ b/opensips.spec
@@ -9,13 +9,17 @@
 
 Summary:  Open Source SIP Server
 Name:     opensips
-Version:  1.7.1
-Release:  6%{?dist}
+Version:  1.7.2
+Release:  1%{?dist}
 License:  GPLv2+
 Group:    System Environment/Daemons
 Source0:  http://opensips.org/pub/%{name}/%{version}/src/%{name}-%{version}_src.tar.gz
 Source1:  %{name}.sysconfig
+Source2:  %{name}.service
+# Applied upstream - available in 1.8.0+
 Patch1:   opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
+# Applied upstream - available in 1.8.0+
+Patch2:   opensips-0002-Permit-unknown-options-to-be-passed-to-rtpproxy.patch
 URL:      http://opensips.org
 
 BuildRequires:  expat-devel
@@ -44,12 +48,20 @@ BuildRequires:  curl-devel
 BuildRequires:  GeoIP-devel
 BuildRequires:  pcre-devel
 BuildRequires:  python-devel
+%if 0%{?fc17}%{?fc18}
+BuildRequires:  systemd-units
+%endif
 
-
+#Initscripts
+%if 0%{?fc17}%{?fc18}
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
 Requires(post): chkconfig
 Requires(preun):chkconfig
-# for /sbin/service
 Requires(preun):initscripts
+%endif
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -535,6 +547,7 @@ implementation for the Event Interface.
 %prep
 %setup -q -n %{name}-%{version}-tls
 %patch1 -p1 -b .nonce
+%patch2 -p1 -b .permit_unknown
 
 %build
 LOCALBASE=/usr CFLAGS="%{optflags}" %{__make} all %{?_smp_mflags} TLS=1 \
@@ -576,9 +589,14 @@ for i in docdir/*; do
   rm -f $i.old
 done
 
+%if 0%{?fc17}%{?fc18}
+# install systemd files
+install -D -m 0644 -p %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+%else
 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
 %{__install} -p -D -m 755 packaging/fedora/opensips.init \
   $RPM_BUILD_ROOT%{_initrddir}/opensips
+%endif
 echo -e "\nETCDIR=\"%{_sysconfdir}/opensips\"\n" \
   >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/opensipsctlrc
 
@@ -589,13 +607,40 @@ install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
 rm -rf $RPM_BUILD_ROOT
 
 %post
+%if 0%{?fc17}%{?fc18}
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+%else
 /sbin/chkconfig --add opensips
+%endif
 
 %preun
+%if 0%{?fc17}%{?fc18}
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable couchdb.service > /dev/null 2>&1 || :
+    /bin/systemctl stop couchdb.service > /dev/null 2>&1 || :
+fi
+%else
 if [ $1 = 0 ]; then
  /sbin/service opensips stop > /dev/null 2>&1
  /sbin/chkconfig --del opensips
 fi
+%endif
+
+%if 0%{?fc17}%{?fc18}
+%triggerun -- opensips < 1.7.2-1
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply opensips
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save opensips >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del opensips >/dev/null 2>&1 || :
+/bin/systemctl try-restart openips.service >/dev/null 2>&1 || :
+%endif
 
 %files
 %defattr(-,root,root,-)
@@ -616,7 +661,11 @@ fi
 %dir %{_libdir}/opensips/opensipsctl/
 %dir %{_libdir}/opensips/opensipsctl/dbtextdb
 
+%if 0%{?fc17}%{?fc18}
+%{_unitdir}/%{name}.service
+%else
 %attr(755,root,root) %{_initrddir}/opensips
+%endif
 
 %config(noreplace) %{_sysconfdir}/opensips/dictionary.opensips
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
@@ -1040,6 +1089,10 @@ fi
 %doc docdir/README.event_datagram
 
 %changelog
+* Thu Apr 19 2012 Peter Lemenkov <lemenkov at gmail.com> - 1.7.2-1
+- update to 1.7.2 (bugfix release).
+- enable systemd support where possible
+
 * Fri Apr 13 2012 Jindrich Novy <jnovy at redhat.com> - 1.7.1-6
 - rebuild against new librpm and libdb
 
diff --git a/sources b/sources
index 2ad4d35..fdfd35b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-275ecad5146a7571713baf9f3395fe0f  opensips-1.7.1_src.tar.gz
+2ff1a5ba832491267fc5f3e1ae21b666  opensips-1.7.2_src.tar.gz


More information about the scm-commits mailing list