wood burning stoves*
The moose likes Servlets and the fly likes please i need help sipservlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "please i need help sipservlet" Watch "please i need help sipservlet" New topic
Author

please i need help sipservlet

amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
hi all I have extends a sip servlet


package org.example.servlet.sip;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.sip.SipServlet;
import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;

public class SimpleServlet extends SipServlet {

/**
*
*/

public SimpleServlet() {
// TODO Auto-generated constructor stub
System.out.println("hi \n amer22222222 \n");
}
private static final long serialVersionUID = -468618845319795003L;

@Override
protected void doRegister(SipServletRequest req) throws ServletException,
IOException {
System.out.print("hi \n hi \n hi \n hi \n hi \n");
}


public void doInvite(SipServletRequest request) {

System.out.println("*** Received INVITE ***");

try {
request.createResponse(SipServletResponse.SC_RINGING).send();
//request.createResponse(SipServletResponse.SC_OK).send();
} catch (IOException e) {
e.printStackTrace();
}

}

public void doCancel(SipServletRequest request) {

System.out.println("*** Received CANCEL ***");

try {
request.createResponse(SipServletResponse.SC_REQUEST_TERMINATED).send();
} catch (IOException e) {
e.printStackTrace();
}

}


@Override
public void init(ServletConfig servletConfig) throws ServletException {
System.out.println("****** the simple sip servlet has been started ********* \n ya rab");

}
}

and after I run the server I have the error

HTTP Status 500 -
please I need help any Ideas ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.

Also reserve bold for emphasis, not for complete sentences.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

and after I run the server I have the error
HTTP Status 500 -

That tells us nothing that can be used to help you. Please post the complete stack trace (use code tags as described above).
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10


really I need your help ; the complete stack ...


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Do you not properly indent your code?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
Are you using a SIP servlet implementation that runs in Tomcat? If so, which one, and how did you install it? I'm aware of SailFin, and my impression was that it requires GlassFish.


Ping & DNS - my free Android networking tools app
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
I do not understand your question Bear Bibeault please explain ...



Ulf Dittmer .. I ma using tomcat 6 mobicent edition .... I installed it by adding it to the server pane , right click new ....

I tried my code in glass fish and sailfin with netbeans but the same error still occurred

anyIdea?
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
please I neeeeed help ....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
If you're using GlassFish/SailFin, have you gotten any SIP servlets to run? I would imagine that SailFin comes with code examples, and that the documentation explains how to run them. That's where I would start.
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
thanks Ulf Dittmer I really appreciate your reply , but untill now I did not solve my problem , can you give me steps to follow

Really I will appreciate that

in fact I am a computer engineer student and I am trying to develop my graduation project with the help of SIP

and really I wasted a huge amount of time trying to solve this exception but until now I always have the same exception

again I will appreciate your help
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
In my previous post I asked a question; what's the answer to it? I also suggested to work through the SailFin docs; have you done that? If not, why not? If yes, does it contain install and run instructions for a basic SIP servlet?
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
Ulf Dittmer yes I installed GlassFish-Tools-Bundle-For-Eclipse-1.2 which contains the sailfin project , also I tried netbeans I instaaled Glass Fish Plugin ... that is what I did ...

I spent weeks trying JBoss WebLogic GlassFish Tomcat and always I have the same exception really I feel that I am lost , and not know what I did and what I did not :S
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
I can't tell from your post what the answers to my questions are. You're making it hard for us to help you, since we don't know what you did or did not accomplish so far. For example, nothing in what you said sounds like you've read the documentation in detail. Maybe you have, maybe you haven't - there's no way to tell. It actually sounds as if you tried various things more or less randomly, which of course is no way to get this done.

Once more: Read the GlassFish/SailFin documentation, particularly the installation instructions. Then get an example SIP servlet to run; I'm pretty sure SailFin comes with a ready-made example, and also has documentation that tells you how to install and run that.

If I were you, I'd leave Eclipse and NetBeans out of the picture until you have a clear understanding how it all works together.

Once you have an example SIP servlet working, you should be in a much better position to get your own code running.
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
I do not know what you really want from me to read ...

for an example I read the documentation about sip from different places and one of them was
http://dlc.sun.com/pdf/821-0203/821-0203.pdf

and really I have a clear Idea about the protocol itself

and when I reach the step to implement my first SipServlet I faced that exception

I do not know if you have something else for me to read , and if you have I will appreciate that

I tried google and I read most of what I found about Sip and Sip Servlet

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
Your problem is apparently that you do not know how to deploy a SIP servlet. To learn how to do that, it's no good to read about the SIP protocol or the SIP servlet API - you need to be familiar with the SIP server: SailFin. Start by searching for "SailFin documentation" - lots of good results there.
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
I will and then I will tell you what will happen with me


and I hope it will work

btw I wanna ask have you tried the SIP before ?
amer abushamma
Greenhorn

Joined: Jul 12, 2010
Posts: 10
I read the sailfin tutorial and also I read that we can use what is called mobicent with eclips and I am using this I do not if you have any Idea about the subject


cause I am seeing all what is on the init method and what is on the constructor

but when I send an invite request using X-Lite

I do not see that the doInvite method is invoked !!!

any help ?

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please i need help sipservlet