- comp_osip.c: libosip2-2.0.9 compatibility (There SEEM
to happen some API changes forward and backward: osip_message_to_str, osip_body_to_str, osip_message_set_body, osip_message_parse) - included startup script (by Guido Trentalancia) - siproxd.spec: create PID and registrations directories and install startup script
This commit is contained in:
parent
58153e8f25
commit
a53744ce81
13
ChangeLog
13
ChangeLog
@ -1,8 +1,19 @@
|
|||||||
|
0.5.9
|
||||||
|
=====
|
||||||
|
09-Oct-2004: - comp_osip.c: libosip2-2.0.9 compatibility (There SEEM
|
||||||
|
to happen some API changes forward and backward:
|
||||||
|
osip_message_to_str, osip_body_to_str,
|
||||||
|
osip_message_set_body, osip_message_parse)
|
||||||
|
- included startup script (by Guido Trentalancia)
|
||||||
|
- siproxd.spec: create PID and registrations directories
|
||||||
|
and install startup script
|
||||||
|
|
||||||
0.5.8
|
0.5.8
|
||||||
=====
|
=====
|
||||||
|
22-Sep-2004: - Released 0.5.8
|
||||||
05-Sep-2004: - Cross-provider calls (e.g. sipphone <-> FWD, with dial
|
05-Sep-2004: - Cross-provider calls (e.g. sipphone <-> FWD, with dial
|
||||||
prefixes) did not work properly
|
prefixes) did not work properly
|
||||||
04-Sep-2004: - more on Route Headers
|
04-Sep-2004: - more on Route headers
|
||||||
27-Aug-2004: - preliminary (and reduced) support for Route Headers
|
27-Aug-2004: - preliminary (and reduced) support for Route Headers
|
||||||
26-Aug-2004: - more DEBUG output
|
26-Aug-2004: - more DEBUG output
|
||||||
22-Aug-2004: - fix: secure_enviroment - set proper EGID (by Daniel Mueller)
|
22-Aug-2004: - fix: secure_enviroment - set proper EGID (by Daniel Mueller)
|
||||||
|
|||||||
@ -19,6 +19,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
SUBDIRS = src doc scripts
|
SUBDIRS = src doc scripts contrib
|
||||||
|
|
||||||
EXTRA_DIST = TODO RELNOTES siproxd.spec
|
EXTRA_DIST = TODO RELNOTES siproxd.spec
|
||||||
|
|||||||
15
README
15
README
@ -10,13 +10,16 @@ Siproxd is an proxy/masquerading daemon for the SIP protocol.
|
|||||||
It handles registrations of SIP clients on a private IP network
|
It handles registrations of SIP clients on a private IP network
|
||||||
and performs rewriting of the SIP message bodies to make SIP
|
and performs rewriting of the SIP message bodies to make SIP
|
||||||
connections possible via an masquerading firewall.
|
connections possible via an masquerading firewall.
|
||||||
It allows SIP clients (like kphone, linphone) to work behind
|
It allows SIP software clients (like kphone, linphone) or SIP
|
||||||
|
hardware clients (Voice over IP phones which are SIP-compatible,
|
||||||
|
such as those from Cisco, Grandstream or Snom) to work behind
|
||||||
an IP masquerading firewall or router.
|
an IP masquerading firewall or router.
|
||||||
|
|
||||||
SIP (Session Initiation Protocol, RFC3261) is used by Softphones
|
SIP (Session Initiation Protocol, RFC3261) is the protocol of
|
||||||
(Voice over IP) to initiate communication. By itself, SIP does not
|
choiche for most VoIP (Voice over IP) phones to initiate
|
||||||
work via masquerading firewalls as the transfered data contains
|
communication. By itself, SIP does not work via masquerading
|
||||||
IP addresses and port numbers.
|
firewalls as the transfered data contains IP addresses and
|
||||||
|
port numbers.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -184,7 +187,7 @@ CONTACTS
|
|||||||
Please feel free to contact the author to:
|
Please feel free to contact the author to:
|
||||||
- provide feedback, report bugs,
|
- provide feedback, report bugs,
|
||||||
- request for additional features
|
- request for additional features
|
||||||
- report interoperability with softphones
|
- report interoperability with various phones
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
and visit the website at http://siproxd.sourceforge.net/
|
and visit the website at http://siproxd.sourceforge.net/
|
||||||
|
|||||||
12
RELNOTES
12
RELNOTES
@ -1,7 +1,8 @@
|
|||||||
Release Notes for siproxd-0.5.8
|
Release Notes for siproxd-0.5.8
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
Major changes since 0.5.8:
|
Major changes since 0.5.7:
|
||||||
|
Several bugfixes and preliminary support for Record-Route headers.
|
||||||
|
|
||||||
General Overview:
|
General Overview:
|
||||||
- SIP (RFC3261) Proxy for SIP based softphones hidden behind a
|
- SIP (RFC3261) Proxy for SIP based softphones hidden behind a
|
||||||
@ -78,9 +79,16 @@ distribution I'd be happy to get a short notice.
|
|||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
md5sum for siproxd-0.5.8.tar.gz:
|
md5sum for siproxd-0.5.8.tar.gz: b987151719fced722b6df7d16c06f58d
|
||||||
|
|
||||||
GnuPG signature for siproxd-0.5.8.tar.gz archive:
|
GnuPG signature for siproxd-0.5.8.tar.gz archive:
|
||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
Version: GnuPG v1.2.3 (GNU/Linux)
|
||||||
|
|
||||||
|
iD8DBQBBUcuoCfzBioe83JQRAkywAJ4t/fijGYFbEnEN9n/Qe+/mRtTD2QCgkNCP
|
||||||
|
yu88yMfHeUWUbdd7AusGZK8=
|
||||||
|
=/Rgd
|
||||||
|
-----END PGP SIGNATURE-----
|
||||||
|
|
||||||
|
|
||||||
GnuPG: pub 1024D/87BCDC94 2000-03-19 Thomas Ries <tries@gmx.net>
|
GnuPG: pub 1024D/87BCDC94 2000-03-19 Thomas Ries <tries@gmx.net>
|
||||||
|
|||||||
2
TODO
2
TODO
@ -28,3 +28,5 @@ TODOs, in random order:
|
|||||||
|
|
||||||
RFC3261 non-compliance:
|
RFC3261 non-compliance:
|
||||||
- Record-Route header handling
|
- Record-Route header handling
|
||||||
|
|
||||||
|
- OpenBSD: Warning for redefinition of MACROS
|
||||||
|
|||||||
110
acinclude.m4
110
acinclude.m4
@ -295,3 +295,113 @@ AC_MSG_RESULT($acx_which_gethostname_r)
|
|||||||
|
|
||||||
])dnl ACX_WHICH_GETHOSTBYNAME_R
|
])dnl ACX_WHICH_GETHOSTBYNAME_R
|
||||||
|
|
||||||
|
dnl @synopsis ACX_WHICH_OSIP
|
||||||
|
dnl
|
||||||
|
dnl Provides a test to determine the correct
|
||||||
|
dnl way to call various osip_* functions
|
||||||
|
dnl
|
||||||
|
dnl defines HAVE_FUNC_OSIP_MESSAGE_TO_STR_3 if it needs 3 arguments
|
||||||
|
dnl defines HAVE_FUNC_OSIP_BODY_TO_STR_3 if it needs 3 arguments
|
||||||
|
dnl (libosip2 >= 2.0.9)
|
||||||
|
dnl
|
||||||
|
dnl @version $Id$
|
||||||
|
dnl @author Thomas Ries <tries@gmx.net>
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([ACX_WHICH_OSIP], [
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl osip_message_to_str
|
||||||
|
dnl
|
||||||
|
AC_CHECK_FUNC(osip_message_to_str, [
|
||||||
|
AC_MSG_CHECKING(how many arguments takes osip_message_to_str)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <osipparser2/osip_parser.h>], [
|
||||||
|
osip_message_t *sip;
|
||||||
|
char **dest;
|
||||||
|
int length;
|
||||||
|
(void) osip_message_to_str(sip, dest, &length);
|
||||||
|
],acx_which_osip_message_to_str=three,
|
||||||
|
acx_which_osip_message_to_str=two)
|
||||||
|
], acx_which_osip_message_to_str=no)
|
||||||
|
|
||||||
|
if test $acx_which_osip_message_to_str = three; then
|
||||||
|
AC_DEFINE(HAVE_FUNC_OSIP_MESSAGE_TO_STR_3,,
|
||||||
|
[osip_message_to_str takes 3 arguments])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT($acx_which_osip_message_to_str)
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl osip_body_to_str
|
||||||
|
dnl
|
||||||
|
AC_CHECK_FUNC(osip_body_to_str, [
|
||||||
|
AC_MSG_CHECKING(how many arguments takes osip_body_to_str)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <osipparser2/osip_parser.h>], [
|
||||||
|
osip_message_t *sip;
|
||||||
|
char **dest;
|
||||||
|
int length;
|
||||||
|
(void) osip_body_to_str(sip, dest, &length);
|
||||||
|
],acx_which_osip_body_to_str=three,
|
||||||
|
acx_which_osip_body_to_str=two)
|
||||||
|
], acx_which_osip_body_to_str=no)
|
||||||
|
|
||||||
|
|
||||||
|
if test $acx_which_osip_body_to_str = three; then
|
||||||
|
AC_DEFINE(HAVE_FUNC_OSIP_BODY_TO_STR_3,,
|
||||||
|
[osip_body_to_str takes 3 arguments])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT($acx_which_osip_body_to_str)
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl osip_message_set_body
|
||||||
|
dnl
|
||||||
|
AC_CHECK_FUNC(osip_message_set_body, [
|
||||||
|
AC_MSG_CHECKING(how many arguments takes osip_message_set_body)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <osipparser2/osip_parser.h>], [
|
||||||
|
osip_message_t *sip;
|
||||||
|
char **buf;
|
||||||
|
int length;
|
||||||
|
(void) osip_message_set_body(sip, buf, length);
|
||||||
|
],acx_which_osip_message_set_body=three,
|
||||||
|
acx_which_osip_message_set_body=two)
|
||||||
|
], acx_which_osip_message_set_body=no)
|
||||||
|
|
||||||
|
|
||||||
|
if test $acx_which_osip_message_set_body = three; then
|
||||||
|
AC_DEFINE(HAVE_FUNC_OSIP_MESSAGE_SET_BODY_3,,
|
||||||
|
[osip_message_set_body takes 3 arguments])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT($acx_which_osip_message_set_body)
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl osip_message_parse
|
||||||
|
dnl
|
||||||
|
AC_CHECK_FUNC(osip_message_parse, [
|
||||||
|
AC_MSG_CHECKING(how many arguments takes osip_message_parse)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <osipparser2/osip_parser.h>], [
|
||||||
|
osip_message_t *sip;
|
||||||
|
char **buf;
|
||||||
|
int length;
|
||||||
|
(void) osip_message_parse(sip, buf, length);
|
||||||
|
],acx_which_osip_message_parse=three,
|
||||||
|
acx_which_osip_message_parse=two)
|
||||||
|
], acx_which_osip_message_parse=no)
|
||||||
|
|
||||||
|
|
||||||
|
if test $acx_which_osip_message_parse = three; then
|
||||||
|
AC_DEFINE(HAVE_FUNC_OSIP_MESSAGE_PARSE_3,,
|
||||||
|
[osip_message_parse takes 3 arguments])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT($acx_which_osip_message_parse)
|
||||||
|
|
||||||
|
])dnl ACX_WHICH_OSIP
|
||||||
|
|
||||||
|
|||||||
12
config.h.in
12
config.h.in
@ -30,6 +30,18 @@
|
|||||||
/* gethostbyname_r takes 6 arguments */
|
/* gethostbyname_r takes 6 arguments */
|
||||||
#undef HAVE_FUNC_GETHOSTBYNAME_R_6
|
#undef HAVE_FUNC_GETHOSTBYNAME_R_6
|
||||||
|
|
||||||
|
/* osip_body_to_str takes 3 arguments */
|
||||||
|
#undef HAVE_FUNC_OSIP_BODY_TO_STR_3
|
||||||
|
|
||||||
|
/* osip_message_parse takes 3 arguments */
|
||||||
|
#undef HAVE_FUNC_OSIP_MESSAGE_PARSE_3
|
||||||
|
|
||||||
|
/* osip_message_set_body takes 3 arguments */
|
||||||
|
#undef HAVE_FUNC_OSIP_MESSAGE_SET_BODY_3
|
||||||
|
|
||||||
|
/* osip_message_to_str takes 3 arguments */
|
||||||
|
#undef HAVE_FUNC_OSIP_MESSAGE_TO_STR_3
|
||||||
|
|
||||||
/* Define to 1 if you have the `getgid' function. */
|
/* Define to 1 if you have the `getgid' function. */
|
||||||
#undef HAVE_GETGID
|
#undef HAVE_GETGID
|
||||||
|
|
||||||
|
|||||||
10
configure.in
10
configure.in
@ -30,6 +30,7 @@ dnl (there seems to be a bug somewhere)
|
|||||||
dnl 18-Aug-2004 tries fli4l-uclibc -> fli4l-21-uclibc, fli4l-22-uclibc
|
dnl 18-Aug-2004 tries fli4l-uclibc -> fli4l-21-uclibc, fli4l-22-uclibc
|
||||||
dnl 2.1.x has no pthread support, link -static
|
dnl 2.1.x has no pthread support, link -static
|
||||||
dnl 2.2.x has (maybe) pthread support
|
dnl 2.2.x has (maybe) pthread support
|
||||||
|
dnl 09-Oct-2004 tries libosip2 compatibility >= 2.0.9
|
||||||
dnl
|
dnl
|
||||||
dnl
|
dnl
|
||||||
dnl
|
dnl
|
||||||
@ -44,7 +45,7 @@ dnl Release Version
|
|||||||
dnl
|
dnl
|
||||||
SPD_MAJOR_VERSION=0
|
SPD_MAJOR_VERSION=0
|
||||||
SPD_MINOR_VERSION=5
|
SPD_MINOR_VERSION=5
|
||||||
SPD_MICRO_VERSION=8
|
SPD_MICRO_VERSION=9
|
||||||
|
|
||||||
SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION
|
SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION
|
||||||
|
|
||||||
@ -348,6 +349,12 @@ AC_CHECK_TYPE(socklen_t,
|
|||||||
dnl
|
dnl
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl libosip specifics: version dependencies
|
||||||
|
ACX_WHICH_OSIP()
|
||||||
|
|
||||||
|
|
||||||
AC_FUNC_MEMCMP
|
AC_FUNC_MEMCMP
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_CHECK_FUNCS(strerror)
|
AC_CHECK_FUNCS(strerror)
|
||||||
@ -402,4 +409,5 @@ Makefile \
|
|||||||
src/Makefile \
|
src/Makefile \
|
||||||
doc/Makefile \
|
doc/Makefile \
|
||||||
scripts/Makefile \
|
scripts/Makefile \
|
||||||
|
contrib/Makefile \
|
||||||
)
|
)
|
||||||
|
|||||||
23
contrib/Makefile.am
Normal file
23
contrib/Makefile.am
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2002 Thomas Ries <tries@gmx.net>
|
||||||
|
#
|
||||||
|
# This file is part of Siproxd.
|
||||||
|
#
|
||||||
|
# Siproxd is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Siproxd is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Siproxd; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
EXTRA_DIST = siproxd.init
|
||||||
|
|
||||||
81
contrib/siproxd.init
Normal file
81
contrib/siproxd.init
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# /etc/rc.d/init.d/siproxd
|
||||||
|
#
|
||||||
|
# Starts the siproxd daemon
|
||||||
|
#
|
||||||
|
# chkconfig: 345 94 80
|
||||||
|
#
|
||||||
|
# description: Listen and dispatch SIP messages
|
||||||
|
# processname: siproxd
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
[ -x /usr/sbin/siproxd ] || exit 0
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
#
|
||||||
|
# See how we were called.
|
||||||
|
#
|
||||||
|
|
||||||
|
start() {
|
||||||
|
# Check if it is already running
|
||||||
|
if [ ! -f /var/lock/subsys/siproxd ]; then
|
||||||
|
echo -n $"Starting sip proxy: "
|
||||||
|
daemon /usr/sbin/siproxd
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/siproxd
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping sip proxy: "
|
||||||
|
killproc /usr/sbin/siproxd
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/siproxd
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
trap "" SIGHUP
|
||||||
|
killall -HUP siproxd
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
reload
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
if [ -f /var/lock/subsys/siproxd ]; then
|
||||||
|
restart
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status siproxd
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
||||||
@ -4,6 +4,9 @@
|
|||||||
%define serial 1
|
%define serial 1
|
||||||
%define prefix %{_prefix}
|
%define prefix %{_prefix}
|
||||||
%define sysconfdir /etc
|
%define sysconfdir /etc
|
||||||
|
%define piddir /var/run/siproxd/
|
||||||
|
%define regdir /var/lib/siproxd/
|
||||||
|
%define siproxduser nobody
|
||||||
|
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
Summary: A SIP masquerading proxy with RTP support
|
Summary: A SIP masquerading proxy with RTP support
|
||||||
@ -48,21 +51,42 @@ make prefix=$RPM_BUILD_ROOT%{prefix} \
|
|||||||
mv $RPM_BUILD_ROOT%{sysconfdir}/siproxd.conf.example \
|
mv $RPM_BUILD_ROOT%{sysconfdir}/siproxd.conf.example \
|
||||||
$RPM_BUILD_ROOT%{sysconfdir}/siproxd.conf
|
$RPM_BUILD_ROOT%{sysconfdir}/siproxd.conf
|
||||||
|
|
||||||
|
install -d $RPM_BUILD_ROOT%{_initrddir}/
|
||||||
|
install contrib/siproxd.init $RPM_BUILD_ROOT%{_initrddir}/siproxd
|
||||||
|
|
||||||
|
install -d $RPM_BUILD_ROOT%{piddir}
|
||||||
|
install -d $RPM_BUILD_ROOT%{regdir}
|
||||||
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc COPYING README AUTHORS INSTALL NEWS ChangeLog doc/FAQ doc/FLI4L_HOWTO.txt
|
%doc COPYING README AUTHORS INSTALL NEWS ChangeLog doc/FAQ doc/FLI4L_HOWTO.txt
|
||||||
%{_sbindir}/siproxd
|
%attr(0755,root,root) %{_sbindir}/siproxd
|
||||||
%config %{sysconfdir}/siproxd.conf
|
%config %{sysconfdir}/siproxd.conf
|
||||||
%config %{sysconfdir}/siproxd_passwd.cfg
|
%config %{sysconfdir}/siproxd_passwd.cfg
|
||||||
|
%attr(0755,root,root) %{_initrddir}/siproxd
|
||||||
|
|
||||||
|
%attr(0700,%{siproxduser},root) %{piddir}
|
||||||
|
%attr(0700,%{siproxduser},root) %{regdir}
|
||||||
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
echo "Edit the config file %{sysconfigdir}/siproxd.conf!"
|
echo "Edit the config file %{sysconfigdir}/siproxd.conf!"
|
||||||
|
/sbin/chkconfig --add %{name}
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 = 0 ]; then
|
||||||
|
/sbin/chkconfig --del %{name}
|
||||||
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Oct 09 2004 Thomas Ries <tries@gmx.net>
|
||||||
|
- startup script in /etc/rc.d/init.d/siproxd
|
||||||
|
- create directories for PID and registration files
|
||||||
|
|
||||||
* Fri Oct 31 2003 Thomas Ries <tries@gmx.net>
|
* Fri Oct 31 2003 Thomas Ries <tries@gmx.net>
|
||||||
- siproxd is now installed to sbin directory
|
- siproxd is now installed to sbin directory
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ sbin_PROGRAMS = siproxd
|
|||||||
siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \
|
siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \
|
||||||
sip_utils.c log.c readconf.c rtpproxy.c \
|
sip_utils.c log.c readconf.c rtpproxy.c \
|
||||||
rtpproxy_relay.c accessctl.c route_processing.c \
|
rtpproxy_relay.c accessctl.c route_processing.c \
|
||||||
security.c auth.c fwapi.c
|
security.c auth.c fwapi.c comp_osip.c
|
||||||
|
|
||||||
#
|
#
|
||||||
# an example for a custom firewall control module
|
# an example for a custom firewall control module
|
||||||
|
|||||||
12
src/proxy.c
12
src/proxy.c
@ -530,7 +530,7 @@ int proxy_request (sip_ticket_t *ticket) {
|
|||||||
* RFC 3261, Section 16.6 step 10
|
* RFC 3261, Section 16.6 step 10
|
||||||
* Proxy Behavior - Forward the new request
|
* Proxy Behavior - Forward the new request
|
||||||
*/
|
*/
|
||||||
sts = osip_message_to_str(request, &buffer);
|
sts = comp_osip_message_to_str(request, &buffer);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
ERROR("proxy_request: osip_message_to_str failed");
|
ERROR("proxy_request: osip_message_to_str failed");
|
||||||
return STS_FAILURE;
|
return STS_FAILURE;
|
||||||
@ -908,7 +908,7 @@ int proxy_response (sip_ticket_t *ticket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sts = osip_message_to_str(response, &buffer);
|
sts = comp_osip_message_to_str(response, &buffer);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
ERROR("proxy_response: osip_message_to_str failed");
|
ERROR("proxy_response: osip_message_to_str failed");
|
||||||
return STS_FAILURE;
|
return STS_FAILURE;
|
||||||
@ -964,7 +964,7 @@ int proxy_rewrite_invitation_body(osip_message_t *mymsg, int direction){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sts = osip_body_to_str(body, &bodybuff);
|
sts = comp_osip_body_to_str(body, &bodybuff);
|
||||||
sts = sdp_message_init(&sdp);
|
sts = sdp_message_init(&sdp);
|
||||||
sts = sdp_message_parse (sdp, bodybuff);
|
sts = sdp_message_parse (sdp, bodybuff);
|
||||||
osip_free(bodybuff);
|
osip_free(bodybuff);
|
||||||
@ -979,7 +979,7 @@ if (configuration.debuglevel)
|
|||||||
{ /* just dump the buffer */
|
{ /* just dump the buffer */
|
||||||
char *tmp, *tmp2;
|
char *tmp, *tmp2;
|
||||||
sts = osip_message_get_body(mymsg, 0, &body);
|
sts = osip_message_get_body(mymsg, 0, &body);
|
||||||
sts = osip_body_to_str(body, &tmp);
|
sts = comp_osip_body_to_str(body, &tmp);
|
||||||
osip_content_length_to_str(mymsg->content_length, &tmp2);
|
osip_content_length_to_str(mymsg->content_length, &tmp2);
|
||||||
DEBUG("Body before rewrite (clen=%s, strlen=%i):\n%s\n----",
|
DEBUG("Body before rewrite (clen=%s, strlen=%i):\n%s\n----",
|
||||||
tmp2, strlen(tmp), tmp);
|
tmp2, strlen(tmp), tmp);
|
||||||
@ -1202,7 +1202,7 @@ if (configuration.debuglevel)
|
|||||||
sdp_message_free(sdp);
|
sdp_message_free(sdp);
|
||||||
|
|
||||||
/* include new body */
|
/* include new body */
|
||||||
osip_message_set_body(mymsg, bodybuff);
|
comp_osip_message_set_body(mymsg, bodybuff);
|
||||||
|
|
||||||
/* free content length resource and include new one*/
|
/* free content length resource and include new one*/
|
||||||
osip_content_length_free(mymsg->content_length);
|
osip_content_length_free(mymsg->content_length);
|
||||||
@ -1217,7 +1217,7 @@ if (configuration.debuglevel)
|
|||||||
{ /* just dump the buffer */
|
{ /* just dump the buffer */
|
||||||
char *tmp, *tmp2;
|
char *tmp, *tmp2;
|
||||||
sts = osip_message_get_body(mymsg, 0, &body);
|
sts = osip_message_get_body(mymsg, 0, &body);
|
||||||
sts = osip_body_to_str(body, &tmp);
|
sts = comp_osip_body_to_str(body, &tmp);
|
||||||
osip_content_length_to_str(mymsg->content_length, &tmp2);
|
osip_content_length_to_str(mymsg->content_length, &tmp2);
|
||||||
DEBUG("Body after rewrite (clen=%s, strlen=%i):\n%s\n----",
|
DEBUG("Body after rewrite (clen=%s, strlen=%i):\n%s\n----",
|
||||||
tmp2, strlen(tmp), tmp);
|
tmp2, strlen(tmp), tmp);
|
||||||
|
|||||||
@ -547,7 +547,7 @@ int register_response(sip_ticket_t *ticket, int flag) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sts = osip_message_to_str(response, &buffer);
|
sts = comp_osip_message_to_str(response, &buffer);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
ERROR("register_response: msg_2char failed");
|
ERROR("register_response: msg_2char failed");
|
||||||
return STS_FAILURE;
|
return STS_FAILURE;
|
||||||
|
|||||||
@ -563,7 +563,7 @@ int sip_gen_response(sip_ticket_t *ticket, int code) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sts = osip_message_to_str(response, &buffer);
|
sts = comp_osip_message_to_str(response, &buffer);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
ERROR("sip_gen_response: msg_2char failed");
|
ERROR("sip_gen_response: msg_2char failed");
|
||||||
return STS_FAILURE;
|
return STS_FAILURE;
|
||||||
|
|||||||
@ -309,7 +309,7 @@ int main (int argc, char *argv[])
|
|||||||
* Proxy Behavior - Request Validation - Reasonable Syntax
|
* Proxy Behavior - Request Validation - Reasonable Syntax
|
||||||
* (parse the received message)
|
* (parse the received message)
|
||||||
*/
|
*/
|
||||||
sts=osip_message_parse(ticket.sipmsg, buff);
|
sts=comp_osip_message_parse(ticket.sipmsg, buff);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
ERROR("osip_message_parse() failed... this is not good");
|
ERROR("osip_message_parse() failed... this is not good");
|
||||||
DUMP_BUFFER(-1, buff, i);
|
DUMP_BUFFER(-1, buff, i);
|
||||||
|
|||||||
@ -153,13 +153,13 @@ int compare_url(osip_uri_t *url1, osip_uri_t *url2); /*X*/
|
|||||||
int compare_callid(osip_call_id_t *cid1, osip_call_id_t *cid2); /*X*/
|
int compare_callid(osip_call_id_t *cid1, osip_call_id_t *cid2); /*X*/
|
||||||
int is_sipuri_local (sip_ticket_t *ticket); /*X*/
|
int is_sipuri_local (sip_ticket_t *ticket); /*X*/
|
||||||
int check_rewrite_rq_uri (osip_message_t *sip); /*X*/
|
int check_rewrite_rq_uri (osip_message_t *sip); /*X*/
|
||||||
int sip_gen_response(sip_ticket_t *ticket, int code); /*X*/
|
int sip_gen_response(sip_ticket_t *ticket, int code); /*X*/
|
||||||
#define IF_OUTBOUND 0
|
#define IF_OUTBOUND 0
|
||||||
#define IF_INBOUND 1
|
#define IF_INBOUND 1
|
||||||
int sip_add_myvia (sip_ticket_t *ticket, int interface); /*X*/
|
int sip_add_myvia (sip_ticket_t *ticket, int interface); /*X*/
|
||||||
int sip_del_myvia (sip_ticket_t *ticket); /*X*/
|
int sip_del_myvia (sip_ticket_t *ticket); /*X*/
|
||||||
int sip_rewrite_contact (sip_ticket_t *ticket, int direction); /*X*/
|
int sip_rewrite_contact (sip_ticket_t *ticket, int direction); /*X*/
|
||||||
int sip_calculate_branch_id (sip_ticket_t *ticket, char *id); /*X*/
|
int sip_calculate_branch_id (sip_ticket_t *ticket, char *id); /*X*/
|
||||||
|
|
||||||
/* readconf.c */
|
/* readconf.c */
|
||||||
int read_config(char *name, int search); /*X*/
|
int read_config(char *name, int search); /*X*/
|
||||||
@ -182,7 +182,7 @@ int security_check_sip(sip_ticket_t *ticket); /*X*/
|
|||||||
|
|
||||||
/* auth.c */
|
/* auth.c */
|
||||||
int authenticate_proxy(sip_ticket_t *ticket); /*X*/
|
int authenticate_proxy(sip_ticket_t *ticket); /*X*/
|
||||||
int auth_include_authrq(sip_ticket_t *ticket); /*X*/
|
int auth_include_authrq(sip_ticket_t *ticket); /*X*/
|
||||||
void CvtHex(char *hash, char *hashstring);
|
void CvtHex(char *hash, char *hashstring);
|
||||||
|
|
||||||
/* fwapi.c */
|
/* fwapi.c */
|
||||||
@ -193,6 +193,13 @@ int fwapi_stop_rtp(int rtp_direction,
|
|||||||
struct in_addr local_ipaddr, int local_port,
|
struct in_addr local_ipaddr, int local_port,
|
||||||
struct in_addr remote_ipaddr, int remote_port);
|
struct in_addr remote_ipaddr, int remote_port);
|
||||||
|
|
||||||
|
/* osip_comp.c */
|
||||||
|
int comp_osip_message_to_str (osip_message_t *sip, char **dest);
|
||||||
|
int comp_osip_body_to_str (const osip_body_t *body, char **dest);
|
||||||
|
int comp_osip_message_set_body(osip_message_t *sip, const char *buf);
|
||||||
|
int comp_osip_message_parse (osip_message_t *sip, const char *message);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* some constant definitions
|
* some constant definitions
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user