Want to use Already connected socket again for next call

151 views
Skip to first unread message

man...@phonon.in

unread,
Nov 8, 2014, 3:01:47 AM11/8/14
to eas...@googlegroups.com
Hello,

I am working on easyrtc application for video calls.
I have two sides in my application, like an agent and visitor.

Now, an agent must be logged in all the time and visitor end can call at any time to agent.
Once agent receives a call, call gets connected. After call is completed, call is disconnect by either agent or user.

At this time agent is already connected with self video and waiting for other visitor call request.
When second request comes, I get error as:

Attempt to connect when already connected to socket server

I tried to find on net about:
easyrtc.useThisSocketConnection()

I tried using it, but it didn't worked for me.
Need quick help.

Thanks & Regards,
Mandar.

gianni

unread,
Nov 8, 2014, 6:20:47 AM11/8/14
to eas...@googlegroups.com
Each user need to connect only once, if you try to connect while connected then you get the error "Attempt to connect when already connected to socket server".
Once users are initially connected to the signaling server you use easyrtc.call to establish connections between them.
easyrtc.hangup (otheruser) drops the connection with otheruser but you both stay connected to the server.
If for some reason you want to disconnect from the server there is easyrtc.disconnect for that and then you can use easyrtc.connect again.

man...@phonon.in

unread,
Nov 8, 2014, 7:40:22 AM11/8/14
to eas...@googlegroups.com
Hello,

Thanks gianni.

I don't  want to disconnect user from signaling server, but just want to check that is still connected with server.
How will I be able to do the check that even after call ended, user is still connected with then I can call only "easyrtc.call" instead of "easyrtc.connect".
Because after every call my page gets reloaded and the easyrtc connect function is called again.
If I would be able to check after reload that user is still connected with signaling server, I can perform just the call not connect.

Thanks.
Mandar.

gianni

unread,
Nov 8, 2014, 8:41:21 AM11/8/14
to
easyrtc.getRoomOccupantsAsMap('roomName') and easyrtc.getRoomOccupantsAsArray('roomName') will give you the connected users so if you know the username or easyrtcId you can check if a user is connected or not.

Also consider that easyrtcId changes each time a user connects, so you should avoid reloading pages. You can just play with the elements in your page after a call is ended, clear them, hide them etc.

If you have to reload ... then you can use iframes where the main page is stable and holds your environment and your iframes when reloaded can access their parent environment.

When you make a call with easyrtc.call, the  callSuccessCB, callFailureCB, wasAcceptedCB callback functions will inform you about the result of your call so you can proceed depending on the result.

Look into the easyrtc demo apps where you can see a lot of examples.




Reply all
Reply to author
Forward
0 new messages