====== onError() ====== wrtc.onError() is an event function called when wrtc_kit has encountered an error. You can write your own wrtc.onError() function to alert the user about the occurred error. ===== Arguments ===== wrtc.onError(obj, err) * obj - call object involved in the event, or null if no applicable call object found * err - JSON structure containing information about the error: {errorCode:..., errorMsg:...} * errorCode - error number * errorMsg - string containing error description in English ^ errorCode ^ errorMsg ^ Description: ^ | 111 | "Not enough resources" | setting up a new call | | 112 | "Not enough resources" | setting up a new call | | 113 | "Already in group call" | group call requested but client is already in another group call | | 115 | "Group call not supported" | attempting group call ([[ixnx:wrtc:js:switch_client|workaround]]) | | 151 | "001: File transmit aborted" | file transmit aborted by sender (err.fileName contains file name) | | 151 | "101: Packet order mismatch" | file packets received in wrong order (err.fileName contains file name) | | 151 | "523: File transmit failed" | file transmit aborted by IXNX unit, sender and recipient not on same server | | 191 | "Audio output: " | audio output selection failed | | 201 | "browser reports Internet connection error" | Internet connection problems | | 202 | "browser reports Internet connection closed" | Internet connection problems | | 203 | "browser reports Internet connection timeout" | Internet connection problems | | 281 | "media change (new SDP) not supported by your browser" | browser does not support change of media during call | | 281 | "media change (new SDP) not supported by remote browser" | browser does not support change of media during call | | 291 | "browser reports ICE fail" | Internet connection problems | | 301 | "browser reports " | local SDP rejected | | 311 | "dataChannel not supported by browser" | [[ixnx:wrtc:js:data_channel|data channel]] could not be added to call | | 351 | "browser reports " | received SDP rejected | | 352 | "Offer with invalid group ID from " | [[ixnx:wrtc:js:api:wrtc:invitegroup|wrtc.inviteGroup()]] | | 400 | "Incorrect joingroup link" | supplied gid and gc_gid doesn't match | | 401 | "browser reports " | SDP to be sent could not be created | | 451 | "browser reports " | answer SDP could not be created | | 502 | "ICE fail reported by browser confirmed" | Internet connection problems | | 503 | "Voice Bridge not found, group call not possible" | could not connect to group call server | | 603 | "group call request but not in call with " | a user we are not in call with requested a group call | | 703 | "browser reports getScreen not available" | [[ixnx:wrtc:js:api:wrtc:getscreen|wrtc.getScreen()]] | | other error messages may also occur ||| ===== Return value ===== Ignored. ===== Example ===== wrtc.onError = function(obj, err) { if (err.errorCode > 0) window.alert("ERROR " + err.errorCode + ": " + err.errorMsg); } ===== Advanced ===== Errors from call object with error numbers higher than 300 are considered to be fatal, call cannot continue. You should end the call. wrtc.onError = function(obj, err) { if (err.errorCode > 0) window.alert("ERROR " + err.errorCode + ": " + err.errorMsg); if ((err.errorCode > 300) && (obj) && (obj.objType == "call")) obj.denyCall(); } ===== ICE fail ===== Error ICE fail means no media connection could be established through a firewall (usually at the other end of the connection). There are three different errors that can occur: * either you get an error 501 (browser reports ICE failed) immediately, meaning connection could not be established. It is a fatal error, call cannot be connected and continue. * or you first get an error 291 (browser reports ICE fail) first, meaning browser could not make the connection - but wrtc_kit will try using different Internet connection (when user has multiple ones). If still no connection an error 501 (ICE fail reported by browser confirmed) will occur, making it final, fatal. If you use the if err.errorCode > 300 rule described in chapter Advanced above the first 291 error will just be displayed, but the final 501 error will cut the call (as it is non-connected anyway).