feature: siproxd "in front of" a NAT router should work
This commit is contained in:
parent
533a1f4c56
commit
8f211d48af
@ -1,5 +1,6 @@
|
||||
0.5.11
|
||||
======
|
||||
27-Mar-2005: - feature: siproxd "in front of" a NAT router should work
|
||||
20-Mar-2005: - when allocating local ports for RTP relaying, do this
|
||||
in a round-robin way over the available port range.
|
||||
1-Mar-2005: - working on running siproxd in front of a routing device
|
||||
|
||||
38
src/proxy.c
38
src/proxy.c
@ -671,8 +671,8 @@ int proxy_response (sip_ticket_t *ticket) {
|
||||
(e.g 1393xxx@proxy01.sipphone.com for calls made sipphone -> FWD)
|
||||
How can we deal with this? Should I take into consideration the 'Via'
|
||||
headers? This is the only clue I have, pointing to the *real* UA.
|
||||
Maybe I should put in a 'siproxd' ftag value to recognize it a header
|
||||
put in by myself
|
||||
Maybe I should put in a 'siproxd' ftag value to recognize it as a header
|
||||
inserted by myself
|
||||
*/
|
||||
if ((type == 0) && (!osip_list_eol(response->vias, 0))) {
|
||||
osip_via_t *via;
|
||||
@ -1084,7 +1084,6 @@ if (configuration.debuglevel)
|
||||
* Rewrite
|
||||
* an IP address of 0.0.0.0 means *MUTE*, don't rewrite such
|
||||
*/
|
||||
/*&&&& should use gethostbyname here */
|
||||
if (strcmp(sdp->c_connection->c_addr, "0.0.0.0") != 0) {
|
||||
osip_free(sdp->c_connection->c_addr);
|
||||
sdp->c_connection->c_addr=osip_malloc(HOSTNAME_SIZE);
|
||||
@ -1129,7 +1128,6 @@ if (configuration.debuglevel)
|
||||
have_c_media=0;
|
||||
sdp_conn=sdp_message_connection_get(sdp, media_stream_no, 0);
|
||||
if (sdp_conn && sdp_conn->c_addr) {
|
||||
/*&&&& should use gethostbyname here as well */
|
||||
if (strcmp(sdp_conn->c_addr, "0.0.0.0") != 0) {
|
||||
sts = get_ip_by_host(sdp_conn->c_addr, &addr_media);
|
||||
have_c_media=1;
|
||||
@ -1173,26 +1171,18 @@ if (configuration.debuglevel)
|
||||
memcpy(&addr_media, &addr_sess, sizeof(addr_sess));
|
||||
}
|
||||
|
||||
/*&&&& If I'm sitting BEFORE the actual masquerading router:
|
||||
ok: I _must_ _not_ _try_ _to_ _use_ _my_ _outbound_ _address_ (map_addr)
|
||||
but my inbound address instead. Also make sure that the port
|
||||
seems ok: assignment does not get fucked up.
|
||||
todo: RPORT option must be removed.
|
||||
seens ok: Possibly a new RTP_DIRECTION value is needed ("no double assignments
|
||||
of same port on different IPs" or something similar)??
|
||||
*/
|
||||
/*
|
||||
* I am running in front of the routing device. I cannot use the
|
||||
* external IP to bind a listen socket to, so force the use of
|
||||
* my inbound IP for listening
|
||||
*/
|
||||
if ((rtp_direction == DIR_INCOMING) &&
|
||||
(configuration.outbound_host) &&
|
||||
(strcmp(configuration.outbound_host, "")!=0)) {
|
||||
/*&&&&*/
|
||||
INFO("**** Front-Routing Hack ****");
|
||||
memcpy(&map_addr, &inside_addr, sizeof (map_addr));
|
||||
}
|
||||
/*
|
||||
* Am I running in front of the routing device? Then I cannot
|
||||
* use the external IP to bind a listen socket to, so force
|
||||
* the use of my inbound IP for listening.
|
||||
*/
|
||||
if ((rtp_direction == DIR_INCOMING) &&
|
||||
(configuration.outbound_host) &&
|
||||
(strcmp(configuration.outbound_host, "")!=0)) {
|
||||
DEBUGC(DBCLASS_PROXY, "proxy_rewrite_invitation_body: "
|
||||
"in-front-of-NAT-Router");
|
||||
memcpy(&map_addr, &inside_addr, sizeof (map_addr));
|
||||
}
|
||||
|
||||
sts = rtp_start_fwd(osip_message_get_call_id(mymsg),
|
||||
client_id,
|
||||
|
||||
@ -219,7 +219,7 @@ static void *rtpproxy_main(void *arg) {
|
||||
* and hope that next time we pass by it will be ok again.
|
||||
*/
|
||||
if (errno == EAGAIN) {
|
||||
/*&&&& I may want to remove this WARNing */
|
||||
/* I may want to remove this WARNing */
|
||||
WARN("read() [fd=%i, %s:%i] would block, but select() "
|
||||
"claimed to be readable!",
|
||||
rtp_proxytable[i].rtp_rx_sock,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user