[sip-comm-dev] MacOSX and registering SC as default sip: handler

Hi,

these days I was trying to make use of the argument passing to SIP Communicator which Emil recently committed. I was trying to register sip and feed protocol url handlers. But I faced some problems.

At first I started using some JNI and catching Apple Events. But a problem came : for example the application is not started and you click sip link in the browser which starts the application - apple events are not delivered. It seems that as java is running on second thread the event is missed while starting.

My second approach was creating a simple native application which is registered for those events and when it receive such, it starts SIP Communicator by passing command line arguments. But here came up more problems :slight_smile:
When SC is installed from dmg package the second application is not in /Application folder, but in subfolder of SC resources and it seems the OS doesn't read and doesn't register the protocol url handlers. (Registering those handlers maybe forced if you open the application yourself).
The second problem is that if the application is not started and again you start it from browser the events and arguments passed to SC are ok, but if you try clicking on a link in the browser for second time nothing happens as the application receives the apple events and tries to start SC for second time but on Mac java applications are single instance and so nothing happens.

I just came up with a third approach. But with this one all current dmg structure must be changed. The thing is to switch the places of the applications the main one to be the URLHandler and the inner one to be current SC. This way the application will be in /Applications and will register for url handler after install. The application will start SC every time (will be as a launcher :wink: ) but when event is received will communicate with SC through Socket (as currently arguments are handled in SC on a second run of the application).

Any ideas and suggestions are really welcome :slight_smile:

Thanks
damencho

P.S. By the way URLHandler is committed.

···

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

Hi Damian,

I just came up with a third approach. But with this one all current dmg structure must be changed. The thing is to switch the places of the applications the main one to be the URLHandler and the inner one to be current SC. This way the application will be in /Applications and will register for url handler after install. The application will start SC every time (will be as a launcher :wink: ) but when event is received will communicate with SC through Socket (as currently arguments are handled in SC on a second run of the application).

I guess you mean changing the .app structure (not the dmg)? I'm fine with changing it - this is not frozen, at the time I first built it I simply took examples from other applications. As long as your solution work it's fine with me :slight_smile:

However you should note that some of the structure of the app is automatically built by JarBundler, so you may not be able to do whatever you want.

You may also have a look at the Azureus application for MAC (which is launched when clicking on "magnet links" from bittorent websites) to check how they handle this problem.

Cheers,

···

On 2008/09/11, at 12:03, Damian Minkov wrote:
--
Romain KUNTZ
kuntz@lsiit.u-strasbg.fr
LSIIT - Networks and Protocols Team
http://clarinet.u-strasbg.fr/~kuntz/

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

Romain KUNTZ wrote:

Hi Damian,

I just came up with a third approach. But with this one all current dmg structure must be changed. The thing is to switch the places of the applications the main one to be the URLHandler and the inner one to be current SC. This way the application will be in /Applications and will register for url handler after install. The application will start SC every time (will be as a launcher :wink: ) but when event is received will communicate with SC through Socket (as currently arguments are handled in SC on a second run of the application).

I guess you mean changing the .app structure (not the dmg)? I'm fine with changing it - this is not frozen, at the time I first built it I simply took examples from other applications. As long as your solution work it's fine with me :slight_smile:

Yes thats what I mean, .app structure :slight_smile:

You may also have a look at the Azureus application for MAC (which is launched when clicking on "magnet links" from bittorent websites) to check how they handle this problem.

Applications running swt or cocoon or something other than swing does not have this problems. As those applications runs on the first thread and doesn't miss apple events on startup.

Cheers
damencho

···

On 2008/09/11, at 12:03, Damian Minkov wrote:

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