|Summary:||ASTERISK-20805: SIP Notify message has incorrect IP address in FROM field|
|Reporter:||Bryan Hunt (brhunt)||Labels:|
|Date Opened:||2012-12-15 10:02:57.000-0600||Date Closed:||2013-01-04 15:21:45.000-0600|
|Versions:||22.214.171.124 11.1.0||Frequency of|
|Environment:||Centos 6.2 - 32bit PIAF Purple Freepbx 126.96.36.199 EPM Polycom IP331||Attachments:||( 0) asterisk-20805-notify-ip_v2.diff|
( 1) full.txt
|Description:||When sending a SIP Notify 'check-sync' to our IP331 phones, the FROM portion of the Notify message does not contain the IPv4 address of the Asterisk server's interface (to which the phone is registered). The FROM instead contains something that looks like an IPV6 localhost address:
From: "Unknown" <sip:Unknown@[::1]>;tag=as567b56ba
The phones will not reboot, as the from message is not giving the server that the phone is registered to.
This can be worked-around by putting in the interface's IPV4 address in the bindaddress field. The FROM then looks like this:
From: "Unknown" <sip:Unknown@172.16.99.218>;tag=as60768d2a
This message does cause the phone to be rebooted.
Unfortunately, setting the bindaddress will break any environment where SIP is used on two or more NIC interfaces.
I believe that the Asterisk server should determine the IP address of the egress NIC interface (or the IP address that the phone is registered to) and place that in the FROM field in the SIP Notify message.
|Comments:||By: Bryan Hunt (brhunt) 2012-12-15 10:06:43.948-0600|
Full log file with debug showing both unsuccessful (line 780) and successful (line 14404) SIP Notify messages.
By: Michael L. Young (elguero) 2012-12-15 22:33:57.698-0600
Give this patch a try and please report back if it solves your issue. I am pretty sure that it should take care of this since I was able to reproduce this issue and the patch worked for me.
By: Bryan Hunt (brhunt) 2012-12-16 08:38:14.991-0600
Thanks for the reply, I will try that patch.
Are there instructions on the site on the procedure for applying patches like this?
Also, assuming this works, will this code be incorporated into the core Asterisk build at some time? Or would I need to reapply every time we go to a newer version of asterisk?
By: Bryan Hunt (brhunt) 2012-12-16 09:33:34.381-0600
Do these look like the proper steps to apply this patch?
patch -p0 < asterisk-20805-notify-ip.diff
By: Bryan Hunt (brhunt) 2012-12-16 12:33:35.420-0600
I followed those steps and all seemed to go well.
The patch seems to have resolved the Notify issue. I need to install on another system (dual homed) to make sure.
Going back to an earlier question then, will this patch be incorporated into Asterisk baseline code?
Thanks for all of your help on this.
By: Michael L. Young (elguero) 2012-12-16 13:57:39.996-0600
Bryan, Glad to hear that it is working so far. Once you test on the dual homed system and confirm that it is working, I will put it through the process to get it into the code base.
By: Tim Irvin (tirvin) 2012-12-29 15:15:33.097-0600
A workaround for this issue is to deactivate IPv6 on the system, notice the From address in the SIP NOTIFY header is Unknown@[::1] (IPV6 localhost address (a bug no doubt), but if IPv6 is deactivated then this address can't be used and asterisk goes back to the correct method of using the IPv4 address of the egress interface.
To deactivate IPv6 add the following lines to /etc/sysctl.conf and reboot:
By: Bryan Hunt (brhunt) 2012-12-29 15:37:55.433-0600
Michael and Tim,
I installed the asterisk-20805-notify-ip.diff patch into a dual NIC environment today and it worked perfectly. SIP signalling worked correctly on both interfaces.
From my perspective it is ready to be added to the code base.
Let me know if you need anything more from me.
How will I/we know that the code base has been updated?
By: Michael L. Young (elguero) 2012-12-29 20:51:45.889-0600
Bryan, I will submit this for code review. When the issue has been fixed by committing the patch to svn, this issue will be closed and you should receive an email. Also, you will notice a tab above that says "Subversion". That will show when the patch is committed along with the revision number.
By: Bryan Hunt (brhunt) 2013-01-03 19:41:27.829-0600
Great Michael, thanks.
By: Michael L. Young (elguero) 2013-01-04 15:11:28.314-0600
Uploading patch that will be committed to SVN.