Skip to main content

Sip Application

4 replies [Last post]
opu
Offline
Joined: 2007-12-10
Points: 0

Can anyone tell me about creating sip application using the

import nist.javax.microedition.sip

I am getting ClassCastExcepiton when this line is executing

SipConnectionNotifier scn=(SipConnectionNotifier)Connector.open("sip:1234");

any help would be appreciated

Regards
Opu

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15
Points: 0

The obvious first task, you should find out what is being sent back and why is it a class cast exception.

Also which version of the WTK are you using, 2.5.2? I think that it or maybe 2.5.1 was the first to support the sip protocol. You must also have SIP selected as a supported JSR.

Is there a reason you area importing nist.javax.microedition.sip and not just using the javax.microedition.sip? Also doesn't your import need to have a .*; at the end?

You should look at the SIP demos that are provided in the WTK they can help get you over the initial learning curve.

Regards,
-Shawn

opu
Offline
Joined: 2007-12-10
Points: 0

Thanx sfitzjava for your reply.

I am using wtk2.5.2 (which is in NetBeans 6).

obviously i used import nist.javax.microedition.sip.*; otherwise i could found compile time error.

problem is that all are ok and fine before executing the line

SipConnectionNotifier scn=(SipConnectionNotifier)Connector.open("sip:1234");

and i know that using import javax.microedition.sip.*; works fine. i just want to use

import nist.javax.microediton.sip.*:

If anyone have such experience about that import statement please do reply

it would be really very much helpful for me

Regard
opu

Message was edited by: opu

sfitzjava
Offline
Joined: 2003-06-15
Points: 0

Okay so now you need to find out what class is being passed back from your Connector.open() statement. This should give you a clue as to what the issues are.
Also to confirm you are using port 1234, and not something less than 1024 right?

However in googling around I found this posting on the sip-for-me discussion forum should give you concern in using this project without downloading the source and becoming familiar with it.
https://sip-for-me.dev.java.net/servlets/ReadMsg?listName=users&msgNo=4

So it appears that there is no workaround without Tweaking the code. But it's open source so there is nothing stopping you from doing just that.

If I were to speculate I think you will find that what is being returned is the javax.microedition.sip.SipConnectionNotifier, and not the nist.javax.microedition.sip.SipConnectionNotifier which you are trying to cast to. If this is the case then you can try a few things to see if they work, such as:
-Turn off JSR-180 support from your build and see if that helps.
-Import only those classes from the nist package that you need but not the SipConnectionNotifier, and import the standard Javax....sip.SipConnectionNotifier.
- You may need to have the nist.javax...sip.SipConnectionNotifier extends the javax..sip one.

But you should take a closer look at the source for the nist package. But just using jsr180 is going to solve the problem and is the standard, so the question I am asking is why use the NIST package, and can that requirement be removed to use the standard JSR180 implementation.

-Shawn

opu
Offline
Joined: 2007-12-10
Points: 0

Thanks sfitzjava again..

I removed the jsr180 library from lib folder of netbeans...but it gives me same result...

please if anyone has the experience with
nist.javax.microedition.sip package do reply...it will work for sip....

Regards
Opu
apu_02cse@yahoo.com