////////////////////////////////////////////////////////////////////////////////
// Client: registers with authentication, branching on the response
//
// Counterpart of Reg_server.
//
// Same as Reg_client, but a condition looks at the first response: a 404 jumps
// to the label "end" and finishes the scenario without registering.
//
// 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
//  ---- if the response is 404, go to "end"
//  <--- 100 Trying (optional)
//  <--- 401 (optional)
//  ---> REGISTER ;retrans (with Authorization)
//  <--- 200
////////////////////////////////////////////////////////////////////////////////

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


----------
condition=if (Resp == 404) goto end

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

<----------*
401 Unauthorized

---------->*;retrans
REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[fromUsername]@[remote_ip]:[remote_port]>;tag=24de4a5dbe4ef
To: <sip:[fromUsername]@[remote_ip]:[remote_port]>
Call-ID: [call_number].[run_tag]@[local_ip]
CSeq: [cseq+1] REGISTER
Max-Forwards: 70
Contact: <sip:[fromUsername]@[local_ip]:[local_port];transport=[transport]>
Expires: 3600
Authorization: [authentication username=[authUsername]; password=[authPassword];]
User-Agent: SIPInspector_v_[ver]
Content-Length: 0


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

----------
label=end
