- Create a new class ModelFacade in the sip.model package. This class contains the methods UserData findUserDataById(String userId) and UserData updateUserData(UserData user) which are used by the Registration Servlet.
- Create a RegisterSipServlet class and a B2BUASipServlet class with "New->Sip Servlet".
- The code for both you can copy from provided sources.
- In configuration files add the RegisterSipServlet and the B2BUASipServlet to sip.xml and the ModelFacade to web.xml.
- Deploy the application.
Prerequisites for Testing
- Get a softphone (e.g. X-Lite from http://www.counterpath.com/) and configure its settings (e.g. username to "Bob", domain to "test.com", proxy to localhost:5060).
- If you are running the second softphone on the same machine you need a different model as second phone (e.g. 3CX VOIP phone from http://www.3cx.de/voip-telefon/index.html) and configure it for a second user (e.g. Alice)
Test the Application
- Start both softphones, on X-Lite you should see "Ready, your username is Bob" on the display
- Dial from A party as sip:user
@siphoste.g. sip:Alice@localhost:5057 :port ,
- The second phone rings and you can start the conversation
- When you go onhook the call is terminated.
Automatic Testing with SIPp tool