<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix"><br>
    </div>
    <blockquote type="cite"
      cite="mid:3d9afdff-a8da-2d47-40cd-e6d06f7be5e7@calva.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="moz-cite-prefix">On 23/03/2020 18:51, Joshua C. Colp
        wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAM0A2Z0rg1rNd_akzYCdN-E2vpbzJf2Cuynepjc0m+8J5fOXTg@mail.gmail.com">
        <div dir="ltr">
          <div dir="ltr">On Mon, Mar 23, 2020 at 2:45 PM John Hughes
            <<a href="mailto:john@calva.com" moz-do-not-send="true">john@calva.com</a>>
            wrote:<br>
          </div>
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div><br>
                <p>Why is asterisk giving an error 500? I can find no
                  reason, there is nothing in any log.<br>
                </p>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>The sequence number is from the past. The first
              SUBSCRIBE is sequence number 22 (check the CSeq header).
              The second is 20. The third is 21. It appears as though
              this is from the past, so it receives a 500.</div>
          </div>
        </div>
      </blockquote>
    </blockquote>
    <p>Ok, I've had some back and forth with the linphone developers and
      they contend that although the sequence number on the 2nd and 3rd
      SUBSCRIBE messages start a new sequence this is legal as it is a
      new conversation -- the "tag=" on the From has changed.</p>
    <p>Are they right?  (Notice that the tag= from asterisk also
      changes).<br>
    </p>
    <p><--- SIP read from UDP:<a href="http://10.27.128.3:5060"
        target="_blank">10.27.128.3:5060</a> ---><br>
      SUBSCRIBE <a>sip:jacques@10.27.128.1:5060</a> SIP/2.0<br>
      Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.NYP-ux0Zx;rport<br>
      From: <a><sip:john@masked.masked.com></a>;<b>tag=iGH81k5xf</b><br>
      To: <a><sip:jacques@masked.masked.com></a>;tag=as3c7de68c<br>
      CSeq: 22 SUBSCRIBE<br>
      Call-ID: SQOclJgm4O<br>
      Max-Forwards: 70<br>
      Supported: replaces, outbound<br>
      Event: presence<br>
      Expires: 600<br>
      Accept: application/pidf+xml<br>
      Contact:
      <a><sip:john@10.27.128.3;transport=udp></a>;+sip.instance="<urn:uuid:abcdf51a-82e0-49b9-a8ab-2461011f25ec>"<br>
      User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)<br>
      Authorization: Digest realm="asterisk", nonce="188b095b",
      algorithm=MD5, username="john", uri=<a>"sip:jacques@10.27.128.1:5060"</a>,
      response="bdbc7cbac4453fd643050bf28996a68e"<br>
      <br>
      <-------------><br>
      --- (14 headers 0 lines) ---<br>
      Found peer 'john' for 'john' from <a
        href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a><br>
      <br>
      <--- Transmitting (no NAT) to <a
        href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a>
      ---><br>
      SIP/2.0 401 Unauthorized<br>
      Via: SIP/2.0/UDP
10.27.128.3:5060;branch=z9hG4bK.NYP-ux0Zx;received=10.27.128.3;rport=5060<br>
      From: <a><sip:john@masked.masked.com></a>;<b>tag=iGH81k5xf</b><br>
      To: <a><sip:jacques@masked.masked.com></a>;tag=as3c7de68c<br>
      Call-ID: SQOclJgm4O<br>
      CSeq: 22 SUBSCRIBE<br>
      Server: Asterisk PBX 13.14.1~dfsg-2+deb9u4<br>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
      NOTIFY, INFO, PUBLISH, MESSAGE<br>
      Supported: replaces, timer<br>
      WWW-Authenticate: Digest algorithm=MD5, realm="asterisk",
      nonce="3144c0a9", stale=true<br>
      Content-Length: 0<br>
      <br>
      <br>
      <------------><br>
      Scheduling destruction of SIP dialog 'SQOclJgm4O' in 32000 ms
      (Method: SUBSCRIBE)<br>
      <br>
      <--- SIP read from UDP:<a href="http://10.27.128.3:5060"
        target="_blank">10.27.128.3:5060</a> ---><br>
      SUBSCRIBE <a>sip:jacques@masked.masked.com</a> SIP/2.0<br>
      Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.oxfLJBaRw;rport<br>
      From: <a><sip:john@masked.masked.com></a>;<b>tag=c3Wvuu2XH 
        <===== new conversation</b><br>
      To: <a>sip:jacques@masked.masked.com</a><br>
      CSeq: <b>20 SUBSCRIBE <=== sequence restarts</b><br>
      Call-ID: SQOclJgm4O<br>
      Max-Forwards: 70<br>
      Supported: replaces, outbound<br>
      Event: presence<br>
      Expires: 600<br>
      Accept: application/pidf+xml<br>
      Contact:
      <a><sip:john@10.27.128.3;transport=udp></a>;+sip.instance="<urn:uuid:abcdf51a-82e0-49b9-a8ab-2461011f25ec>"<br>
      User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)<br>
      <br>
      <-------------><br>
      --- (13 headers 0 lines) ---<br>
      Sending to <a href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a>
      (no NAT)<br>
      Creating new subscription<br>
      Sending to <a href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a>
      (no NAT)<br>
      sip_route_dump: route/path hop: <a><sip:john@10.27.128.3;transport=udp></a><br>
      Found peer 'john' for 'john' from <a
        href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a><br>
      <br>
      <--- Transmitting (no NAT) to <a
        href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a>
      ---><br>
      SIP/2.0 401 Unauthorized<br>
      Via: SIP/2.0/UDP
10.27.128.3:5060;branch=z9hG4bK.oxfLJBaRw;received=10.27.128.3;rport=5060<br>
      From: <a><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a>sip:jacques@masked.masked.com;tag=as007ffc64</a><br>
      Call-ID: SQOclJgm4O<br>
      CSeq: 20 SUBSCRIBE<br>
      Server: Asterisk PBX 13.14.1~dfsg-2+deb9u4<br>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
      NOTIFY, INFO, PUBLISH, MESSAGE<br>
      Supported: replaces, timer<br>
      WWW-Authenticate: Digest algorithm=MD5, realm="asterisk",
      nonce="4224acfb"<br>
      Content-Length: 0<br>
      <br>
      <br>
      <------------><br>
      Scheduling destruction of SIP dialog 'SQOclJgm4O' in 32000 ms
      (Method: SUBSCRIBE)<br>
      <br>
    </p>
    <p><--- SIP read from UDP:<a href="http://10.27.128.3:5060"
        target="_blank">10.27.128.3:5060</a> ---><br>
      SUBSCRIBE <a>sip:jacques@masked.masked.com</a> SIP/2.0<br>
      Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.RNv418~xv;rport<br>
      From: <a><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a>sip:jacques@masked.masked.com</a><br>
      CSeq: 21 SUBSCRIBE<br>
      Call-ID: SQOclJgm4O<br>
      Max-Forwards: 70<br>
      Supported: replaces, outbound<br>
      Event: presence<br>
      Expires: 600<br>
      Accept: application/pidf+xml<br>
      Contact:
      <a><sip:john@10.27.128.3;transport=udp></a>;+sip.instance="<urn:uuid:abcdf51a-82e0-49b9-a8ab-2461011f25ec>"<br>
      User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)<br>
      Authorization: Digest realm="asterisk", nonce="4224acfb",
      algorithm=MD5, username="john", uri=<a>"sip:jacques@masked.masked.com"</a>,
      response="eb30a9801e78d2cb2c58c61200c50cb1"<br>
      <br>
      <-------------><br>
      --- (14 headers 0 lines) ---<br>
      <br>
      <--- Transmitting (no NAT) to <a
        href="http://10.27.128.3:5060" target="_blank">10.27.128.3:5060</a>
      ---><br>
      <b>SIP/2.0 500 Server error</b><br>
      Via: SIP/2.0/UDP
10.27.128.3:5060;branch=z9hG4bK.RNv418~xv;received=10.27.128.3;rport=5060<br>
      From: <a><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a>sip:jacques@masked.masked.com;tag=as3c7de68c</a><br>
      Call-ID: SQOclJgm4O<br>
      CSeq: 21 SUBSCRIBE<br>
      Server: Asterisk PBX 13.14.1~dfsg-2+deb9u4<br>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
      NOTIFY, INFO, PUBLISH, MESSAGE<br>
      Supported: replaces, timer<br>
      Content-Length: 0<br>
      <br>
      <br>
      <------------></p>
  </body>
</html>