- Make local UA to local UA calls work better with UAs that

blindly practice symmetric RTP and ignore the SDP media
   description completely (did anyone shout X-Lite?)
   Mantis 117
This commit is contained in:
Thomas Ries
2009-10-27 20:43:05 +00:00
parent 01b9a7ae9d
commit a83cffe287
6 changed files with 36 additions and 22 deletions
+3
View File
@@ -1,5 +1,8 @@
0.7.3
=====
27-Oct-2009: - Make local UA to local UA calls work better with UAs that
blindly practice symmetric RTP and ignore the SDP media
description completely (did anyone shout X-Lite?)
0.7.2
=====
+14 -6
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2002-2008 Thomas Ries <tries@gmx.net>
Copyright (C) 2002-2009 Thomas Ries <tries@gmx.net>
This file is part of Siproxd.
@@ -779,6 +779,7 @@ int proxy_rewrite_invitation_body(sip_ticket_t *ticket, int direction){
sdp_connection_t *sdp_conn;
sdp_media_t *sdp_med;
int rtp_direction=0;
int call_direction=0;
int have_c_media=0;
int isrtp = 0 ;
@@ -850,18 +851,22 @@ if (configuration.debuglevel)
if (MSG_IS_REQUEST(mymsg)) {
if (direction == DIR_INCOMING) {
memcpy(&map_addr, &inside_addr, sizeof (map_addr));
rtp_direction = DIR_OUTGOING;
rtp_direction = DIR_OUTGOING;
call_direction = DIR_INCOMING;
} else {
memcpy(&map_addr, &outside_addr, sizeof (map_addr));
rtp_direction = DIR_INCOMING;
rtp_direction = DIR_INCOMING;
call_direction = DIR_OUTGOING;
}
} else /* MSG_IS_REPONSE(mymsg) */ {
if (direction == DIR_INCOMING) {
memcpy(&map_addr, &inside_addr, sizeof (map_addr));
rtp_direction = DIR_OUTGOING;
rtp_direction = DIR_OUTGOING;
call_direction = DIR_OUTGOING;
} else {
memcpy(&map_addr, &outside_addr, sizeof (map_addr));
rtp_direction = DIR_INCOMING;
rtp_direction = DIR_INCOMING;
call_direction = DIR_INCOMING;
}
}
@@ -1104,9 +1109,12 @@ if (configuration.debuglevel)
}
}
/*
* Start the RTP stream
*/
sts = rtp_start_fwd(osip_message_get_call_id(mymsg),
client_id,
rtp_direction,
rtp_direction, call_direction,
media_stream_no,
map_addr, &map_port,
addr_media, msg_port,
+3 -3
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2003-2008 Thomas Ries <tries@gmx.net>
Copyright (C) 2003-2009 Thomas Ries <tries@gmx.net>
This file is part of Siproxd.
@@ -73,7 +73,7 @@ int rtpproxy_init( void ) {
* STS_FAILURE on error
*/
int rtp_start_fwd (osip_call_id_t *callid, client_id_t client_id,
int direction, int media_stream_no,
int direction, int call_direction, int media_stream_no,
struct in_addr local_ipaddr, int *local_port,
struct in_addr remote_ipaddr, int remote_port,
int isrtp) {
@@ -91,7 +91,7 @@ int rtp_start_fwd (osip_call_id_t *callid, client_id_t client_id,
}
}
sts = rtp_relay_start_fwd (callid, client_id,
direction, media_stream_no,
direction, call_direction, media_stream_no,
local_ipaddr, local_port,
remote_ipaddr, remote_port, dejitter);
} else {
+3 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2003-2008 Thomas Ries <tries@gmx.net>
Copyright (C) 2003-2009 Thomas Ries <tries@gmx.net>
This file is part of Siproxd.
@@ -50,6 +50,7 @@ typedef struct {
char callid_host[CALLIDHOST_SIZE]; /* --"-- */
client_id_t client_id;
int direction; /* Direction of RTP stream */
int call_direction; /* Direction of Call DIR_x */
int media_stream_no;
timecontrol_t tc; /* de-jitter feature */
struct in_addr local_ipaddr; /* local IP */
@@ -65,7 +66,7 @@ typedef struct {
*/
int rtp_relay_init(void);
int rtp_relay_start_fwd (osip_call_id_t *callid, client_id_t client_id,
int rtp_direction, int media_stream_no,
int rtp_direction, int call_direction, int media_stream_no,
struct in_addr local_ipaddr, int *local_port,
struct in_addr remote_ipaddr, int remote_port,
int dejitter);
+11 -9
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2003-2008 Thomas Ries <tries@gmx.net>
Copyright (C) 2003-2009 Thomas Ries <tries@gmx.net>
This file is part of Siproxd.
@@ -487,7 +487,7 @@ static void *rtpproxy_main(void *arg) {
* STS_FAILURE on error
*/
int rtp_relay_start_fwd (osip_call_id_t *callid, client_id_t client_id,
int rtp_direction,
int rtp_direction, int call_direction,
int media_stream_no, struct in_addr local_ipaddr,
int *local_port, struct in_addr remote_ipaddr,
int remote_port, int dejitter) {
@@ -526,9 +526,10 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, client_id_t client_id,
}
DEBUGC(DBCLASS_RTP,"rtp_relay_start_fwd: starting RTP proxy "
"stream for: CallID=%s@%s [Client-ID=%s] (%s) #=%i",
"stream for: CallID=%s@%s [Client-ID=%s] (%s,%s) #=%i",
callid->number, callid->host, client_id.idstring,
((rtp_direction == DIR_INCOMING) ? "incoming RTP" : "outgoing RTP"),
((call_direction == DIR_INCOMING) ? "incoming Call" : "outgoing Call"),
media_stream_no);
/* lock mutex */
@@ -1004,13 +1005,14 @@ static void rtpproxy_kill( void ) {
/*
* match_socket
* matches and cross connects two rtp_proxytable entries
* (corresponds to the two data directions of one RTP stream)
* (corresponds to the two data directions of one RTP stream
* within one call).
*/
static void match_socket (int rtp_proxytable_idx) {
int j;
int rtp_direction = rtp_proxytable[rtp_proxytable_idx].direction;
int call_direction = rtp_proxytable[rtp_proxytable_idx].call_direction;
int media_stream_no = rtp_proxytable[rtp_proxytable_idx].media_stream_no;
/*chnnel int channel = rtp_proxytable[rtp_proxytable_idx].channel;*/
osip_call_id_t callid;
callid.number = rtp_proxytable[rtp_proxytable_idx].callid_number;
@@ -1028,10 +1030,10 @@ static void match_socket (int rtp_proxytable_idx) {
* - different client ID
*/
if ( (rtp_proxytable[j].rtp_rx_sock != 0) &&
(compare_callid(&callid, &cid) == STS_SUCCESS) &&
(media_stream_no == rtp_proxytable[j].media_stream_no) &&
(rtp_direction != rtp_proxytable[j].direction) /* channel: &&
(channel == rtp_proxytable[j].channel)*/ ) {
(compare_callid(&callid, &cid) == STS_SUCCESS) && // same Call-ID
(call_direction == rtp_proxytable[j].call_direction) && // same Call direction
(media_stream_no == rtp_proxytable[j].media_stream_no) && // same stream
(rtp_direction != rtp_proxytable[j].direction) ) { // opposite RTP dir
char remip1[16], remip2[16];
char lclip1[16], lclip2[16];
+2 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2002-2008 Thomas Ries <tries@gmx.net>
Copyright (C) 2002-2009 Thomas Ries <tries@gmx.net>
This file is part of Siproxd.
@@ -217,7 +217,7 @@ int make_default_config(void); /*X*/
/* rtpproxy.c */
int rtpproxy_init( void ); /*X*/
int rtp_start_fwd (osip_call_id_t *callid, client_id_t client_id, /*X*/
int direction, int media_stream_no,
int direction, int call_direction, int media_stream_no,
struct in_addr outbound_ipaddr, int *outboundport,
struct in_addr lcl_client_ipaddr, int lcl_clientport,
int isrtp);