Create Servlets
- 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
@siphost e.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
- Download the SIPp tool from http://sipp.sourceforge.net/. On Windows you also have to download WinPCap from http://www.winpcap.org/devel.htm
- Run a basic test with ant -f tests.xml tc-001-basic-ua
1 Kommentar:
Peter, impressive blog. I would like to draw your attention towards a open source SIP application testing framework SIPr called Sipper. http://www.voip-info.org/wiki/view/Sipper or http://sipr.agnity.com. Your comment and impression will be most valuable. Thanks
Kommentar veröffentlichen