Enforcing the legemtimate status values is better done in
the parser and not in the grammar. We don't do it in the
parser yet but that can be done later.
So this code acks the 401 Unauthorized message. It is possible
that this message is lost on the way we will not be able to
respond to the 401 again. The right thing would be to "fork" off
the transaction to deal with re-transmissions.
When we receive a message and there is rport and such set we
should include the "seen" remote address in the VIA. The code
should also handle having multiple VIA entries as per the spec.
Add a testcase for testing ProxyAuthenticate and ProxyAuthorize,
extend the grammar and parser to handle the needed bits. Document
another error/failure with the dialog handling code and create a
testcase that fully connects a call.
The SIP RFC specifies that after a final response everything should
be ignored. It is not clear if an ACK should be sent for a 503 message
or if the dialog has been terminated. It looks like for 4xx, 5xx and
6xx the dialogue is gone. No ack needed.
This should work for all transactions carried out by the transaction
layer but the unit test is only created for INVITE. It has not been
verified against another SIP engine yet. It has not been verified for
BYE/ACK. Specially for ACK the code might still be wrong as the wrong
operation name is taken into account for the digest.