////////////////////////////////////////////////////////////////////////////////
// Client: call that is cancelled while it rings (CANCEL, 487 Request Terminated)
//
// Counterpart of Call_cancel_server.
//
// Tests what the far end does when the caller gives up before the call is
// answered. The CANCEL and the ACK for the 487 use the branch of the INVITE
// (z9hG4bK[call_number]inv1) and its CSeq number, as RFC 3261 requires;
// a CANCEL with another branch is answered with 481 by a real UAS.
// The pause sets how long the phone rings before the CANCEL.
//
// Messages with ;retrans are sent again over UDP until they are answered, and a copy
// of one that comes again is answered as before (RFC 3261; -t1, -t2).
//
// SIP Messages
//  ---> INVITE ;retrans
//  <--- 100 Trying (optional)
//  <--- 180 Ringing
//  ---- ring for 2 s
//  ---> CANCEL ;retrans
//  <--- 200 OK (to the CANCEL)
//  <--- 487 Request Terminated ;retrans (to the INVITE)
//  ---> ACK
////////////////////////////////////////////////////////////////////////////////

---------->;retrans
INVITE sip:[toUsername]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK[run_tag].[call_number]inv1
From: <sip:[fromUsername]@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[toUsername]@[remote_ip]:[remote_port]>
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq+1] INVITE
Max-Forwards: 70
Contact: <sip:[fromUsername]@[local_ip]:[local_port];transport=[transport]>
User-Agent: SIPInspector_v_[ver]
Content-Type: application/sdp
Content-Length: [len]

v=0
o=111 843670094 843670094 IN [IP_ver] [local_ip_sdp]
s=-
c=IN [IP_ver] [local_ip_sdp]
t=0 0
a=sendrecv
m=audio [media_port] RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20

<----------*
100 Trying

<----------
180 Ringing

----------
cmd_Pause=2000

---------->;retrans
CANCEL sip:[toUsername]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK[run_tag].[call_number]inv1
From: <sip:[fromUsername]@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[toUsername]@[remote_ip]:[remote_port]>
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq] CANCEL
Max-Forwards: 70
User-Agent: SIPInspector_v_[ver]
Content-Length: 0


<----------
200 OK

<----------;retrans
487 Request Terminated

---------->
ACK sip:[toUsername]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK[run_tag].[call_number]inv1
From: <sip:[fromUsername]@[local_ip]:[local_port]>;tag=[call_number]
To: <sip:[toUsername]@[remote_ip]:[remote_port]>;[peer_tag_param]
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq] ACK
Max-Forwards: 70
Contact: <sip:[fromUsername]@[local_ip]:[local_port];transport=[transport]>
User-Agent: SIPInspector_v_[ver]
Content-Length: 0
