Login Form






Lost Password?
No account yet? Register
Home arrow Forums
ECharts
Welcome, Guest
SIP Servlets, help needed to understand proxying (0 viewing) 
Go to bottom Post Reply Favoured: 0
TOPIC: SIP Servlets, help needed to understand proxying
#460
Darek (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
SIP Servlets, help needed to understand proxying 2 Months, 4 Weeks ago  
Hello,
I'm working at a project for my study. Since I'm not very experienced in Java and networking programming, I experience diffculties and would like to ask for some help. I've been reading about SIP Servlets and trying to do what I want for the last few days.

My goal is to implement an SMSC-like functionality using SIP and the MESSAGE method. My SMSC equivalent is a SIP Servlet acting as proxy. I am testing the app using Twinkle where I entered the Sailfin local SIP address as Outbound Proxy. Now the application logic:
A user sends a MESSAGE method with the "To" field filled in, then it is handled by the servlet. The servlet stores the message in its internal data_base_ and then it should try to send it directly to the recipient. It should also send a confirmation to the sender as another MESSAGE method. The specification of the project says:
The SMSC tries to connect directly to the recipient - in case of SIP we assume that it means sending a MESSAGE method to the proxy determined by the domain part of the receiver's address. If it doesn't succeed, it is repeated x times. After success, the application sends a confirmation to the sender.
Now I have problems with understanding the proxying mechanism in SIP servlets. I followed one of the examples and wrote a method like this:
Code: :

  @Override     protected void doMessage(SipServletRequest req)     throws ServletExceptionIOException     {         SmsMessage msg = new SmsMessage(req.getTo().toString(),                   (String)req.getContent());         ExtendedSmsMessage emsg saveMessage(msgreq.getFrom());         // saves in internal db and appends some data         try {             if (req.isInitial()) {                 Proxy p req.getProxy();                 p.proxyTo(req.getRequestURI());                  req.createResponse(SipServletResponse.SC_OK).send();             }             System.out.println("OK");         }         catch (Exception e) {             req.createResponse(SipServletResponse.SC_OK).send();             localdb.remove(emsg.getId());             e.printStackTrace();             System.out.println("ERR");         }         printDatabaseInfo();     }


To be honest, I just don't get what the two "proxy" lines of code actually do and what it means to deliver the message to the domain proxy. Could you please give me some hints how I can know the delivery status - it is the crucial element for me. I should have no problems with the other parts, timers and so on. I really hope you can help me
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/06/13 12:30 By notoswietnie.
  The administrator has disabled public write access.
#461
Tom Smith (Admin)
Admin
Posts: 72
graphgraph
User Online Now Click here to see the profile of this user
Re:SIP Servlets, help needed to understand proxying 2 Months, 3 Weeks ago  
Well, your questions are not directed at ECharts/E4SS, but here are some general pointers:

To understand SIP and the role of a proxy, see this SIP tutorial.

To understand the SIP Servlet API (for proxying and much more), see JSR-289.

Good luck.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
Copyright © 2006-2009 echarts.org