Skip to first unread message

arul murugan

unread,
Apr 7, 2017, 12:47:59 PM4/7/17
to EasyRTC

Hi ,

I need help for custom easyrtcid, because i make a call from my brwoser using mailid.
first i type and register my mail id as easyrtcid,then another text field i type my friend mailid and make a call.

util js generate random number as easyrtcid

eu.getAvailableEasyrtcid = function() {
    var newEasyrtcid = "";
    var easyrtcidExists = false;

    do {
        newEasyrtcid = g.randomString();
        easyrtcidExists = false;
        for (var key in e.app) {
            if (e.app[key].connection[newEasyrtcid]) {
                easyrtcidExists = true;
                break;
            }
        }
    } while (easyrtcidExists);

    return newEasyrtcid;
};

how do I Pass My Mail Id to this function:

pub.socketServer.sockets.on("connection", function (socket) {
                //var easyrtcid = pub.util.getAvailableEasyrtcid();
                var easyrtcid = pub.util.getAvailableEasyrtcid();

                console.error("id is: "+easyrtcid+"    ***********************  ");
                pub.util.logDebug("["+easyrtcid+"]["+socket.id+"] Socket connected");
                pub.util.logDebug("Emitting event 'connection'");
                pub.events.emit("connection", socket, easyrtcid, function(err){
                    if(err){
                        socket.disconnect();
                        pub.util.logError("["+easyrtcid+"] Connect error", err);
                    }
                });
            });
            callback(null);
        },


I have retrive my mailid from my own javascript file how to send to this easyrtc_default_event_listener.js.

Eric Davies

unread,
Apr 7, 2017, 1:15:56 PM4/7/17
to EasyRTC
Easyrtcids are websocket ids. The server doesn't do any extra mapping and it would be a mess to add that. The easyrtc server already guarantees that easyrtcids are unique.

If you want your own ids, either use the username or a room api field and wrap whatever client functions you need to perform the mapping back and forth between your ids and the easyrtcids.

Reply all
Reply to author
Forward
0 new messages