Programming problem: Add basic SIP capability to your voice client. You
should support the INVITE (with ACK) and BYE transactions necessary to set up
direct client-to-client unicast audio sessions, using RFC 3261 and the examples
in RFC3665.
In particular, consider Sections 2.1 and 3.1. Compared to the specification,
you can take a few short cuts:
- Only TCP.
- You do not need to support request and response retransmission.
- Only the core headers (To, From, Via, Content-Length, Call-ID, CSeq)
need to be parsed.
- Authentication is not necessary.
- Only one media (audio) session in SDP will be negotiated.
- You do not have to support Record-Route and Route.
- Your code should recognize the SIP response classes and display the
responses, but does not have to deal with redirection (3xx responses) beyond
indicating the condition.
However, your code should deal with properly-formatted SIP headers,
including headers that are continued across more than one line, spaces where
permissible and header fields in various combinations of upper and lowercase.
Your code should generate a Ringing (180) response.
You should add three commands to your interface: call
sip:user@host (caller), hangup (caller or callee) and
answer (callee), with the obvious meaning. You only need to support
standard DNS A records (gethostbyname), not the SIP SRV and NAPTR conventions.
You should show the above functionalities in your README/sample output file with brief explanations.