- use even port numbers for RTP traffic

- some minor fixes
This commit is contained in:
Thomas Ries 2003-12-15 17:31:59 +00:00
parent acbdb707ec
commit c88a45dd20
9 changed files with 43 additions and 20 deletions

View File

@ -1,6 +1,7 @@
0.5.1
=====
05-Dec-2003: - some changes & enhancements inspired by Cris Ross:
15-Dec-2003: - use even port numbers for RTP traffic
05-Dec-2003: - some changes & enhancements inspired by Chris Ross:
* 183 Trying *may* contain SDP data
* compare_url: now does compare the scheme,
if a host is not resolveable hostnames will be

10
README
View File

@ -108,16 +108,6 @@ 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 incoming RTP data
streams. The config parameters 'rtp_port_low' and rtp_port_high' define
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.
** RTP data stream proxying is still experimental code.
** As I had not yet the possibility to test this feature extensively,
** I'm happy about any feedback.
Scenario

17
doc/FAQ
View File

@ -180,14 +180,14 @@ A: Simple. In the config file set the configuration option
---------------------------------------------------------------------------
Q: How do I use siproxd as a pure outbound proxy, so I can register with my
SIP phone at a thired party registrar?
SIP phone at a third party registrar?
A: Also Simple. Just configure your SIP phone to use siproxd as outbound
proxy and your 3rd party registrar as registrar. Siproxd will then
transparently handle (and if needed rewrite) the SIP traffic.
---------------------------------------------------------------------------
Q: I have a Gradstream Budgetone-100 SIP phone. The SIP communication
Q: I have a Grandstream Budgetone-100 SIP phone. The SIP communication
seems to work properly (I can register, make and receive calls) but
I do not hear any audio. However, transmitting audio works.
@ -197,7 +197,7 @@ A: It has been observed that these SIP phone seems to be delicate there.
the phone and make sure the 'Use random port' option is enabled.
---------------------------------------------------------------------------
Q: I use Linux (kernel 2.4.x) and use ipchains. However, siproxd
Q: I use Linux (kernel 2.4.x) with ipchains. However, siproxd
always complains "ERROR:IPCHAINS support not built in", why?
A: Siproxd IPCHAIN support works only with kernels 2.2.x. The
@ -205,6 +205,17 @@ A: Siproxd IPCHAIN support works only with kernels 2.2.x. The
that allow user space programs to control masquerading tunnels.
You must use the RTP relay or IPTABLES based masquerading.
---------------------------------------------------------------------------
Q: I have two local UA (SIP phones) connected to siproxd. I can
make outgoing calls and receive incoming calls to some other
SIP phones in the internet. However, making a call between the
two locally connected does not succeed, why?
A: That is not a bug but a known limitation of siproxd. Currently it
can only manage calls from the local (inbound) network to the
outside world (outbound network) and vice versa. Making calls
locally is not supported.
---------------------------------------------------------------------------
yet unstructured:

View File

@ -631,7 +631,7 @@ if (configuration.debuglevel)
} // port > 0
} else {
/* no port defined - skip entry */
WARN("no port defined in m=(media) stream_no=&i", media_stream_no);
WARN("no port defined in m=(media) stream_no=%i", media_stream_no);
continue;
}
}

View File

@ -100,6 +100,26 @@ int read_config(char *name, int search) {
sts = parse_config(configfile);
fclose(configfile);
/*
* Post-process configuration variables that have conditions that
* must be met; warn if we have to adjust any.
*/
if (configuration.rtp_port_low & 0x01) {
/* rtp_port_low must be an even number... */
configuration.rtp_port_low = (configuration.rtp_port_low + 1) & ~0x01;
WARN("rtp_port_low should be an even number; it's been rounded up to %i",
configuration.rtp_port_low);
}
if (configuration.rtp_port_high & 0x01) {
/* rtp_high_port should be either the top RTP port allowed, */
/* or the top RTCP port allowed. If the latter, then reset */
/* to the former... Don't need a warning here. It's okay. */
configuration.rtp_port_high = configuration.rtp_port_high & ~0x01;
DEBUGC(DBCLASS_CONFIG, "rounded rtp_port_high down to %i",
configuration.rtp_port_high);
}
return sts;
}

View File

@ -82,7 +82,7 @@ void register_init(void) {
if (strchr(buff, 10)) *strchr(buff, 10)='\0';\
if (strchr(buff, 13)) *strchr(buff, 13)='\0';\
if (strlen(buff) > 0) {\
size = strnlen(buff, sizeof(buff));\
size = strlen(buff);\
X =(char*)malloc(size);\
sts=sscanf(buff,"%s",X);\
} else {\

View File

@ -198,9 +198,10 @@ int rtp_masq_start_fwd(osip_call_id_t *callid, int media_stream_no,
/*
* do loop over the range of available ports (7070-...) until able to
* allocate a UDP tunnel. If not successful - Buh! return port=0
* allocate a UDP tunnel with an even port number. If none can be found
* available - Buh! return port=0
*/
for (i=configuration.rtp_port_low; i<=configuration.rtp_port_high; i++) {
for (i=configuration.rtp_port_low; i<=configuration.rtp_port_high; i+=2) {
/* check if this port is already allocated in another stream.
* IPCHAINS will print errors in SYSLOG when I try to use
* the same port twice (IF it is still 'open' - no DST address

View File

@ -327,7 +327,7 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, int media_stream_no,
/* find a local outbound port number to use and bind to it*/
sock=0;
port=0;
for (i=configuration.rtp_port_low; i<=configuration.rtp_port_high; i++) {
for (i=configuration.rtp_port_low; i<=configuration.rtp_port_high; i+=2) {
for (j=0; j<RTPPROXY_SIZE; j++) {
/* outbound port already in use */
if ((memcmp(&rtp_proxytable[j].outbound_ipaddr,

View File

@ -288,7 +288,7 @@ int compare_url(osip_uri_t *url1, osip_uri_t *url2) {
}
} else {
/* compare hostname strings case INsensitive */
if (osip_strcasecmp(url1->host, url2->host) != 0) {
if (strcasecmp(url1->host, url2->host) != 0) {
DEBUGC(DBCLASS_PROXY, "compare_url: host name mismatch");
return STS_FAILURE;
}