- deal with locally running UAs on same host (inboud IF side)

This commit is contained in:
Thomas Ries 2007-05-13 10:49:39 +00:00
parent 9fdd8ca626
commit ba59277adb
2 changed files with 22 additions and 3 deletions

View File

@ -1,5 +1,6 @@
0.6.0
=====
13-May-2007: - deal with locally running UAs on same host (inboud IF side)
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).

View File

@ -945,6 +945,7 @@ int sip_find_direction(sip_ticket_t *ticket, int *urlidx) {
struct sockaddr_in *from;
osip_message_t *request;
osip_message_t *response;
struct in_addr tmp_addr;
from=&ticket->from;
request=ticket->sipmsg;
@ -958,8 +959,6 @@ int sip_find_direction(sip_ticket_t *ticket, int *urlidx) {
* -> it must be an OUTGOING request
*/
for (i=0; i<URLMAP_SIZE; i++) {
struct in_addr tmp_addr;
if (urlmap[i].active == 0) continue;
if (get_ip_by_host(urlmap[i].true_url->host, &tmp_addr) == STS_FAILURE) {
DEBUGC(DBCLASS_SIP, "sip_find_direction: cannot resolve host [%s]",
@ -1026,7 +1025,6 @@ int sip_find_direction(sip_ticket_t *ticket, int *urlidx) {
} /* for i */
} /* if type == 0 */
if (MSG_IS_RESPONSE(ticket->sipmsg)) {
/* &&&& Open Issue &&&&
it has been seen with cross-provider calls that the FROM may be 'garbled'
@ -1085,6 +1083,26 @@ int sip_find_direction(sip_ticket_t *ticket, int *urlidx) {
} /* if type == 0 */
} /* is response */
/*
* if the telegram is received from 127.0.0.1 of my inbound IP as sender,
* this likely is a locally REDIRECTED/DNATed (by iptables) packet.
* So it is a local UA.
* Example Scenario:
* Softphone(or PBX) running on the same host as siproxd is running.
* Using iptables, you do a REDIRECT of outgoping SIP traffix of the
* PBX to be passed to siproxd.
*/
sts=get_interface_ip(IF_INBOUND, &tmp_addr);
if ((htonl(from->sin_addr.s_addr) == INADDR_LOOPBACK) ||
(from->sin_addr.s_addr == tmp_addr.s_addr)) {
if (MSG_IS_REQUEST(ticket->sipmsg)) {
type=REQTYP_OUTGOING;
} else {
type=RESTYP_OUTGOING;
}
}
if (type == 0) {
DEBUGC(DBCLASS_SIP, "sip_find_direction: unable to determine "
"direction of SIP packet");