- RTP timeout handling: allow unidirectional data w/o

terminating connection after timeout.
This commit is contained in:
Thomas Ries 2006-06-11 20:29:34 +00:00
parent 0cf87f48ee
commit a155e32d27
3 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,7 @@
0.5.13
======
11-Jun-2006: - RTP timeout handling: allow unidirectional data w/o
terminating connection after timeout.
20-May-2006: - Fixed compiling issue when building on MacOS (Georg Schwarz)
- A number of correction in debugging code (James Henstridge)
26-Apr-2006: - REGISTER response generated from siproxd includes

View File

@ -24,18 +24,19 @@
#define CALLIDHOST_SIZE 128
#define CLIENT_ID_SIZE 128
typedef struct {
int rtp_rx_sock; /* rx socket (0 -> free slot)*/
int rtp_tx_sock; /* tx socket */
char callid_number[CALLIDNUM_SIZE]; /* call ID */
char callid_host[CALLIDHOST_SIZE]; /* --"-- */
int rtp_rx_sock; /* rx socket (0 -> free slot)*/
int rtp_tx_sock; /* tx socket */
char callid_number[CALLIDNUM_SIZE]; /* call ID */
char callid_host[CALLIDHOST_SIZE]; /* --"-- */
char client_id[CLIENT_ID_SIZE];
int direction; /* Direction of RTP stream */
int media_stream_no;
struct in_addr local_ipaddr; /* local IP */
int local_port; /* local allocated port */
struct in_addr remote_ipaddr; /* remote IP */
int remote_port; /* remote port */
time_t timestamp; /* last 'stream alive' TS */
int direction; /* Direction of RTP stream */
int media_stream_no;
struct in_addr local_ipaddr; /* local IP */
int local_port; /* local allocated port */
struct in_addr remote_ipaddr; /* remote IP */
int remote_port; /* remote port */
time_t timestamp; /* last 'stream alive' TS */
int opposite_entry; /* 1 based!! index of opposite entry */
} rtp_proxytable_t;
/*

View File

@ -299,6 +299,7 @@ static void *rtpproxy_main(void *arg) {
(rtp_direction != rtp_proxytable[j].direction) &&
(strcmp(rtp_proxytable[j].client_id, client_id) != 0) ) {
rtp_proxytable[i].rtp_tx_sock = rtp_proxytable[j].rtp_rx_sock;
rtp_proxytable[i].opposite_entry=j+1;
DEBUGC(DBCLASS_RTP, "connected entry %i (fd=%i) <-> entry %i (fd=%i)",
j, rtp_proxytable[j].rtp_rx_sock,
i, rtp_proxytable[i].rtp_rx_sock);
@ -340,8 +341,13 @@ static void *rtpproxy_main(void *arg) {
}
} /* count > 0 */
/* update timestamp of last usage */
/* update timestamp of last usage for both (RX and TX) entries.
* This allows silence (no data) on one stream without breaking
* the connection after the RTP timeout */
rtp_proxytable[i].timestamp=t;
if (rtp_proxytable[i].opposite_entry > 0) {
rtp_proxytable[rtp_proxytable[i].opposite_entry-1].timestamp=t;
}
}
} /* for i */