private void Initialise(List<SIPContactHeader> contact, SIPFromHeader from, SIPToHeader to, int cseq, string callId)
{
if (from == null)
{
throw new ApplicationException("The From header cannot be empty when creating a new SIP header.");
}
if (to == null)
{
throw new ApplicationException("The To header cannot be empty when creating a new SIP header.");
}
if (callId == null || callId.Trim().Length == 0)
{
throw new ApplicationException("The CallId header cannot be empty when creating a new SIP header.");
}
From = from;
To = to;
Contact = contact;
CallId = callId;
if (cseq > 0 && cseq < Int32.MaxValue)
{
CSeq = cseq;
}
else
{
CSeq = DEFAULT_CSEQ;
}
}