How to use Viop services with openfire for Audio & Video Calling

Help me out. Please can someone explain how to get this done

Please read and give your suggestion on it as it would be helpful for others and Also Openfire development.

Here are the steps of my solution:

1- Run an SIP server (eg. kamailio) next to openfire Jabber server.

2- Write an openfire plugin to add account to SIP server for any Openfire user with the same username and password.

3- In the client side, develop application parts to work with SIP. and login to SIP account next to the Jabber account Login.

4- Whenever client want a voice/video call try to connect to SIP server and request call using that server.

Please help me.Thanks