- Bugfix: MSN Messenger issue - compare_url

- some more detailed debug output
This commit is contained in:
Thomas Ries
2003-01-21 23:18:31 +00:00
parent e3ef83a413
commit 5bbdef20f0
14 changed files with 193 additions and 80 deletions
+19 -6
View File
@@ -1,10 +1,23 @@
0.2.5
0.2.6
=====
- 6-Dec-2002: - released 0.2.5 (major bugfixes)
- 21-Jan-2003: - Bugfix: crash in compare_url (MSN Messenger issue)
- 19-Jan-2003: - use of libosip-0.9.3 not possible yet -
libosip fails in msg_setproxy_authenticate
-> Bug in libosip? to be investigated!
- give IP address in debug for 'received packet'
- 'WARNING:proxy.c:202 request from/to unregistered UA' now
includes sender and destination url
- 17-Jan-2003: - OpenBSD: do not link against gnugetopt (Luke Renn)
0.2.5a
======
- 6-Dec-2002: - released 0.2.5a (major bugfixes)
- Bugfix: interfaces on odd positions (the 1st , 3rd, 5th)
have been skipped during the search (ip by interface)
- Bugfix: MSN messenger 4.6 caused a segfault due to
non supplied username in contact header during
registration. (Credits to Dhiraj Bhuyan for the hint)
Included additional tests in that area.
registration. (Credits to Dhiraj Bhuyan for the hint)
Included additional tests in that area.
- 4-Dec-2002: - fixed a major (but stupid) bug in check_vialoop. Siproxd
wrongly claimed to have detected a loop...
@@ -46,7 +59,7 @@
- 28-Sep-2002: - Released version 0.2.1
- 27-Sep-2002: - first implementation of proxy authentication (for REGISTER)
- 24-Sep-2002: - if daemonized, log to syslog
- 22-Sep-2002: - added access list support for registration and incomming
- 22-Sep-2002: - added access list support for registration and incoming
SIP packets.
- 21-Sep-2002: - added RPM support (Spec File)
@@ -72,7 +85,7 @@
if the local user agent is located in a private IP range.)
- Performance optimizations in RTP proxy
- Bugfix: now masqueraded clients work with any
SIP port (other than 5060). Before, incomming
SIP port (other than 5060). Before, incoming
requests/responses where always sent to port 5060.
0.1.2
+21 -7
View File
@@ -72,6 +72,20 @@ The easiest way to do this:
3) reproduce the error
4) include the debug.log in your error report.
If siproxd crashes (core dump), a stack backtrace usually is helpful to me:
1) reproduce the crash -> core file
2) use gdb to print the stack backtrace:
$ gdb ./src/siproxd core
(gdb) bt
#0 0x400ec9ee in __select ()
#1 0xbffff6f8 in ?? ()
#2 0x804a5c2 in main (argc=3, argv=0xbffffc54) at siproxd.c:186
#3 0x4005bcb3 in __libc_start_main (main=0x804a30c <main>, argc=3,
argv=0xbffffc54, init=0x8049a08 <_init>, fini=0x804edac <_fini>,
rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffffc4c)
at ../sysdeps/generic/libc-start.c:78
(gdb)
WHAT SIPROXD DOES
@@ -83,9 +97,9 @@ There usually will be a masquerading firewall in between to 'hide' the
private IP range (either via NAT - network address translation or
masuerading). Check the scenario drawn below.
With release 0.1.2 siproxd is also able to proxy incomming RTP data
With release 0.1.2 siproxd is also able to proxy incoming RTP data
streams. The config parameters 'rtp_port_low' and rtp_port_high' define
the port range that siproxd will use for incomming RTP data streams.
the port range that siproxd will use for incoming RTP data streams.
'rtp_timeout' defines after what time an unused (no data received)
rtp stream is considered dead and removed.
@@ -124,7 +138,7 @@ Scenario
of the firewall (eg use some dynamic DNS service [1])
IPCHAINS:
Firewall rules for incomming traffic:
Firewall rules for incoming traffic:
$ ipchains -A input --proto udp --dport 5060 --log -j ACCEPT
$ ipchains -A input --proto udp --dport 7070:7080 -j ACCEPT
@@ -132,7 +146,7 @@ IPCHAINS:
$ ipchains -A forward -i ppp0 -j MASQ -s 10.0.0.0/24 -d 0.0.0.0/0
IPTABLES:
Firewall rules for incomming traffic:
Firewall rules for incoming traffic:
$iptables -A INPUT -i ppp0 -p udp -m udp --dport 5060 -j ACCEPT
$iptables -A INPUT -i ppp0 -p udp -m udp --dport 7070:7080 -j ACCEPT
@@ -140,9 +154,9 @@ IPTABLES:
$ iptables -t nat -A POSTROUTING -s 10.0.0.0/255.255.255.0 -j MASQUERADE
The first line will allow incomming SIP traffic. The second line will
allow incomming RTP traffic on the ports 7070 - 7080 (the default port
range used by siproxd for incomming RTP traffic).
The first line will allow incoming SIP traffic. The second line will
allow incoming RTP traffic on the ports 7070 - 7080 (the default port
range used by siproxd for incoming RTP traffic).
The rule for masquerading will ensure that the outgoing RTP data stream
is masqueraded properly and sent to the remote host.
+75 -22
View File
@@ -1,3 +1,56 @@
Release Notes for siproxd-0.2.6
===============================
This release mainly fixes some annoying (and stupid) bugs.
See the ChangeLog for details.
- supports Linux and FreeBSD (other BSD derivates not 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)
- 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)
Requirements:
- pthreads
- libosip 0.8.8 (using libosip 0.9.6, proxy authentication does *not*
work. Unclear if this is a bug in libosip or not)
Currently tested on:
- Linux 2.2.x (Redhat 6.0) and 2.4.x (Redhat 7.2), 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 UA) (http://www.linphone.org)
- Kphone (local UA) (http://www.wirlab.net/kphone/)
- MSN messenger 4.6 (remote UA)
-----
md5sum for siproxd-0.2.6.tar.gz: 042986602efeaaa77a14bb0b1a416083
md5sum for siproxd-0.2.6-1rh60.i386.rpm:
md5sum for siproxd-0.2.6-1rh72.i386.rpm:
md5sum for siproxd-0.2.6-1.src.rpm:
GnuPG signature for siproxd-0.2.6.tar.gz archive:
Release Notes for siproxd-0.2.5
===============================
This release mainly fixes some annoying (and stupid) bugs.
@@ -5,10 +58,10 @@ Release Notes for siproxd-0.2.5
- supports Linux and FreeBSD (other BSD derivates not tested)
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for *incomming* audio data
- 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 incomming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incomming traffic)
- Port range to be used for incoming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incoming traffic)
- 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)
@@ -16,7 +69,7 @@ Release Notes for siproxd-0.2.5
- 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 incomming traffic
- Access control (IP based) for incoming traffic
- RPM support (release includes SRC rpm and binary RPMS for Redhat 6.0, 7.2)
- should now works with "dial-up" conenctions (changing IP addresses)
@@ -60,10 +113,10 @@ Release Notes for siproxd-0.2.4
===============================
- supports Linux and FreeBSD (other BSD derivates not tested)
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for *incomming* audio data
- 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 incomming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incomming traffic)
- Port range to be used for incoming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incoming traffic)
- 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)
@@ -71,7 +124,7 @@ Release Notes for siproxd-0.2.4
- 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 incomming traffic
- Access control (IP based) for incoming traffic
- RPM support (release includes SRC rpm and binary RPMS for Redhat 6.0, 7.2)
- should now works with "dial-up" conenctions (changing IP addresses)
@@ -109,10 +162,10 @@ rMwAn3VjqrmeBZ9s9mHyCtmvTaZPNsPX
Release Notes for siproxd-0.2.3
===============================
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for *incomming* audio data
- 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 incomming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incomming traffic)
- Port range to be used for incoming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incoming traffic)
- 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)
@@ -120,7 +173,7 @@ Release Notes for siproxd-0.2.3
- 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 incomming traffic
- Access control (IP based) for incoming traffic
- RPM support (release includes SRC rpm and binary RPMS for Redhat 6.0, 7.2)
Requirements:
@@ -154,10 +207,10 @@ z28AoONvmvpy+uS7khruF18SPfb6znvl
Release Notes for siproxd-0.2.2
===============================
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for *incomming* audio data
- 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 incomming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incomming traffic)
- Port range to be used for incoming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incoming traffic)
- 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)
@@ -165,7 +218,7 @@ Release Notes for siproxd-0.2.2
- Proxy Authentication for registration of local clients (User Agents)
now supports per user passwords
- Logging to syslog in Daemon mode
- Access control (IP based) for incomming traffic
- Access control (IP based) for incoming traffic
- RPM support (spec file)
Requirements:
@@ -196,17 +249,17 @@ MNUAn2dOBHIfOJLy3CaqM1AUt8PC8iN6
Release Notes for siproxd-0.2.1
===============================
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for *incomming* audio data
- 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 incomming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incomming traffic)
- Port range to be used for incoming RTP traffic is configurable
(-> easy to set up apropriate firewall rules for incoming traffic)
- 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)
- Logging to syslog in Daemon mode
- Access control (IP based) for incomming traffic
- Access control (IP based) for incoming traffic
- RPM support (spec file)
Requirements:
@@ -237,7 +290,7 @@ IX4AnAtYcNxJJhLXEKcj2ziKKvkectL9
Release Notes for siproxd-0.2.0
===============================
- SIP Proxy for SIP based softphones hidden behind a masquerading firewall
- Includes an RTP data stream proxy for incomming audio data
- Includes an RTP data stream proxy for incoming audio data
- Supports running in a chroot jail (configurable)
- Supports changing user ID after startup (if started as root)
- All configuration done via config file
@@ -289,7 +342,7 @@ b1cAn331fJVdvaVyRJz0AVjUnD7v+fx6
Release Notes for siproxd-0.1.2
===============================
- New: experimental proxying incomming RTP data streams
- New: experimental proxying incoming RTP data streams
(please send me feedback if you try it out)
- optimizations in DNS resolving
- fix in client registration concept (Contact Header)
+26 -9
View File
@@ -1,14 +1,6 @@
TODOs, in random order:
=======================
- properly handle dynamic IP addresses
-> cyclically scan outbound interface, get IP address
and if changed, update my internal data structures
- adapt config file for inbound if name / outbound if name
and figure out the ip addresses during runtime (cache and
renew the cache every minute or so...)
-> get_inbout_addr(void) get_outbound_addr(void)
- automatized CVS snapshot beamed to siproxd homepage (siproxd.sourceforge.net)
- Documentation (yeah, yeah...)
@@ -19,10 +11,35 @@ TODOs, in random order:
- get_ip_by_host: reduce DNS timeouts (seems to be a more complex problem...)
- support for "full duplex" RTP proxying
- (support for "full duplex" RTP proxying)
- portability to other platforms / operating systems
first goal: other Unixes (porting to FreeBSD is queued)
- security tests for received SIP messages (function securitycheck)
- via loop detection: send 482 error code
- support Record-Route header
- Georg Schwarz (1.Jan 2003)
Ein weiteres Problem ist, daß sich z.B. das Siemens-Phone (wenn man 202
als Telephonnummer einstellt) immer als 202@192.168.0.1 anmeldet beim
Proxy (da ihm gesagt worden ist, daß der Proxy auf 192.168.0.1 läuft und
es nicht weiß, daß dieser "von außen" unter einer anderen IP/FQDN
zusätzlich erreichbar ist).
Anrufe an 202@gate.geos.net.eu.org von außen werden daher nicht
durchgestellt. Hier sollte siproxd vielleicht erkennen, daß URIs mit der
lokalen Interface IP äquivalent sind, bzw. man sollte dieses Verhalten
ggfs. konfigurieren können (z.B. durch die Möglichkeit zur Angabe
mehrerer äquivalenter "Domainnamen").
working on it
Ich könnte mir ein Feature vorstellen, das z.B. für ein Subnetz
einen FQDN forciert.
force_fqdn_net=10.0.0.0/8
force_fqdn_name=myhost.domain.org.
- fli4l modul
+2 -2
View File
@@ -20,7 +20,7 @@ dnl Release Version
dnl
SPD_MAJOR_VERSION=0
SPD_MINOR_VERSION=2
SPD_MICRO_VERSION=5
SPD_MICRO_VERSION=6
SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION
@@ -92,7 +92,7 @@ case "$target" in
AC_DEFINE(_BSD,,[building on BSD platform])
AC_DEFINE(_OPENBSD,,[building on OpenBSD platform])
CPPFLAGS="$CPPFLAGS -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib/ -lgnugetopt"
LIBS="$LIBS -L/usr/local/lib/"
;;
*-*-netbsd*)
AC_MSG_RESULT("NetBSD")
+5 -5
View File
@@ -11,10 +11,10 @@ A: The goal is that every softphone (that is SIP compliant) should be
- linphone (0.9.0)
- kphone (1.0.2)
---------------------------------------------------------------------------
Q: Siproxd's RTP proxying does only work for incomming RTP audio data.
Q: Siproxd's RTP proxying does only work for incoming RTP audio data.
Should it not also proxy outgoing RTP data?
A: Curently (0.2.0) that is the correct behaviour. Incomming RTP traffic
A: Curently (0.2.0) that is the correct behaviour. Incoming RTP traffic
is handled by siproxd's RTP proxy. However, outgoing RTP traffic has
to be handled by the firewall (IP masquerading).
---------------------------------------------------------------------------
@@ -83,9 +83,9 @@ A: Scenario
To make an outgoing call from IntHost simply use the SIP address of the
target ( -> sip:test@xxx.org).
test@xxx.org can make a incomming calls - it simply has to use the registered
test@xxx.org can make a incoming calls - it simply has to use the registered
SIP address of the softphone running on IntHost (sip:johndoe@foo.bar.org).
Siproxd will then rewrite and forward the incomming request to Inthost.
Siproxd will then rewrite and forward the incoming request to Inthost.
The externalHost does not need to know anything about the proxy. For the
user sip:test@xxx.org it looks as he directly sends the traffic to
@@ -107,7 +107,7 @@ A: The mapping mechanism of SIP addresses works basically like:
IntHosts (each of them using a different user name) running at the
same time.
For an incomming call, siproxd will search its registration table for
For an incoming call, siproxd will search its registration table for
the requested SIP address and so finds the internal host that belong to it.
This of course *requires* that the username part of the SIP address is
+3 -3
View File
@@ -24,7 +24,7 @@ if_outbound = ppp0
######################################################################
# Port to listen for incomming SIP messages.
# Port to listen for incoming SIP messages.
# Access lists in the form: IP/mask (ex. 10.0.0.1/24)
# multiple entries may be separated by commas NO SPACES ARE ALLOWED!!
# Empty list means 'does not apply' - no filtering is done then.
@@ -40,7 +40,7 @@ if_outbound = ppp0
#
# Example for usage:
# local private net -> allow_reg list
# external nets (where we accept incomming calls from) -> allow_sip
# external nets (where we accept incoming calls from) -> allow_sip
#
#hosts_allow_reg = 192.168.1.8/24
#hosts_allow_sip = 123.45.0.0/16,123.46.0.0/16
@@ -73,7 +73,7 @@ user = nobody
rtp_proxy_enable = 1
######################################################################
# Port range where to allocate listen ports for incomming RTP traffic
# Port range where to allocate listen ports for incoming RTP traffic
# this should be a range that is not blocked by the firewall
#
rtp_port_low = 7070
+1 -1
View File
@@ -1,5 +1,5 @@
%define name siproxd
%define ver 0.2.5
%define ver 0.2.6
%define release 1
%define serial 1
%define prefix %{_prefix}
+5
View File
@@ -109,7 +109,12 @@ int auth_include_authrq(sip_t *response) {
configuration.proxy_auth_realm,
auth_generate_nonce());
DEBUGC(DBCLASS_AUTH,"msg_setproxy_authenticate [%s]",str);
sts = msg_setproxy_authenticate(response, str);
/*
this does not work with libosip 0.9.3 - msg_setproxy_authenticate
fails with sts=-1 there. Bug ?
*/
DEBUGC(DBCLASS_AUTH,"msg_setproxy_authenticate sts=%i",sts);
+18 -15
View File
@@ -65,7 +65,7 @@ int proxy_request (sip_t *request) {
int port;
char *buffer;
#define REQTYP_INCOMMING 1
#define REQTYP_INCOMING 1
#define REQTYP_OUTGOING 2
DEBUGC(DBCLASS_PROXY,"proxy_request");
@@ -81,10 +81,10 @@ int proxy_request (sip_t *request) {
for (i=0; i<URLMAP_SIZE; i++) {
if (urlmap[i].active == 0) continue;
/* incomming request ('to' == 'masq') */
/* incoming request ('to' == 'masq') */
if (compare_url(request->to->url, urlmap[i].masq_url)==STS_SUCCESS) {
type=REQTYP_INCOMMING;
DEBUGC(DBCLASS_PROXY,"incomming request from %s@%s from outbound",
type=REQTYP_INCOMING;
DEBUGC(DBCLASS_PROXY,"incoming request from %s@%s from outbound",
request->from->url->username,
request->from->url->host);
break;
@@ -108,12 +108,12 @@ int proxy_request (sip_t *request) {
/*
* from an external host to the internal masqueraded host
*/
case REQTYP_INCOMMING:
case REQTYP_INCOMING:
/* rewrite request URI to point to the real host */
/* i still holds the valid index into the URLMAP table */
/* THIS IS UGLY!!! I dont like it */
DEBUGC(DBCLASS_PROXY,"rewriting incomming Request URI");
DEBUGC(DBCLASS_PROXY,"rewriting incoming Request URI");
url=msg_geturi(request);
free(url->host);url->host=NULL;
{
@@ -198,10 +198,13 @@ int proxy_request (sip_t *request) {
break;
default:
url=msg_geturi(request);
DEBUGC(DBCLASS_PROXY,"proxy_request: refused to proxy");
WARN("request from/to unregistered UA (%s@%s)",
WARN("request from/to unregistered UA (RQ: %s@%s -> %s@%s)",
request->from->url->username,
request->from->url->host);
request->from->url->host,
url->username,
url->host);
/* some clients seem to run amok when passing back a negative response
* so we simply drop the request silently
*/
@@ -279,7 +282,7 @@ int proxy_response (sip_t *response) {
int port;
char *buffer;
#define RESTYP_INCOMMING 1
#define RESTYP_INCOMING 1
#define RESTYP_OUTGOING 2
DEBUGC(DBCLASS_PROXY,"proxy_response");
@@ -299,7 +302,7 @@ int proxy_response (sip_t *response) {
return STS_FAILURE;
}
/* figure out if this is an request comming from the outside
/* figure out if this is an request coming from the outside
* world to one of our registered clients
*/
@@ -315,10 +318,10 @@ int proxy_response (sip_t *response) {
if (urlmap[i].active == 0) continue;
/* incomming response ('from' == 'masq') */
/* incoming response ('from' == 'masq') */
if (compare_url(response->from->url, urlmap[i].masq_url)==STS_SUCCESS) {
type=RESTYP_INCOMMING;
DEBUGC(DBCLASS_PROXY,"incomming response for %s@%s from outbound",
type=RESTYP_INCOMING;
DEBUGC(DBCLASS_PROXY,"incoming response for %s@%s from outbound",
response->from->url->username,
response->from->url->host);
break;
@@ -341,7 +344,7 @@ int proxy_response (sip_t *response) {
/*
* from an external host to the internal masqueraded host
*/
case RESTYP_INCOMMING:
case RESTYP_INCOMING:
break;
/*
@@ -614,7 +617,7 @@ int proxy_rewrite_invitation_body(sip_t *mymsg){
* TODO: redo the rewriting section below,
* using the nice sdp_ routines of libosip!
*
* Up to now, also only ONE incomming media port per session
* Up to now, also only ONE incoming media port per session
* is supported! I guess, there may be more allowed.
*/
{
+4 -2
View File
@@ -82,7 +82,7 @@ int register_client(sip_t *my_msg) {
}
/*
fetch 1st Via entry and remember this address. Incomming requests
fetch 1st Via entry and remember this address. Incoming requests
for the registered address have to be passed on to that host.
To: -> address to be registered
@@ -147,7 +147,9 @@ int register_client(sip_t *my_msg) {
/* entry not existing, create new one */
i=j;
DEBUGC(DBCLASS_REG,"create new entry for %s@%s at slot=%i",
url1_contact->username, url1_contact->host, i);
(url1_contact->username) ? url1_contact->username : "*NULL*",
(url1_contact->host) ? url1_contact->host : "*NULL*",
i);
/* write entry */
urlmap[i].active=1;
+1 -1
View File
@@ -146,7 +146,7 @@ int main (int argc, char *argv[])
/* initialize the registration facility */
register_init();
/* listen for incomming messages */
/* listen for incoming messages */
sts=sipsock_listen();
if (sts == STS_FAILURE) {
/* failure to allocate SIP socket... */
+6 -5
View File
@@ -47,7 +47,7 @@ extern struct siproxd_config configuration;
static int listen_socket=0;
/*
* binds to SIP UDP socket for listening to incomming packets
* binds to SIP UDP socket for listening to incoming packets
*
* RETURNS
* STS_SUCCESS on success
@@ -65,7 +65,7 @@ int sipsock_listen (void) {
}
/*
* Wait for incomming SIP message. After a 5 sec timeout
* Wait for incoming SIP message. After a 5 sec timeout
* this function returns with sts=0
*
* RETURNS >0 if data received, =0 if nothing received /T/O), -1 on error
@@ -99,7 +99,8 @@ int sipsock_read(void *buf, size_t bufsize, struct sockaddr_in *from) {
count=recvfrom(listen_socket, buf, bufsize, 0,
(struct sockaddr *)from, &fromlen);
DEBUGC(DBCLASS_NET,"received UDP packet, count=%i", count);
DEBUGC(DBCLASS_NET,"received UDP packet from %s, count=%i",
inet_ntoa(from->sin_addr), count);
DUMP_BUFFER(DBCLASS_NETTRAF, buf, count);
return count;
@@ -134,7 +135,7 @@ int sipsock_send_udp(int *sock, struct in_addr addr, int port,
if (allowdump) {
DEBUGC(DBCLASS_NET,"send UDP packet to %s:%i",
DEBUGC(DBCLASS_NET,"send UDP packet to %s: %i",
inet_ntoa(addr),port);
DUMP_BUFFER(DBCLASS_NETTRAF, buffer, size);
}
@@ -144,7 +145,7 @@ int sipsock_send_udp(int *sock, struct in_addr addr, int port,
if (sts == -1) {
if (errno != ECONNREFUSED) {
ERROR("sendto() call failed:%s",strerror(errno));
ERROR("sendto() call failed: %s",strerror(errno));
return STS_FAILURE;
}
DEBUGC(DBCLASS_BABBLE,"sendto() call failed:%s",strerror(errno));
+7 -2
View File
@@ -303,18 +303,22 @@ int get_ip_by_host(char *hostname, struct in_addr *addr) {
int compare_url(url_t *url1, url_t *url2) {
int sts;
/* sanity checks */
if ((url1 == NULL) || (url2 == NULL)) {
ERROR("compare_url: NULL ptr: url1=0x%p, url2=0x%p",url1, url2);
return STS_FAILURE;
}
/* sanity checks: host part is a MUST */
if ((url1->host == NULL) || (url2->host == NULL)) {
ERROR("compare_url: NULL ptr: url1->host=0x%p, url2->host=0x%p",
url1->host, url2->host);
return STS_FAILURE;
}
/* Broken(?) MSN messenger - does not supply a user name part.
So we simply compare the host part then */
if ((url1->username == NULL) || (url2->username == NULL)) {
/* Broken(?) MSN messenger - does not supply a user name part.
So we simply compare the host part then */
WARN("compare_url: NULL username pointer: MSN messenger is known to "
"trigger this one! [url1->username=0x%p, url2->username=0x%p]",
url1->username, url2->username);
@@ -325,6 +329,7 @@ int compare_url(url_t *url1, url_t *url2) {
} else {
sts = STS_FAILURE;
}
return sts;
}
/* we have a proper URL */