////////////////////////////////////////////////////////////////////////////////
// Client: video call, H.264 and PCMU
//
// Counterpart of Call_video_server.
//
// The INVITE offers audio (PCMU) and video (H.264, packetization mode 1). The
// video port is [video_port]: the program takes a port of its own for it and
// starts a receiver on that port, which decodes the incoming H.264 (RFC 6184)
// and shows the pictures in the Video tab. After the ACK the client sends
// pcap/video_h264.pcap as video (video=true) and waits until 30 pictures have
// been decoded from what the server sends back (waitVideo). If they do not
// arrive within 15 seconds the call fails.
//
// pcap/video_h264.pcap is a synthetic test video (320x240, 10 frames per second,
// 8 seconds, a key frame every 2 seconds). It is made by
// test/sipinspector/VideoPcapGenerator.java. The server sends the same picture
// from an MP4 file (pcap/video_h264.mp4), so that one call tries both kinds of
// source.
//
// 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 (audio + video)
//  <--- 100 Trying (optional)
//  <--- 180 Ringing
//  <--- 200 OK ;retrans (audio + video)
//  ---> ACK
//  ---- play test.pcap (audio) and video_h264.pcap (video)
//  ---- wait until 30 pictures are decoded
//  ---- pause 1.5 s
//  ---> 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=[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
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
a=sendrecv
m=video [video_port] RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420028;packetization-mode=1
a=sendrecv

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

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

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

---------->
ACK 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=[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


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

----------
cmd_PlayPcap=./pcap/video_h264.pcap;video=true

----------
waitVideo=30

----------
cmd_Pause=1500

---------->;retrans
BYE 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=[call_number]
To: <sip:[toUsername]@[remote_ip]:[remote_port]>;[peer_tag_param]
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq+1] BYE
Max-Forwards: 70
Contact: <sip:[fromUsername]@[local_ip]:[local_port];transport=[transport]>
User-Agent: SIPInspector_v_[ver]
Content-Length: 0


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