[asterisk-dev] [Code Review] 2988: chan_sip creates a new local tag (from-tag) for every register message

Matt Jordan reviewboard at asterisk.org
Wed Nov 6 12:47:54 CST 2013



> On Nov. 4, 2013, 9:11 a.m., Olle E Johansson wrote:
> > Wait... Every REGISTER is a new transaction, there's no dialog here. What are you trying to fix?

The relevant discussion from #asterisk-dev that is quoted on the JIRA issue:

{quote}
(03:33:23 PM) jsmith: Seems we're generating a new from-tag for each REGISTER request
(03:33:48 PM) file: I know the call id is supposed to be the same, but I don't remember reading that the tag has to be
(03:34:41 PM) jsmith: Someone referenced RFC 3261, section 8.1.3.5.
(03:34:46 PM) jsmith: I guess I should go look that up
(03:35:12 PM) putnopvut: Just got back into the office and catching up on this conersation
(03:36:00 PM) jsmith: Ah, specifically "This new request
(03:36:00 PM) jsmith:    constitutes a new transaction and SHOULD have the same value of the
(03:36:00 PM) jsmith:    Call-ID, To, and From of the previous request, but the CSeq should
(03:36:00 PM) jsmith:    contain a new sequence number that is one higher than the previous."
...
(03:40:47 PM) putnopvut: But section 8 is general UAS behavior. It doesn't pertain necessarily to dialogs.
(03:40:55 PM) mjordan: right. I'm backtracking now
(03:41:02 PM) putnopvut: So for REGISTER, the recommendation in section 8 should be pertinent
(03:41:12 PM) mjordan: and even non-dialogs have From tags
(03:41:19 PM) jsmith: mjordan: Right... here's what I'm seeing.  Asterisk tries to register (initial registration).  Server comes back with a 401 auth required.
(03:41:37 PM) putnopvut: I don't think the problem is that we don't include a from-tag. It's that we change it on subsequent retries.
(03:41:37 PM) jsmith: mjordan: We re-attempt the REGISTER with auth, but with a different from-tag.
(03:43:04 PM) jsmith: The server says something to the effect of "The from-tag in the request I sent the nonce to doesn't match the from-tag on the new request", and denies the registration
(03:43:13 PM) jsmith: putnopvut: That's my understanding as well
(03:45:54 PM) putnopvut: Well, to be fair to Asterisk, it's only SHOULD strength that we keep the from-tag the same according to 8.1.3.5.
(03:46:01 PM) putnopvut: (See why I hate SHOULD ?)
(03:46:35 PM) jsmith: So, ignore and keep requiring people to patch?  Fix?  Expose via an option?
(03:46:40 PM) putnopvut: But, if it's really an easy fix like that e-mail implies, we may as well make it to be more compliant since apparently some endpoints will refuse our auth.
(03:46:52 PM) jsmith: It's a one-line removal
(03:47:05 PM) ***jsmith is happy to submit a patch
{quote}


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2988/#review10114
-----------------------------------------------------------


On Nov. 1, 2013, 9:11 p.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2988/
> -----------------------------------------------------------
> 
> (Updated Nov. 1, 2013, 9:11 p.m.)
> 
> 
> Review request for Asterisk Developers, Jared Smith, Matt Jordan, Olle E Johansson, and Putnopvut.
> 
> 
> Bugs: ASTERISK-12117
>     https://issues.asterisk.org/jira/browse/ASTERISK-12117
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Added field to sip_registry structure to store a local (from) tag generated at the same time as callid, and assign that tag to sip_pvt structure used to generate REGISTER requests.  This aligns code with RFC 3261 8.1.3.5 "... request constitutes a new transaction and SHOULD have the same value of the Call-ID, To, and From of the previous request...".
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/sip/include/sip.h 402223 
>   /branches/1.8/channels/chan_sip.c 402223 
> 
> Diff: https://reviewboard.asterisk.org/r/2988/diff/
> 
> 
> Testing
> -------
> 
> Tests outbound_register_from and outbound_reregister_from added to testsuite/tests/channels/SIP and transition from Fail to Pass with this patch.
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131106/8fbf130d/attachment.html>


More information about the asterisk-dev mailing list