- "determine next hop" also takes Route header into account
(outgoing packets only, incoming can not have a proxy in between siproxd and the client anyway)
This commit is contained in:
parent
c61033c805
commit
6116f79ecf
@ -1,6 +1,8 @@
|
||||
0.5.7
|
||||
=====
|
||||
27-May-2004: - Route header processing (RFC3261, 16.6, step 6)
|
||||
29-May-2004: - "determine next hop" also takes Route header into account
|
||||
(outgoing packets only, incoming can not have a proxy
|
||||
in between siproxd and the client anyway)
|
||||
25-May-2004: - sip_utils.c:sip_del_myvia check for NULL list
|
||||
24-May-2004: - included doc/sample_* to package
|
||||
23-May-2004: - doc/: added configuration example for X-Lite
|
||||
|
||||
11
RELNOTES
11
RELNOTES
@ -43,11 +43,12 @@ Currently tested on:
|
||||
are not extensively tested by myself.
|
||||
|
||||
Builds on:
|
||||
- Linux (Fedora Core1)
|
||||
- FreeBSD (FreeBSD 4.10-BETA)
|
||||
- OpenBSD (OpenBSD 3.4 GENERIC#18)
|
||||
- SunOS (SunOS 5.9)
|
||||
- Mac OS X (Darwin 6.8)
|
||||
- Linux: Fedora Core1
|
||||
WRT54g (133mhz mipsel router)
|
||||
- FreeBSD: FreeBSD 4.10-BETA
|
||||
- OpenBSD: OpenBSD 3.4 GENERIC#18
|
||||
- SunOS: SunOS 5.9
|
||||
- Mac OS X: Darwin 6.8
|
||||
|
||||
Reported interoperability with softphones:
|
||||
- Grandstream BudgeTone-100 series
|
||||
|
||||
16
doc/FAQ
16
doc/FAQ
@ -259,6 +259,22 @@ A:
|
||||
Media Max Port: 7080 (RTP ports)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Q: If I update both inbound and outbound to
|
||||
if_inbound = ppp0
|
||||
if_outbound = ppp0
|
||||
will this work ?
|
||||
|
||||
A: Very likely this will not work properly. Siproxd does masquerade User
|
||||
Agents hidden behind a NAT firewall (inbound network) so they can access
|
||||
other User Agents located in the public internet (outbound network).
|
||||
Therefore there MUST be 2 networks connected to the host running
|
||||
siproxd:
|
||||
- Inbound network
|
||||
- Outbound network
|
||||
|
||||
If you just want a proxy located in the public IP range you should not
|
||||
use siproxd, but get a real SIP proxy server instead.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
29
src/proxy.c
29
src/proxy.c
@ -513,6 +513,11 @@ int proxy_request (osip_message_t *request, struct sockaddr_in *from) {
|
||||
* into the Request-URI and remove that value from the Route
|
||||
* header field.
|
||||
*/
|
||||
#if 0
|
||||
/* we are not a real proxy - and from the outside we look like an UA.
|
||||
So we should not fiddle around with the Route headers.
|
||||
We should use the first Route header to send the packet to
|
||||
(RFC3261, section 8.1.2) */
|
||||
if (request->routes && !osip_list_eol(request->routes, 0)) {
|
||||
osip_route_t *route=NULL;
|
||||
osip_uri_param_t *param=NULL;
|
||||
@ -543,6 +548,7 @@ int proxy_request (osip_message_t *request, struct sockaddr_in *from) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* RFC 3261, Section 16.6 step 7
|
||||
@ -562,6 +568,29 @@ int proxy_request (osip_message_t *request, struct sockaddr_in *from) {
|
||||
} else {
|
||||
port = SIP_PORT;
|
||||
}
|
||||
} else if ((type == REQTYP_OUTGOING) &&
|
||||
(request->routes && !osip_list_eol(request->routes, 0))) {
|
||||
/* get the destination from the Route Header */
|
||||
osip_route_t *route=NULL;
|
||||
route = (osip_route_t *) osip_list_get(request->routes, 0);
|
||||
if (route==NULL || route->url==NULL || route->url->host==NULL) {
|
||||
DEBUGC(DBCLASS_PROXY, "proxy_request: got broken Route header "
|
||||
"- discarding packet");
|
||||
return STS_FAILURE;
|
||||
}
|
||||
|
||||
sts = get_ip_by_host(route->url->host, &sendto_addr);
|
||||
if (sts == STS_FAILURE) {
|
||||
DEBUGC(DBCLASS_PROXY, "proxy_request: cannot resolve Route URI [%s]",
|
||||
route->url->host);
|
||||
return STS_FAILURE;
|
||||
}
|
||||
|
||||
if (route->url->port) {
|
||||
port=atoi(route->url->port);
|
||||
} else {
|
||||
port=SIP_PORT;
|
||||
}
|
||||
} else {
|
||||
/* get the destination from the SIP URI */
|
||||
sts = get_ip_by_host(url->host, &sendto_addr);
|
||||
|
||||
@ -177,8 +177,12 @@ static int parse_config (FILE *configfile) {
|
||||
/* life insurance */
|
||||
buff[sizeof(buff)-1]='\0';
|
||||
|
||||
/* strip newline if present */
|
||||
if (buff[strlen(buff)-1]=='\n') buff[strlen(buff)-1]='\0';
|
||||
/* strip New line & CR if present */
|
||||
for (i=1; i<=2; i++) {
|
||||
if ((buff[strlen(buff)-i]=='\n') || (buff[strlen(buff)-i]=='\r')) {
|
||||
buff[strlen(buff)-i]='\0';
|
||||
}
|
||||
}
|
||||
|
||||
/* strip emtpy lines */
|
||||
if (strlen(buff) == 0) continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user