1. Download the java API for SIP signalling. As SIP is the most common protocol used for IP phones and SoHo gateways nowadays (and not to forget that it is much easier to “code” SIP than H.323) – you should go for it.
2. Then you need an RTP stack + codecs. The compressed ones (G729 and G723) are not free of charge though.
You might go with G711 and iLBC.