IP Address missing in SIP Notify packets


We are using Asterisk along with Freepbx and Endpoint Manager. We have Polycom IP331 phones.

EPM has a feature that allows remote rebooting of the phones via the sending of a SIP Notify packet.

When Asterisk sends the packet, it does not include the IP address of the sending interface of the Asterisk server in the Notify message. Here is an example:
Via: SIP/2.0/UDP [::1]:5060;branch=z9hG4bK1c012ff9;rport

If we go into the SIP Settings and add a Bind address, this corrects the IP address issue on the SIP Notify packet. Doing this however, breaks any environment were the Asterisk server has two or more NIC cards in it for SIP traffic.

Shouldn’t Asterisk stamp the Notify packet with the IP address of the interface that it is sending the packet out on? Is this a bug that should be reported?

Thanks for any information you can give on this.

Bryan Hunt

If the socket is bound to the zero address, it doesn’t know which interface the underlying IP layer is going to use. On the other hand, it shouldn’t be using the IPv6 equivalent of, but that might be a problem in the OS host to address resolution configuration. Binding to a specific address doesn’t actually select an interface.

Except for the special case where a machine is its own NAT router to the public internet, Asterisk expects dual homed systems to be properly dual homed with autonomous system numbers and BGP.

Although I haven’t tried it, if you want to operate an improperly dual homed system, you need to run an instance on each interface (you can, maybe, use IAX, over the loopback, to connect them together).


I’m operating “an improperly dual homed system”? Wow, I didn’t know. Please elaborate on how/why that is the case?

Our Asterisk server communicates on one NIC to the IP phones, the other NIC to the ESBC from our SIP trunk provider. We obviously can’t force a bind address on the notify packets as one or the other SIP connections will break.

The basic issue is, the Polycom phones will not respond to a SIP Notify check-config with that IP address (which looks like an IPV6 localhost). Setting the bind address fixes that issue, but breaks multinic Asterisk environments.

So what is the solution to this?


Bryan Hunt

I just found a link to another forum describing this exact problem with Asterisk and Cisco phones…

comments.gmane.org/gmane.comp.te … evel/47504

Properly multi-homed hosts are reachable via any of their addresses via any of their interfaces. They have autonomous system numbers which allow back bone routers to find them even if the shortest route ends up going through an interface with a different address.

That asterisk-dev mailing list thread (incidentally, you are using a secondary archive - Digium run a primary archive for that list) are a year old, so I would have expected there to be something on issues.asterisk.org, and it may even have been fixed.

However, I am pretty sure that, whilst Asterisk will not in the loop back address, it will only put in one local address. Basically, when it starts, I would expect it to try to discover a single address for the system.

If the destination is not amongst localnets, I would expect it to use externip, etc. Otherwise, I would expect it to use the address it discovered during startup.


This server is fully reachable on both (private) LAN interfaces. No ASN, because these are not public addresses.

The only issue is with the IP address in the SIP payload in the outgoing Notify packets.

From what I gather from the thread I posted, and from other threads on the same topic, Asterisk is putting the correct interface-specific IP address in other SIP traffic packets, so it definitely is able to accomplish this. It just isn’t doing it in this particular case. Which I consider (as do others commenting in these threads) to be a bug.

So my reason for posting here is to ask: is this known issue to Asterisk dev? If not, does it need to be reported as a bug?

I have searched to see if it has been reported, but have not been able to find anything on it. But, I’m not sure that I have looked in the right place(s).

I’m looking for some guidance on how to push this issue further with the developers.


Bryan Hunt

Is it fully reachable using either interface address on either LAN?

P Fleming, in the asterisk-dev thread is, I believe, a developer.

If you are sure that the issue has not been raised on the bug tracker, you should raise it yourself, there, citing the asterisk-dev thread, and referencing this thread. Remember that you are reporting that it is using the loopback address, rather than that it is not using the interface address.

The basic rules for SIP bug reports are verbose 5, debug 5, sip set debug on. You should use the logfile, not a screen scrape. You may need to enable the debug category. You can redact sensitive information and you should remove material for unrelated calls, but otherwise should not edit the logs. They should be attached, not inline.

Also, the best place to discuss whether to report a bug is the asterisk-dev mailing list.

Fleming doesn’t work for Digium currently.


I search the bug tracker and did not find anything that seemed to match up with this particular problem.

I then created a issue following the guidelines that you detailed in your post.

Thanks for your assistance in guiding me through this process.

Bryan Hunt