[asterisk-dev] cisco-check-cfg

Simon Perreault simon.perreault at viagenie.ca
Fri Jul 29 09:55:57 CDT 2011


Kevin P. Fleming wrote, on 07/29/2011 10:40 AM:
> chan_sip can only be bound to a single socket for each of UDP, TCP and TLS
> communications. If the system Asterisk is running on has multiple network
> interfaces (and they all do, since 'loopback' counts as one), and the admin
> wants chan_sip to service all of them, then they must bind to the wildcard
> address (all zeroes).
> 
> When a SIP request or response is going to be sent to a UA, Asterisk needs to
> know the proper IP address to include that message so that the other UA can
> respond. This can only be "guessed" based on the other UA's address and the
> system's routing table. As you say, this is a hack, but we need *something*.

Yes. So far I'm following you, and you're describing what ast_sip_ouraddrfor() does.

> Even if chan_sip had a separate socket bound to each IP address present on the
> system, this would not solve the problem of having to determine the 'response'
> IP address that should be included in a SIP request being sent to a UA that
> didn't register with Asterisk (or hasn't otherwise been communicating with it).

Agreed. The right architecture is to have one connect()'ed socket for each UDP
flow, as TCP does.

> This is a fundamental problem with SIP itself; the protocol messages contain IP
> addresses (they can also be domain names, but that's less common) used to route
> responses, and so we must have some way to determine which address we should
> include in the messages.

Now I'm not sure what problem in SIP you're referring to. SIP is
interface-agnostic. We have IP addresses, hosts, and routing tables, but
interfaces should not be important.

But most importantly, I don't see the link between this discussion and the
original problem. The problem was that a Contact header with ::1 was sent on a
non-loopback interface. Without having investigated, I would guess that this was
a side effect of a specific bug and does not indicate that we need a generic
method of ensuring ::1 does not get sent on non-loopback interfaces. As the
original poster indicated that the bindaddr was not set, maybe all we need is an
error message in that case.

Simon
-- 
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca



More information about the asterisk-dev mailing list