Now the CSeq is correct, however I do see repeated CANCELs and 487s from the peer just as in https://github.com/kamailio/kamailio/issues/870 This means that it does cancel the call and these extra messages back and forth do not cause any end-user side effects:
# U x.x.x.50:5060 -> 85.14.79.130:6050 INVITE sip:48732406302@provider.server:6050 SIP/2.0. Record-Route: sip:x.x.x.50;lr=on;ftag=1966e51d;did=394.3881. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.0. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. Max-Forwards: 69. Contact: sip:48221028008@x.x.x.61:52163;transport=UDP. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 2 INVITE. Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE. Content-Type: application/sdp. Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri. Allow-Events: presence, kpml. Content-Length: 239. . v=0. o=Z 0 0 IN IP4 x.x.x.61. s=Z. c=IN IP4 x.x.x.61. t=0 0. m=audio 8000 RTP/AVP 3 110 8 0 98 101. a=rtpmap:110 speex/8000. a=rtpmap:98 iLBC/8000. a=fmtp:98 mode=20. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-15. a=sendrecv.
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 407 Proxy Authentication Required. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.0;received=x.x.x.50. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as209509cf. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 2 INVITE. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Proxy-Authenticate: Digest realm="adescom", nonce="4d5a9b94". Content-Length: 0. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 ACK sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.0. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as209509cf. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 2 ACK. Content-Length: 0. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 INVITE sip:48732406302@provider.server:6050 SIP/2.0. Record-Route: sip:x.x.x.50;lr=on;ftag=1966e51d;did=394.3881. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. Max-Forwards: 69. Contact: sip:48221028008@x.x.x.61:52163;transport=UDP. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 INVITE. Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE. Content-Type: application/sdp. Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri. Allow-Events: presence, kpml. Content-Length: 239. Proxy-Authorization: Digest username="USER", realm="adescom", nonce="4d5a9b94", uri="sip:48732406302@provider.server:6050", response="5e7395307812b7c47418bfde0d4262bf", algorithm=MD5. . v=0. o=Z 0 0 IN IP4 x.x.x.61. s=Z. c=IN IP4 x.x.x.61. t=0 0. m=audio 8000 RTP/AVP 3 110 8 0 98 101. a=rtpmap:110 speex/8000. a=rtpmap:98 iLBC/8000. a=fmtp:98 mode=20. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-15. a=sendrecv.
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 100 Trying. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 INVITE. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Contact: sip:48732406302@85.14.79.130:6050. Content-Length: 0. X-CTMG-HangupCause: Normal Clearing. .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 183 Session Progress. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as72708a91. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 INVITE. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Contact: sip:48732406302@85.14.79.130:6050. Content-Type: application/sdp. Content-Length: 226. . v=0. o=root 7839 7839 IN IP4 85.14.79.130. s=session. c=IN IP4 85.14.79.130. t=0 0. m=audio 54604 RTP/AVP 8 101. a=rtpmap:8 PCMA/8000. a=ptime:20. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=silenceSupp:off - - - -.
# U x.x.x.50:5060 -> 85.14.79.130:6050 CANCEL sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. Content-Length: 0. .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 487 Request Terminated. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. Via: SIP/2.0/UDP x.x.x.61:52163;rport=52163;branch=z9hG4bK-d8754z-61867e46d5fd912d-1---d8754z-. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as72708a91. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 INVITE. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Content-Length: 0. X-CTMG-HangupCause: Normal Clearing. Reason: Q.850 ;cause=16 ;text="Normal Clearing". .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 200 OK. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as72708a91. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Content-Length: 0. X-CTMG-HangupCause: Normal Clearing. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 ACK sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as72708a91. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 ACK. Content-Length: 0. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 CANCEL sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. Content-Length: 0. .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 481 Call Leg Does Not Exist. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as0575a12b. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Content-Length: 0. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 CANCEL sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. Content-Length: 0. .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 481 Call Leg Does Not Exist. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as6b28014f. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Content-Length: 0. .
# U x.x.x.50:5060 -> 85.14.79.130:6050 CANCEL sip:48732406302@provider.server:6050 SIP/2.0. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2. Max-Forwards: 69. To: sip:48732406302@x.x.x.50;transport=UDP. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. Content-Length: 0. .
# U 85.14.79.130:6050 -> x.x.x.50:5060 SIP/2.0 481 Call Leg Does Not Exist. Via: SIP/2.0/UDP x.x.x.50;branch=z9hG4bK7c47.6ccd00e1473454bee7f723fc9772a737.1.cs2;received=x.x.x.50. From: sip:48221028008@x.x.x.50;transport=UDP;tag=1966e51d. To: sip:48732406302@x.x.x.50;transport=UDP;tag=as52cb54b1. Call-ID: NDY0MjJlYjNmNTMwMzQ1MjFiZjZlZTQyMTU0MTVjZTc.. CSeq: 3 CANCEL. User-Agent: Adescom CTM5000. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO. Max-Forwards: 70. Content-Length: 0. .