====== onLoggedIn() ======
wrtc.onLoggedIn() is an event function called when when IXNX server has accepted you and you are ready to make and receive calls.
You should use the event to check if server has changed your name, and to indicate to user she can start make calls.
The IXNX server may change your addressName and displayName upon login.
Eg if you had wrtc.addressName="john.doe" before login server may change your name to "john.doe@company.com" \\
wrtc.addressName is then still unchanged but the connection to server will use your new server-given name. \\
The new given name is stored in line.addressName
If you display user's address or displayname somewhere then you should change it to this received given name.
If you use [[ixnx:wrtc:js:digest_authentication_sequence|digest authentication]] wrtc.onLoggedIn() is a good place to save [[ixnx:wrtc:js:api:wrtc:sipha1|wrtc.sipHa1]] to the cookie.
===== Occurs =====
When you have logged in.
===== Arguments =====
wrtc.onLoggedIn(arg)
* arg - JSON structure {addressName:..., displayName:...}
* addressName - (optional) string containing your username if server has changed it
* displayName - (optional) string containing your descriptive display name if server has changed it
One or both arguments may be missing. If name has not changed empty arg structure is returned.
===== Return value =====
Ignored.
===== Example =====
If server has changed our [[ixnx:wrtc:js:api:wrtc:addressname|addressName]] or [[ixnx:wrtc:js:api:wrtc:displayname|displayName]] we need to change it globally, to affect all future calls.
wrtc.onLoggedIn = function(arg) {
...
if (arg.addressName)
wrtc.addressName = arg.addressName;
if (arg.displayName)
wrtc.displayName = arg.displayName;
...
}
wrtc.onLoggedIn() is also a good place to save password hashsum [[ixnx:wrtc:js:api:wrtc:sipha1|wrtc.sipHa1]] to be used for future [[ixnx:wrtc:js:digest_authentication_sequence|digest logins]]. If user has entered a new [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] a new wrtc.sipHa1 has just been calculated (as part of the login process) and server has approved it as valid.
wrtc.onLoggedIn = function(arg) {
...
document.cookie= "sipHa1=" + wrtc.sipHa1 + "; expires=Fri, 31 Dec 9999 23:59:59 GMT";
...
}
===== See Also =====
[[ixnx:wrtc:js:api:wrtc:onauthenticatefailed|wrtc.onAuthenticateFailed()]]
[[ixnx:wrtc:js:api:wrtc:addressname|wrtc.addressName]]
[[ixnx:wrtc:js:api:wrtc:displayname|wrtc.displayName]]
[[ixnx:wrtc:js:api:wrtc:sipha1|wrtc.sipHa1]]
[[ixnx:wrtc:js:digest_authentication_sequence|Digest Authentication Sequence]]