Now that you have a GUI, and the necessary library's, you have to make two constructs; the UA and the Session. The UA is the user agent, and can be seen as the part that makes the registration with the server. The Session on the other hand is the "call".


In the attached file you will see the completed demo phone.


The User Agent is constructed as follows and once constructed will perform the register:


var myAuth = $("#authname").val();

var dispName = $("#dispname").val();

var myPassword = $("#password").val();

var wssServer = $("#server").val();


userAgent = new SIP.UA({

    displayName: dispName,

    uri: myAuth + "@" + wssServer,

    wsServers: "wss://"+ wssServer +":443",

    traceSip: true,

    authorizationUser: myAuth,

    password: myPassword,

    registerExpires: 1800,

    hackWssInTransport: true, // Required!

    stunServers: wssServer,

    keepAliveInterval : 59

});


Calling on the other hand is done as follows with the invite() method :


session = userAgent.invite("sip:" + $("#touser").val() + "@" + $("#server").val(), {

    media: {

        constraints: 

            audio: true, 

            video: false

        },

        render: {

            remote: $("#remoteAudio").get(0)

        }

    }

});