The code only tests this with the response but it should work for
the request as well. Depending on this one needs to switch from/to
but this needs to happen on a higher level.
The CSeq only needs to be unique within a dialog, so we can have
a global function to generate a valid CSeq start (< 2^31) and then
handle cseq's within the dialog.
Introduce a high level class that can create multiple transactions,
handles the sequence numbers, the dialogs, the opened session and
provides a nice call, hangup, cancel, terminate interface.
This is fixing a previous commit, fixes the timed out handling, attempts
to change the initial dialog -> confirmed dialog handling (but still
gets it wrong, it should compare the dialog, or just get a new dialog
from the response and check if it is compatible with the initial dialog).
Only the INVITE transaction can be canceled, when it gets
canceled we might or might not get a confirmation or we might
be too late to cancel things. With this flag we will be able
to do something sensible when we get a late final response.
The transaction now work on something called an initial dialog, e.g.
during a INVITE we go from an initial dialog to a confirmed dialog and
maybe create a session. Prepare the code to support this.
It is still not clear how callbacks, dialog confirmation and session
creation will be handled but it will somehow fit together.
Parse every generic_param (or specialized) into a SIPGenericParam,
provide a asFoldedString implementation, tell the folding code about
it, create a SIPToFromParam that holds the list of params.
Right now the UTF8 support for the displayname is still
missing and needs to be added later. The to_spec is not
part of the RFC but it makes our code more happy if things
look like the from_spec.
Dispatch the data from thre socket in a new context. This assures
that we will not run into locking issues. One day where we will have
VMs that can use multiple cores we might have a dispatcher set in
each transaction/session. The we could establish a rule that each
transaction is dispatched in the right/same queue.
Add the grammar for the Via parameter, introduce a generic
array folding class to turn it into a string. Add a data holder
that returns the complete string but also the branch if that
is required.