From d7029ce354b33243bb3e1ce5dea5ccb8c91dd266 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Sat, 29 Mar 2003 17:14:56 +0000 Subject: [PATCH] - released 0.3.1 - fix in configure.in for statically linking to libosip - fix in rewriting SIP messages, figure out proper destination if *not* rewriting the SIP URI - another NULL pointer related crash (no UA header present) --- ChangeLog | 8 +++++ RELNOTES | 66 ++++++++++++++++++++++++++++++++++++++++ configure.in | 7 ++--- doc/siproxd.conf.example | 2 +- siproxd.spec | 2 +- src/proxy.c | 20 +++++------- src/sip_utils.c | 23 ++++++++++++-- src/sock.c | 2 +- 8 files changed, 108 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c56b8e..b2c0ff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +0.3.1 +===== +- 29-May-2003: - released 0.3.1 + - fix in configure.in for statically linking to libosip + - fix in rewriting SIP messages, figure out proper + destination if *not* rewriting the SIP URI + - another NULL pointer related crash (no UA header present) + 0.3.0 ===== - 29-May-2003: - released 0.3.0 diff --git a/RELNOTES b/RELNOTES index 7e70d12..0baef5a 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,3 +1,69 @@ +Release Notes for siproxd-0.3.1 +=============================== + + - Fli4l OPT_SIP (still experimental) available, check + http://home.arcor.de/jsffm/fli4l/ + - supports Linux and FreeBSD (other BSD derivates not yet tested) + - SIP (RFC3261) Proxy for SIP based softphones hidden behind a + masquerading firewall + - Includes an RTP data stream proxy for *incoming* audio data + (outgoing RTP data should be handled by IP masquerading by the firewall) + - Port range to be used for incoming RTP traffic is configurable + (-> easy to set up apropriate firewall rules for incoming traffic) + - RTP proxy can handle multiple RTP streams (eg. audio + video) + within a single SIP session. + - Multiple local users/hosts can be masqueraded simultaneously + - Supports running in a chroot jail (configurable) + - Supports changing user-ID after startup (if started as root) + - All configuration done via one simple ascii configuration file + - Proxy Authentication for registration of local clients (User Agents) + with individual passwords for each user + - Logging to syslog in daemon mode + - Access control (IP based) for incoming traffic + - RPM support (release includes SRC rpm and binary RPMS for Redhat 6.0, 7.2) + - works with "dial-up" conenctions (dynamic IP addresses) + - The host part of UA registration entries can be masqueraded + (mask_host, masked_host config items) Siemens SIP phones seem to + need this 'feature'. + +Requirements: + - pthreads + - glibc2 / libc5 / uClibc + - builds with libosip>0.8.8 / libosip2 + - prebuild binaries (RPMs) require libosip2 to be installed + +Currently tested on: +- Redhat 6.0 (Kernel 2.2.x, Glibc) +- Redhat 7.2 (Kernel 2.4.x, Glibc) +- SUSE 5.3 (kernel 2.0.x, libc5) +- Redhat 7.2 build against uClibc (Fli4l use) +- should run on others Linux distributions as well. +- FreeBSD 4.7-STABLE (compilation) + +Reported to build on: +- OpenBSD 2.9 + + +Reported interoperability (tested with softphones): + - Linphone (local and remote UA) (http://www.linphone.org) + - Kphone (local and remote UA) (http://www.wirlab.net/kphone/) + - MSN messenger 4.6 (remote and local UA) + +Known bugs: + - with kphone 3.1 & libosip-0.*, authentication does NOT work at + all (due to 'parse error' in libosip) - use libosip2, this works fine + + +----- +md5sum for siproxd-0.3.1.tar.gz: +md5sum for siproxd-0.3.1-1rh60.i386.rpm: +md5sum for siproxd-0.3.1-1rh72.i386.rpm: +md5sum for siproxd-0.3.1-1.src.rpm: + +GnuPG signature for siproxd-0.3.0.tar.gz archive: + + + Release Notes for siproxd-0.3.0 =============================== diff --git a/configure.in b/configure.in index 5a4a075..c35c841 100644 --- a/configure.in +++ b/configure.in @@ -24,7 +24,7 @@ dnl Release Version dnl SPD_MAJOR_VERSION=0 SPD_MINOR_VERSION=3 -SPD_MICRO_VERSION=0 +SPD_MICRO_VERSION=1 SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION @@ -191,7 +191,6 @@ AC_ARG_ENABLE(force-osip1, AC_CHECK_LIB(osip2, main, [osiplib=osip2 have_osip2=yes], ) ) - AC_DEFINE_UNQUOTED(LIBOSIPVER, ["$osiplib"], [type of libosip]) if test "x$have_osip2" = "xyes"; then AC_DEFINE(HAVE_OSIP2, , [have osip2 installed]) @@ -204,9 +203,9 @@ if test "x$build_static_libosip" = "xno"; then else dnl link statically to this lib dnl (this probably only will work on linux yet...) - AC_MSG_CHECKING("where I can find lib{$osiplib}.a") + AC_MSG_CHECKING("where I can find lib$osiplib.a") libosip_static=`find $extra_libs /lib /usr/lib /usr/local/lib \ - -name lib{$osiplib}.a 2>/dev/null|head -1` + -name lib$osiplib.a 2>/dev/null|head -1` if test "x$libosip_static" != "x"; then LIBS="$libosip_static $LIBS" AC_MSG_RESULT($libosip_static) diff --git a/doc/siproxd.conf.example b/doc/siproxd.conf.example index 6e45098..b7a3b76 100644 --- a/doc/siproxd.conf.example +++ b/doc/siproxd.conf.example @@ -74,7 +74,7 @@ rtp_port_high = 7080 # after this number of seconds, an RTP stream is considered dead # and proxying it will be stopped. # -rtp_timeout = 60 +rtp_timeout = 120 ###################################################################### # Proxy authentication diff --git a/siproxd.spec b/siproxd.spec index a02f399..5fe9ceb 100644 --- a/siproxd.spec +++ b/siproxd.spec @@ -1,5 +1,5 @@ %define name siproxd -%define ver 0.3.0 +%define ver 0.3.1 %define release 1 %define serial 1 %define prefix %{_prefix} diff --git a/src/proxy.c b/src/proxy.c index 7a91445..71094a9 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -64,7 +64,7 @@ int proxy_request (sip_t *request) { int i; int sts; int type; - struct in_addr addr; + struct in_addr sendto_addr; contact_t *contact; url_t *url; int port; @@ -143,6 +143,8 @@ int proxy_request (sip_t *request) { * from an external host to the internal masqueraded host */ case REQTYP_INCOMING: + sts = get_ip_by_host(urlmap[i].true_url->host, &sendto_addr); + /* rewrite request URI to point to the real host */ /* i still holds the valid index into the URLMAP table */ if (check_rewrite_rq_uri(request)==STS_TRUE) { @@ -167,10 +169,12 @@ int proxy_request (sip_t *request) { * from the internal masqueraded host to an external host */ case REQTYP_OUTGOING: + /* get destination address */ + url=msg_geturi(request); + sts = get_ip_by_host(url->host, &sendto_addr); /* if it is addressed to myself, then it must be some request * method that I as a proxy do not support. Reject */ if (is_sipuri_local(request) == STS_TRUE) { - url=msg_geturi(request); WARN("unsupported request [%s] directed to proxy from %s@%s -> %s@%s", request->strtline->sipmethod? request->strtline->sipmethod:"*NULL*", request->from->url->username? request->from->url->username:"*NULL*", @@ -249,16 +253,6 @@ int proxy_request (sip_t *request) { } -/* get target address from request URL */ - url=msg_geturi(request); - - if (url) { - sts = get_ip_by_host(url->host, &addr); - } else { - ERROR("proxy_request: got NULL URL"); - return STS_FAILURE; - } - sts = msg_2char(request, &buffer); if (sts != 0) { ERROR("proxy_request: msg_2char failed"); @@ -272,7 +266,7 @@ int proxy_request (sip_t *request) { port=SIP_PORT; } - sipsock_send_udp(&sip_socket, addr, port, buffer, strlen(buffer), 1); + sipsock_send_udp(&sip_socket, sendto_addr, port, buffer, strlen(buffer), 1); free (buffer); return STS_SUCCESS; } diff --git a/src/sip_utils.c b/src/sip_utils.c index b49feee..3e9b9a3 100644 --- a/src/sip_utils.c +++ b/src/sip_utils.c @@ -114,6 +114,23 @@ sip_t *msg_make_template_reply (sip_t * request, int code) { * STS_FALSE if no loop */ int check_vialoop (sip_t *my_msg) { +/* +!!! actually this is a problematic one. +1) for requests, I must search the whole VIA list + (topmost via is the previos station in the path) + +2) for responses I must skip the topmost via, as this is mine + (and will be removed later on) + +3) What happens if we have 'clashes' with private addresses?? + From that point of view, siproxd *should* not try to + check against it's local IF addresses if thei are private. + this then of course again can lead to a endless loop... + + can we use something like a Tag in via headers?? (a veriy likely + to-be-unique ID) + +*/ int sts; int pos; int found_own_via; @@ -371,8 +388,10 @@ int check_rewrite_rq_uri (sip_t *sip) { } DEBUGC(DBCLASS_SIP, "check_rewrite_rq_uri: [%s:%s, i=%i, j=%i] " "got action %s", - sip->strtline->sipmethod, ua_hdr->hvalue, i, j, - (sts==STS_TRUE)? "rewrite":"norewrite"); + (sip && sip->strtline && sip->strtline->sipmethod) ? + sip->strtline->sipmethod : "*NULL*", + (ua_hdr && ua_hdr->hvalue)? ua_hdr->hvalue:"*NULL*", + i, j, (sts==STS_TRUE)? "rewrite":"norewrite"); return sts; } } /* for j */ diff --git a/src/sock.c b/src/sock.c index c8792be..5239825 100644 --- a/src/sock.c +++ b/src/sock.c @@ -135,7 +135,7 @@ int sipsock_send_udp(int *sock, struct in_addr addr, int port, } if (buffer == NULL) { - ERROR("sipsock_send_udp go tNULL buffer"); + ERROR("sipsock_send_udp got NULL buffer"); return STS_FAILURE; }