versatica / tryit-jssip

New tryit-jssip application
https://tryit.jssip.net
Other
88 stars 102 forks source link

window.SETTINGS deepmerge fails #20

Closed juha-h closed 5 years ago

juha-h commented 5 years ago

I removed comments from index.html window.SETTINGS (below) and after that I get to console error:

tryit-jssip:settingsManager window.SETTINGS found +0ms tryit-jssip.js:6775:4
TypeError: can't assign to property "arrayMerge" on true: not an object umd.js:75 

It works if I replace the deepmerge stuff with simple assignment:

if (window.SETTINGS) {
  logger.debug('window.SETTINGS found');
  // settings = (0, _deepmerge.default)(window.SETTINGS, settings || {}, true);
  settings = window.SETTINGS;
} // If not settings are found, clone default ones

My window.SETTINGS look like this:

            window.SETTINGS =
            {
            display_name        : 'Test',
            uri                 : 'sip:test@test.tutpro.com',
            password            : 'xxxxxx',
            socket              :
                {
                    uri           : 'wss://test.tutpro.com:443/wss/',
                    via_transport : 'auto',
                },
            registrar_server    : null,
            contact_uri         : null,
            authorization_user  : null,
            instance_id         : null,
            session_timers      : true,
            use_preloaded_route : false,
            pcConfig            :
                {
                    rtcpMuxPolicy : 'negotiate',
                    iceServers    :
                    [
                        { urls : [ 'stun:stun.l.google.com:19302' ] }
                    ]
                },
            callstats           :
                {
                    enabled   : false,
                    AppID     : null,
                    AppSecret : null
                }
            };
juha-h commented 5 years ago

Thanks, I tested and now everything worked OK. Juha