[sip-comm-dev] SipStackSharing and custom sip stack properties


#1

Hi!

I'm trying to use some Sip Communicator java bundles as a hi-level jain-api implementation. Now it's not too easy to do, because existing interfaces don't allow some extending and tuning.

For example, net.java.sip.communicator.impl.protocol.sip.SipStackSharing has only one internal constructor which creates SipStackProperties instance with predefined values inside. Then it creates sip stack using these properties. It seems that there is no possibility to replace these properties with my custom ones.

May be it would be better to add an alternative constructor receiving Properties as argument?

Cheers,

Anton Nehaev

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hey Anton,

На 09.10.10 14:28, Anton Nehaev написа:

Hi!

I'm trying to use some Sip Communicator java bundles as a hi-level
jain-api implementation. Now it's not too easy to do, because existing
interfaces don't allow some extending and tuning.

For example, net.java.sip.communicator.impl.protocol.sip.SipStackSharing
has only one internal constructor which creates SipStackProperties
instance with predefined values inside. Then it creates sip stack using
these properties. It seems that there is no possibility to replace these
properties with my custom ones.

May be it would be better to add an alternative constructor receiving
Properties as argument?

Could you please tell us a bit more about your use case? Adding an extra
constructor to SipStackSharing won't make it any more usable by other
bundles since the class is not exported by the SIP implementation. Can
you tell us how you are using it?

Cheers,
Emil

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Emil,

Generally I'm trying to make a SIP bot that can receive and send voice messages. In order to do this I need some java library which can deal with all related protocols (SIP, SDP, RTP). As far as I can see SC is the best hi-level SIP implementation on java.

But SC isn't just a library. It's a multiprotocol client with GUI. In my case there is no need neither for other IM protocols nor for a GUI. In my case I need a few bundles like protocol-sip, neomedia and some their dependencies (plus some native libs).

The problem for me is to isolate SIP implementation bundles from others (ui-service, resourcemanager, etc.) For this purpose I extend (in my project) classes like ProtocolProviderServiceSipImpl, CallPeerMediaHandlerSipImpl by overriding some methods. For example initialize() in ProtocolProviderServiceSipImpl loads sip status icons via resourcemanager, but I can not see quite well why we need them in right protocol initialization, so I remove this in my overridden method.

SipStackSharing creates sip stack with custom SslNetworkLayer which depends on GUI model. In case of SipStackSharing "evil" is done in constructor without args, and I can not override it in descendant because parent's constructor would be called anyway. In previous letter I proposed the easiest way to correct that (you have to change almost nothing) and make sip stack customization possible. One more variant is to create sip stack in method like initialize() or start() instead of constructor, so it would be easy to override.

Cheers,

Anton Nehaev

···

On Tue, 12 Oct 2010 12:51:09 +0400, Emil Ivov <emcho@sip-communicator.org> wrote:

Hey Anton,

�� 09.10.10 14:28, Anton Nehaev ������:

Hi!

I'm trying to use some Sip Communicator java bundles as a hi-level
jain-api implementation. Now it's not too easy to do, because existing
interfaces don't allow some extending and tuning.

For example, net.java.sip.communicator.impl.protocol.sip.SipStackSharing
has only one internal constructor which creates SipStackProperties
instance with predefined values inside. Then it creates sip stack using
these properties. It seems that there is no possibility to replace these
properties with my custom ones.

May be it would be better to add an alternative constructor receiving
Properties as argument?

Could you please tell us a bit more about your use case? Adding an extra
constructor to SipStackSharing won't make it any more usable by other
bundles since the class is not exported by the SIP implementation. Can
you tell us how you are using it?

Cheers,
Emil


#4

Hi!

Here is the patch with changes making sip stack properties tunable.

It contains additional SipStackSharing constructor receiving Properties as argument.

Hope, this patch would help SC sip library become more extensible.

Cheers,

Anton Nehaev

SipStackSharing.patch (2.43 KB)

···

On Wed, 13 Oct 2010 13:51:18 +0400, Anton Nehaev <gospodinn@gmail.com> wrote:

Hi Emil,

Generally I'm trying to make a SIP bot that can receive and send voice messages. In order to do this I need some java library which can deal with all related protocols (SIP, SDP, RTP). As far as I can see SC is the best hi-level SIP implementation on java.

But SC isn't just a library. It's a multiprotocol client with GUI. In my case there is no need neither for other IM protocols nor for a GUI. In my case I need a few bundles like protocol-sip, neomedia and some their dependencies (plus some native libs).

The problem for me is to isolate SIP implementation bundles from others (ui-service, resourcemanager, etc.) For this purpose I extend (in my project) classes like ProtocolProviderServiceSipImpl, CallPeerMediaHandlerSipImpl by overriding some methods. For example initialize() in ProtocolProviderServiceSipImpl loads sip status icons via resourcemanager, but I can not see quite well why we need them in right protocol initialization, so I remove this in my overridden method.

SipStackSharing creates sip stack with custom SslNetworkLayer which depends on GUI model. In case of SipStackSharing "evil" is done in constructor without args, and I can not override it in descendant because parent's constructor would be called anyway. In previous letter I proposed the easiest way to correct that (you have to change almost nothing) and make sip stack customization possible. One more variant is to create sip stack in method like initialize() or start() instead of constructor, so it would be easy to override.

Cheers,

Anton Nehaev

On Tue, 12 Oct 2010 12:51:09 +0400, Emil Ivov > <emcho@sip-communicator.org> > wrote:

Hey Anton,

�� 09.10.10 14:28, Anton Nehaev ������:

Hi!

I'm trying to use some Sip Communicator java bundles as a hi-level
jain-api implementation. Now it's not too easy to do, because existing
interfaces don't allow some extending and tuning.

For example, net.java.sip.communicator.impl.protocol.sip.SipStackSharing
has only one internal constructor which creates SipStackProperties
instance with predefined values inside. Then it creates sip stack using
these properties. It seems that there is no possibility to replace these
properties with my custom ones.

May be it would be better to add an alternative constructor receiving
Properties as argument?

Could you please tell us a bit more about your use case? Adding an extra
constructor to SipStackSharing won't make it any more usable by other
bundles since the class is not exported by the SIP implementation. Can
you tell us how you are using it?

Cheers,
Emil


#5

Hey Anton,

I am sorry for not replying to your earlier e-mail. Things have been busy.

На 20.10.10 22:24, Anton Nehaev написа:

Here is the patch with changes making sip stack properties tunable.

It contains additional SipStackSharing constructor receiving Properties as
argument.

Hope, this patch would help SC sip library become more extensible.

Thanks. However, ProtocolProviderService-s are supposed to be accessed
via their public interfaces only. SipStackSharing is not part of our
public API and its not meant for use by anyone else but the provider
implementation itself.

By extending classes like ProtocolProviderServiceSipImpl and
CallPeerMediaHandlerSipImpl, you are simply reusing source code in a use
case that's slightly different from what it was originally meant for.
That's perfectly fine of course, but there's no reason for us to modify
the original: people would still need to make modifications in order to
use it the way you are.

See what I mean?

Cheers,
Emil

···

Cheers,

Anton Nehaev

On Wed, 13 Oct 2010 13:51:18 +0400, Anton Nehaev <gospodinn@gmail.com> > wrote:

Hi Emil,

Generally I'm trying to make a SIP bot that can receive and send voice
messages. In order to do this I need some java library which can deal
with all related protocols (SIP, SDP, RTP). As far as I can see SC is
the best hi-level SIP implementation on java.

But SC isn't just a library. It's a multiprotocol client with GUI. In my
case there is no need neither for other IM protocols nor for a GUI. In
my case I need a few bundles like protocol-sip, neomedia and some their
dependencies (plus some native libs).

The problem for me is to isolate SIP implementation bundles from others
(ui-service, resourcemanager, etc.) For this purpose I extend (in my
project) classes like ProtocolProviderServiceSipImpl,
CallPeerMediaHandlerSipImpl by overriding some methods. For example
initialize() in ProtocolProviderServiceSipImpl loads sip status icons
via resourcemanager, but I can not see quite well why we need them in
right protocol initialization, so I remove this in my overridden method.

SipStackSharing creates sip stack with custom SslNetworkLayer which
depends on GUI model. In case of SipStackSharing "evil" is done in
constructor without args, and I can not override it in descendant
because parent's constructor would be called anyway. In previous letter
I proposed the easiest way to correct that (you have to change almost
nothing) and make sip stack customization possible. One more variant is
to create sip stack in method like initialize() or start() instead of
constructor, so it would be easy to override.

Cheers,

Anton Nehaev

On Tue, 12 Oct 2010 12:51:09 +0400, Emil Ivov >> <emcho@sip-communicator.org> >> wrote:

Hey Anton,

На 09.10.10 14:28, Anton Nehaev написа:

Hi!

I'm trying to use some Sip Communicator java bundles as a hi-level
jain-api implementation. Now it's not too easy to do, because existing
interfaces don't allow some extending and tuning.

For example,
net.java.sip.communicator.impl.protocol.sip.SipStackSharing
has only one internal constructor which creates SipStackProperties
instance with predefined values inside. Then it creates sip stack using
these properties. It seems that there is no possibility to replace
these
properties with my custom ones.

May be it would be better to add an alternative constructor receiving
Properties as argument?

Could you please tell us a bit more about your use case? Adding an extra
constructor to SipStackSharing won't make it any more usable by other
bundles since the class is not exported by the SIP implementation. Can
you tell us how you are using it?

Cheers,
Emil

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net