diff --git a/ChangeLog b/ChangeLog index cddda7f..0044d6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 0.6.0 ===== + 07-May-2007: - Client-ID in RTP proxy is derived from Client IP address. + This should fix an issue with unexpectedly timing-out RTP + streams (actually too many RTP streams get started). 21-Apr-2007: - Hack to deal with Asterisks broken Alert-Info headers (Asterisk does include Alert-Info header without '<>') 19-Feb-2007: - Increased RTP buffer size diff --git a/src/proxy.c b/src/proxy.c index 2b0926e..964a6a8 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1004,10 +1004,26 @@ if (configuration.debuglevel) if (sdp_message_m_port_get(sdp, media_stream_no)) { msg_port=atoi(sdp_message_m_port_get(sdp, media_stream_no)); if ((msg_port > 0) && (msg_port <= 65535)) { + char *client_id=NULL; + static char from_string[HOSTNAME_SIZE]; + char *tmp=NULL; + char *protocol=NULL; - /* is this an RTP stream ? */ - { - char *protocol = sdp_message_m_proto_get (sdp, media_stream_no); + /* try to get some additional UA specific unique ID. + * This Client-ID should be guaranteed persistent + * and not depend on if a UA/Server does include a + * particular Header (Contact) or not. + * I should just go for the remote IP address here, no? + */ + tmp=utils_inet_ntoa(ticket->from.sin_addr); + strncpy(from_string, tmp, HOSTNAME_SIZE); + from_string[HOSTNAME_SIZE-1]='\0'; + client_id=from_string; + + /* + * is this an RTP stream ? If yes, set 'isrtp=1' + */ + protocol = sdp_message_m_proto_get (sdp, media_stream_no); if (protocol == NULL) { DEBUGC(DBCLASS_PROXY, "no protocol definition found!"); } else { @@ -1024,32 +1040,6 @@ if (configuration.debuglevel) DEBUGC(DBCLASS_PROXY, "found non RTP protocol [%s]!", protocol); } } - } - - osip_uri_t *cont_url = NULL; - char *client_id=NULL; - /* try to get some additional UA specific unique ID. - * Try: - * 1) User part of Contact header - * 2) Host part of Contact header (will be different - * between internal UA and external UA) - * 3) IP address of sender (also different between - * internal and external UA) - */ - if (!osip_list_eol(mymsg->contacts, 0)) - cont_url = ((osip_contact_t*)(mymsg->contacts->node->element))->url; - if (cont_url) { - client_id=cont_url->username; - if (client_id == NULL) client_id=cont_url->host; - } - if (client_id == NULL) { - static char from_string[HOSTNAME_SIZE]; - char *tmp; - tmp=utils_inet_ntoa(ticket->from.sin_addr); - strncpy(from_string, tmp, HOSTNAME_SIZE); - from_string[HOSTNAME_SIZE-1]='\0'; - client_id=from_string; - } /* * do we have a 'c=' item on media level? diff --git a/src/rtpproxy_relay.c b/src/rtpproxy_relay.c index 104f349..4de9981 100644 --- a/src/rtpproxy_relay.c +++ b/src/rtpproxy_relay.c @@ -841,7 +841,7 @@ int rtp_relay_stop_fwd (osip_call_id_t *callid, strerror(errno), nolock, callid->number, callid->host); } - /* call to firewall API */ + /* call to firewall API (RTP port) */ fwapi_stop_rtp(rtp_proxytable[i].direction, rtp_proxytable[i].local_ipaddr, rtp_proxytable[i].local_port, @@ -857,7 +857,7 @@ int rtp_relay_stop_fwd (osip_call_id_t *callid, strerror(errno), nolock, callid->number, callid->host); } - /* call to firewall API */ + /* call to firewall API (RTCP port) */ fwapi_stop_rtp(rtp_proxytable[i].direction, rtp_proxytable[i].local_ipaddr, rtp_proxytable[i].local_port + 1,