Summary:ASTERISK-19057: [patch] message-summary NOTIFY: Port in Message-Account added twice and mwi_from (sip.conf) has no effect
Reporter:Yuri (ys)Labels:patch
Date Opened:2011-12-16 06:19:48.000-0600Date Closed:
Versions:SVN 10.0.0 13.18.4 Frequency of
Environment:asterisk-.1.10.0 asterisk-trunkAttachments:( 0) 348360chan_sip.diff
( 1) ASTERISK-19057_notify_port_bug.diff

A use non standart port number for SIP protocol (in this case: 15072)

sip peer configuration in sip.conf:

After sip client subscribeb to MWI, i got the following notify:

NOTIFY sip:100@;transport=UDP SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK089490e9;rport
Max-Forwards: 70
Route: <sip:100@;transport=UDP>
From: "asterisk" <sip:asterisk@>;tag=as77ac08d3
To: <sip:100@;transport=UDP>;tag=5962c620
Contact: <sip:asterisk@>
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX SVN-trunk-r348312M
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 101

Messages-Waiting: no
Message-Account: sip:100@
Voice-Message: 0/0 (0/0)

1. In "Message-Account:"  port number typed twice.
2. headers, which I expected: "From: <sip:100@>" and "Contact: <sip:100@>", I have not received.
Comments:By: Yuri (ys) 2011-12-16 06:35:32.998-0600

I add 348360chan_sip.diff where in check_peer_ok() I add processing for mwi_from, this resolve problem number #2 for me.

By: Jonathan Rose (jrose) 2012-01-19 16:41:29.987-0600

I don't know how I feel about that really. If I'm not mistaken, you are going to be sending these mwi_from headers in every ack response if the sip peer has an mwi_from set.  I think this might only be supposed to go out in response to NOTIFY acks.  I'll have a better look tomorrow.  I did get around to removing the double-port inclusion bug you mentioned though, so fear not, I'm on the case.

EDIT:  Wow was I mistaken.  Alright, I'm committing this just as soon as I'm sure this is the right place to be doing this.  I'm actually inclined to believe we should set this either when receiving the registration or when sending a notify though.

By: atca_pres (atca_pres) 2012-01-19 22:00:26.880-0600

Hi Jonathan, is there any chance you could get a patch in this issue for the double-port. I have some units here rejecting the NOTIFY (400 Invalid Message Summary) because of it.
Thank you !

By: Luke H (luckman212) 2012-01-19 23:29:12.858-0600

I think Jonathan is right, the mwi_from headers should not be included in every ACK.

By: Jonathan Rose (jrose) 2012-01-20 08:56:09.942-0600

acta_pres: Sure, but this is something that would actually be good for you to know if you don't already.  You can easily create a patch that covers any revision using SVN and on the subversion commits tab of this comments area, you can easily get the revision number any given patch was applied to.  So in this case, you could create your own patch simply by doing the following:

svn diff -c ARG > patch.diff

In this case for 1.8 at least, ARG would be 351559 since that's the revision this was changed in.

Just a good thing to know in the future so that you don't have to sit on something like this and wait for whoever developed the patch to come make the patch for you.

By: Jonathan Rose (jrose) 2012-01-20 08:59:43.533-0600

Patch for port doubling bug.

By: atca_pres (atca_pres) 2012-01-20 11:47:13.660-0600

Wow, very nice. Thank you Jonathan. I guess I'm still use to the old interface