diff --git a/ChangeLog b/ChangeLog index 765c121..7e8b6b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 0.6.0 ===== + 22-Jun-2007: - fixed an error in "my via"detection when using the + "host_outbound" config directive 08-Jun-2007: - Some cleanup in dejitter code 29-May-2007: - Deal with PRACK requests (RFC3262) 25-May-2007: - Just discovered some patches originating from Debian diff --git a/src/sip_utils.c b/src/sip_utils.c index 38eab0a..f84ab01 100644 --- a/src/sip_utils.c +++ b/src/sip_utils.c @@ -177,7 +177,8 @@ int check_vialoop (sip_ticket_t *ticket) { /* * check if a given osip_via_t is local. I.e. its address is owned - * by my inbound or outbound interface + * by my inbound or outbound interface (or externally defined using + * teh host_outbound directive * * RETURNS * STS_TRUE if the given VIA is one of my interfaces @@ -205,25 +206,33 @@ int is_via_local (osip_via_t *via) { } } + if (via->port) { + port=atoi(via->port); + if ((port<=0) || (port>65535)) port=SIP_PORT; + } else { + port=SIP_PORT; + } + found=0; - for (i=0; i<2; i++) { - /* - * search my in/outbound interfaces - */ - DEBUGC(DBCLASS_BABBLE,"resolving IP of interface %s", - (i==IF_INBOUND)? "inbound":"outbound"); - if (get_interface_ip(i, &addr_myself) != STS_SUCCESS) { - continue; + for (i=0; i<3; i++) { + if (i < 2) { + /* search my in/outbound interfaces */ + DEBUGC(DBCLASS_BABBLE,"resolving IP of interface %s", + (i==IF_INBOUND)? "inbound":"outbound"); + if (get_interface_ip(i, &addr_myself) != STS_SUCCESS) { + continue; + } + } else { + /* check againt a possible defined 'host_outbound' */ + DEBUGC(DBCLASS_BABBLE,"resolving IP of interface ''host_outbound'"); + /* defined? */ + if (configuration.outbound_host == NULL) continue; + /* lookup */ + if (get_ip_by_host(configuration.outbound_host, + &addr_myself) != STS_SUCCESS) continue; } /* check the extracted VIA against my own host addresses */ - if (via->port) { - port=atoi(via->port); - if ((port<=0) || (port>65535)) port=SIP_PORT; - } else { - port=SIP_PORT; - } - if ( (memcmp(&addr_myself, &addr_via, sizeof(addr_myself))==0) && (port == configuration.sip_listen_port) ) { DEBUG("got address match [%s]", utils_inet_ntoa(addr_via));