////////////////////////////////////////////////////////////////////////////////
// Client: call through proxies (Record-Route / Route)
//
// Counterpart of Record_route_server.
//
// The INVITE carries three Record-Route headers, as if three proxies had added
// them. The 200 OK comes back with the same three, which the client saves; the
// ACK then carries them as Route headers in reverse order (RFC 3261 12.1.2).
// The server ends the call.
//
// 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 (3 x Record-Route)
//  <--- 100 Trying (optional)
//  <--- 180 Ringing
//  <--- 200 OK ;retrans (Record-Route)
//  ---> ACK (Route headers)
//  ---- play test.pcap
//  <--- BYE ;retrans
//  ---> 200 OK
////////////////////////////////////////////////////////////////////////////////

---------->;retrans
INVITE sip:[toUsername]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[fromUsername]@[local_ip]:[local_port]>;tag=24417923471779367133
To: <sip:[toUsername]@[remote_ip]:[remote_port]>
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq+1] INVITE
Max-Forwards: 70
Record-Route: <sip:route1@[local_ip]:[local_port];lr>
Record-Route: <sip:route2@192.0.2.10:5060;lr>
Record-Route: <sip:route3@198.51.100.20:5060;lr>
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

<----------;retrans
200 OK

----------
set_Variable=route1 "Record-Route-1:" "*"

----------
set_Variable=route2 "Record-Route-2:" "*"

----------
set_Variable=route3 "Record-Route-3:" "*"

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


----------
cmd_PlayPcap=./pcap/test.pcap

<----------;retrans
BYE

---------->
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
User-Agent: SIPInspector_v_[ver]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0

