What classes from Jain SIP (java) should I use to make an SIP client?
Asked Answered
S

2

6

I am asking to create an SIP client, but I am totally lost ... After some researches I found the Jain SIP API in java, and I think that I will use it. However I don't really know what classes I should use and what interfaces I should implement or not.

I have read this article : http://www.oracle.com/technetwork/articles/entarch/introduction-jain-sip-090386.html

And this : http://hudson.jboss.org/hudson/job/jain-sip/lastSuccessfulBuild/artifact/javadoc/javax/sip/package-summary.html#package_description

But I don't understand which part should I implement for an SIP client ? The SipListener OR the SipStack and the SipProvider ?

Thanks.

Shela answered 22/4, 2013 at 15:54 Comment(1)
Did any answer helped you?Bilocular
B
8

You need to implement both of those classes.

The SipProvider class will connect to your endpoint (Aterisk, for example). Note that this class must be on an static context, because only one connection is allowed per client.

You cant create a SipProvider instance calling a SipStack class, on sipStack.createSipProvider(listeningPoint). After this, you be able to create transactions and send requests to you endpoint.

The SipListener is the class that will process all responses from your server. This means that every request that you send to the server (Via SipProvider) will receive a response on SipListener. So, you must have this listener to process all data returned by your endpoint.

Try to implement the code that was described on oracle article that you cite. I started to develop based on this article, and works very fine!

Bilocular answered 22/4, 2013 at 16:56 Comment(2)
Thank you very much for your help and the description you gave me, it has helped me a lot !Shela
I am working on the same code. For the ip, I set my local ip and it worked fine. When I tried changing the ip to the ip of the machine on which a sip server is running, the project threw exceptions saying cannot bind to the address. When i pinged that ip from command line, I was getting a quick response. When I further debugged, I found that the exception is thrown on this line: sipStack.createListeningPoint. Could someone please point out what properties should I set or what changes should I make to make it work?Krein
B
6

Check the examples at the Reference Implementation https://java.net/projects/jsip/sources/svn/show/trunk/src/examples?rev=2279 to help you moving forward faster

Betti answered 23/4, 2013 at 9:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.