////////////////////////////////////////////////////////////////////////////////
// Server: WebSocket server that takes a call from a browser (WebRTC)
//
// No counterpart in this directory: it needs a WebSocket client (a browser or
// a client scenario) and the program started with the WS transport (-t WS).
//
// It accepts the registration and then answers one call with a WebRTC style SDP
// (Opus, ICE, DTLS fingerprint, RTP/SAVPF). The RTP played afterwards is plain
// RTP from a pcap file, not the DTLS-SRTP a browser would negotiate.
//
// 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
//  <--- REGISTER ;retrans
//  ---> 200
//  (new dialog)
//  <--- INVITE ;retrans
//  ---> 100 Trying
//  ---> 180 Ringing
//  ---> 200 OK ;retrans (SDP)
//  <--- ACK
//  ---- play test.pcap
//  <--- BYE ;retrans
//  ---> 200 OK
////////////////////////////////////////////////////////////////////////////////

<----------;retrans
REGISTER

---------->
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
[last_Contact:];expires=3600
Expires: 3600
User-Agent: SIPInspector_v_[ver]
Content-Length: 0


----------
cmd_NewDialog

<----------;retrans
INVITE

---------->
SIP/2.0 100 Trying
[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


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


---------->;retrans
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
User-Agent: SIPInspector_v_[ver]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]

v=0
o=- 5525948855961695094 2 IN [IP_ver] [local_ip_sdp]
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS wcVeXYDbBE5kYHmtqb6HlMnCYobhTTuQOGpa
m=audio [media_port] RTP/SAVPF 111 126
c=IN [IP_ver] [local_ip_sdp]
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2395300328 1 udp 2122063615 [local_ip_sdp] [media_port] typ host generation 0
a=ice-ufrag:qQkKYlDO9ydMnxWA
a=ice-pwd:sAYpo2oiWgw35yZ6X/HtQiga
a=fingerprint:sha-256 50:15:64:04:5D:45:31:4A:89:8B:11:DB:98:ED:9C:E7:EF:4B:C9:EB:89:F8:45:BB:C2:BE:AA:D9:70:2F:E0:69
a=setup:active
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:49678244 cname:kcmIqEamtzCxcOfb
a=ssrc:49678244 msid:wcVeXYDbBE5kYHmtqb6HlMnCYobhTTuQOGpa edd6f067-5664-4716-bc69-f808bea8f02e
a=ssrc:49678244 mslabel:wcVeXYDbBE5kYHmtqb6HlMnCYobhTTuQOGpa
a=ssrc:49678244 label:edd6f067-5664-4716-bc69-f808bea8f02e
m=video 0 RTP/SAVPF 100 116 117
c=IN IP4 0.0.0.0
a=rtcp:1 IN IP4 0.0.0.0
a=recvonly
a=mid:video
a=rtcp-mux

<----------
ACK

----------
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


