From 1b15340452267e1d04fd00849312c1d9fa15acd4 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Mon, 24 Jan 2005 19:12:49 +0000 Subject: [PATCH] - fix: Re-Invites may change remote IP address as well --- ChangeLog | 5 +++-- src/rtpproxy_relay.c | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b6b23b..1437658 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ 0.5.10 ====== - 08-Jan-2005: - include ./autogen.sh into distribution + 24-Jan-2005: - fix: Re-Invites may change remote IP address as well + 08-Jan-2005: - include ./autogen.sh into distribution - fix: FreeBSD - libgnugetopt is optional library - feature: build support for Cygwin (by Mathias Wohlfarth) - 01-Jan-2005: - fix: doc/Makefile.am, install part (by David Taylor) + 01-Jan-2005: - fix: doc/Makefile.am, install part (by David Taylor) 30-Dec-2004: - feature: remote TCP logging facility 29-Dec-2004: - feature: Outbound proxies configurable per domain 08-Dec-2004: - make install will set siproxd_passwd.cfg to -rw----- diff --git a/src/rtpproxy_relay.c b/src/rtpproxy_relay.c index 836b49b..8316ac0 100644 --- a/src/rtpproxy_relay.c +++ b/src/rtpproxy_relay.c @@ -467,16 +467,29 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, char *client_id, * The RTP port number reported by the UA MAY change * for a given media stream * (seen with KPhone during HOLD/unHOLD) + * Also the destination IP may change during a re-Invite + * (seen with Sipphone.com, re-Invites when using + * the SIP - POTS gateway [SIP Minutes] */ + /* Port number */ if (rtp_proxytable[i].remote_port != remote_port) { DEBUGC(DBCLASS_RTP,"RTP port number changed %i -> %i", rtp_proxytable[i].remote_port, remote_port); rtp_proxytable[i].remote_port = remote_port; } + /* IP address */ + if (memcmp(&rtp_proxytable[i].remote_ipaddr, &remote_ipaddr, + sizeof(remote_ipaddr))) { + DEBUGC(DBCLASS_RTP,"RTP IP address changed to %s", + utils_inet_ntoa(remote_ipaddr)); + memcpy (&rtp_proxytable[i].remote_ipaddr, &remote_ipaddr, + sizeof(remote_ipaddr)); + } /* return the already known local port number */ - DEBUGC(DBCLASS_RTP,"RTP stream already active (raddr=%s, " - "port=%i, id=%s, #=%i)", + DEBUGC(DBCLASS_RTP,"RTP stream already active (remaddr=%s, " + "remport=%i, lclport=%i, id=%s, #=%i)", utils_inet_ntoa(remote_ipaddr), + rtp_proxytable[i].remote_port, rtp_proxytable[i].local_port, rtp_proxytable[i].callid_number, rtp_proxytable[i].media_stream_no);