<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>So I've got a bit further with my  project to get BLF working
      between asterisk and linphone.</p>
    <p>Initially asterisk was rejecting linphone's SUBSCRIBE messages
      because they didn't have an Accept: header. I've fixed that and
      now the initial SUBSCRIBE messages work and I see all my online
      contacts in green.</p>
    <p>But after a few minutes linphone attempts to renew the
      subscriptions and asterisk is not happy at all:</p>
    <p><br>
    </p>
    <p><--- SIP read from UDP:10.27.128.3:5060 ---><br>
      SUBSCRIBE <a class="moz-txt-link-freetext" href="sip:jacques@10.27.128.1:5060">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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=iGH81k5xf<br>
      To: <a class="moz-txt-link-rfc2396E" href="sip:jacques@masked.masked.com"><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 class="moz-txt-link-rfc2396E" href="sip:john@10.27.128.3;transport=udp"><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 class="moz-txt-link-rfc2396E" href="sip:jacques@10.27.128.1:5060">"sip:jacques@10.27.128.1:5060"</a>,
      response="bdbc7cbac4453fd643050bf28996a68e"<br>
      <br>
      <-------------><br>
      --- (14 headers 0 lines) ---<br>
      Found peer 'john' for 'john' from 10.27.128.3:5060<br>
      <br>
      <--- Transmitting (no NAT) to 10.27.128.3:5060 ---><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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=iGH81k5xf<br>
      To: <a class="moz-txt-link-rfc2396E" href="sip:jacques@masked.masked.com"><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:10.27.128.3:5060 ---><br>
      SUBSCRIBE <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com">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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com">sip:jacques@masked.masked.com</a><br>
      CSeq: 20 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 class="moz-txt-link-rfc2396E" href="sip:john@10.27.128.3;transport=udp"><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 10.27.128.3:5060 (no NAT)<br>
      Creating new subscription<br>
      Sending to 10.27.128.3:5060 (no NAT)<br>
      sip_route_dump: route/path hop:
      <a class="moz-txt-link-rfc2396E" href="sip:john@10.27.128.3;transport=udp"><sip:john@10.27.128.3;transport=udp></a><br>
      Found peer 'john' for 'john' from 10.27.128.3:5060<br>
      <br>
      <--- Transmitting (no NAT) to 10.27.128.3:5060 ---><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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com;tag=as007ffc64">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:10.27.128.3:5060 ---><br>
      SUBSCRIBE <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com">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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com">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 class="moz-txt-link-rfc2396E" href="sip:john@10.27.128.3;transport=udp"><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 class="moz-txt-link-rfc2396E" href="sip:jacques@masked.masked.com">"sip:jacques@masked.masked.com"</a>,
      response="eb30a9801e78d2cb2c58c61200c50cb1"<br>
      <br>
      <-------------><br>
      --- (14 headers 0 lines) ---<br>
      <br>
      <--- Transmitting (no NAT) to 10.27.128.3:5060 ---><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 class="moz-txt-link-rfc2396E" href="sip:john@masked.masked.com"><sip:john@masked.masked.com></a>;tag=c3Wvuu2XH<br>
      To: <a class="moz-txt-link-freetext" href="sip:jacques@masked.masked.com;tag=as3c7de68c">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>
    <p>[Mar 23 18:23:09] WARNING[2128]: chan_sip.c:4071 retrans_pkt:
      Retransmission timeout reached on transmission SQOclJgm4O for
      seqno 103 (Critical Request) -- See
      <a class="moz-txt-link-freetext" href="https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions">https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions</a><br>
      Packet timed out after 32000ms with no response</p>
    <p><br>
    </p>
    <p>Why is asterisk giving an error 500? I can find no reason, there
      is nothing in any log.<br>
    </p>
    <p>Why does asterisk think the error 500 is going to be acked?</p>
    <p><br>
    </p>
  </body>
</html>