Exemplo n.º 1
0
    def _NH_SIPApplicationWillStart(self, sender, data):
        settings = SIPSimpleSettings()
        settings.user_agent = "%s %s (MacOSX)" % (
            NSApp.delegate().applicationName, self._version)
        BlinkLogger().log_info(u"Initializing SIP SIMPLE Client SDK %s" %
                               sdk_version)

        build = str(NSBundle.mainBundle().infoDictionary().objectForKey_(
            "CFBundleVersion"))
        date = str(NSBundle.mainBundle().infoDictionary().objectForKey_(
            "BlinkVersionDate"))
        BlinkLogger().log_info(u"Build %s from %s" % (build, date))

        self.migratePasswordsToKeychain()

        # Set audio settings compatible with AEC and Noise Supressor
        settings.audio.sample_rate = 16000
        settings.audio.tail_length = 15 if settings.audio.enable_aec else 0
        settings.save()
        BlinkLogger().log_info(
            u"Acoustic Echo Canceller is %s" %
            ('enabled' if settings.audio.enable_aec else 'disabled'))

        # Although this setting is set at enrollment time, people who have downloaded previous versions will not have it
        account_manager = AccountManager()
        for account in account_manager.iter_accounts():
            must_save = False
            if account is not BonjourAccount(
            ) and account.sip.primary_proxy is None and account.sip.outbound_proxy and not account.sip.selected_proxy:
                account.sip.primary_proxy = account.sip.outbound_proxy
                must_save = True

            if account is not BonjourAccount(
            ) and settings.tls.verify_server != account.tls.verify_server:
                account.tls.verify_server = settings.tls.verify_server
                must_save = True

            if account.tls.certificate and os.path.basename(
                    account.tls.certificate.normalized) != 'default.crt':
                account.tls.certificate = DefaultValue
                must_save = True

            if account.id.domain == "sip2sip.info":
                if account.server.settings_url is None:
                    account.server.settings_url = "https://blink.sipthor.net/settings.phtml"
                    must_save = True
                if not account.ldap.hostname:
                    account.ldap.hostname = "ldap.sipthor.net"
                    account.ldap.dn = "ou=addressbook, dc=sip2sip, dc=info"
                    account.ldap.enabled = True
                    must_save = True

            if must_save:
                account.save()

        logger = FileLogger()
        logger.start()
        self.ip_address_monitor.start()
Exemplo n.º 2
0
    def _NH_SIPApplicationWillStart(self, sender, data):
        settings = SIPSimpleSettings()
        _version = str(NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleShortVersionString"))
        settings.user_agent = "%s %s (MacOSX)" % (NSApp.delegate().applicationName, _version)
        BlinkLogger().log_debug("SIP User Agent: %s" % settings.user_agent)
        settings.save()

        self.migratePasswordsToKeychain()
        self.cleanupIcons()

        # Set audio settings compatible with AEC and Noise Suppression
        settings.audio.sample_rate = 32000 if settings.audio.echo_canceller.enabled else 48000
        if NSApp.delegate().service_provider_help_url and settings.service_provider.help_url != NSApp.delegate().service_provider_help_url:
            settings.service_provider.help_url = NSApp.delegate().service_provider_help_url
            settings.save()

        if NSApp.delegate().service_provider_name and settings.service_provider.name != NSApp.delegate().service_provider_name:
            settings.service_provider.name = NSApp.delegate().service_provider_name
            settings.save()

        BlinkLogger().log_debug("Audio engine sampling rate %dKHz covering 0-%dKHz spectrum" % (settings.audio.sample_rate/1000, settings.audio.sample_rate/1000/2))
        BlinkLogger().log_debug("Acoustic Echo Canceller is %s" % ('enabled' if settings.audio.echo_canceller.enabled else 'disabled'))

        account_manager = AccountManager()
        for account in account_manager.iter_accounts():
            must_save = False
            if account is not BonjourAccount() and account.sip.primary_proxy is None and account.sip.outbound_proxy and not account.sip.selected_proxy:
                account.sip.primary_proxy = account.sip.outbound_proxy

            if account is not BonjourAccount() and settings.tls.verify_server != account.tls.verify_server:
                account.tls.verify_server = settings.tls.verify_server

            if account.tls.certificate and os.path.basename(account.tls.certificate.normalized) != 'default.crt':
                account.tls.certificate = DefaultValue

            if account.rtp.encryption_type == '':
                account.rtp.encryption.enabled = False
            elif account.rtp.encryption_type == 'opportunistic':
                account.rtp.encryption.enabled = True
                account.rtp.encryption.key_negotiation = 'opportunistic'
            elif account.rtp.encryption_type == 'sdes_optional':
                account.rtp.encryption.enabled = True
                account.rtp.encryption.key_negotiation = 'sdes_optional'
            elif account.rtp.encryption_type == 'sdes_mandatory':
                account.rtp.encryption.enabled = True
                account.rtp.encryption.key_negotiation = 'sdes_mandatory'
            elif account.rtp.encryption_type == 'zrtp':
                account.rtp.encryption.enabled = True
                account.rtp.encryption.key_negotiation = 'zrtp'
            account.save()

        logger = FileLogger()
        logger.start()
        self.ip_address_monitor.start()
Exemplo n.º 3
0
    def _NH_SIPApplicationWillStart(self, sender, data):
        settings = SIPSimpleSettings()
        settings.user_agent = "%s %s (MacOSX)" % (NSApp.delegate().applicationName, self._version)
        BlinkLogger().log_info(u"Initializing SIP SIMPLE Client SDK %s" % sdk_version)

        build = str(NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleVersion"))
        date = str(NSBundle.mainBundle().infoDictionary().objectForKey_("BlinkVersionDate"))
        BlinkLogger().log_info(u"Build %s from %s" % (build, date))

        self.migratePasswordsToKeychain()

        # Set audio settings compatible with AEC and Noise Supressor
        settings.audio.sample_rate = 16000
        settings.audio.tail_length = 15 if settings.audio.enable_aec else 0
        settings.save()
        BlinkLogger().log_info(u"Acoustic Echo Canceller is %s" % ('enabled' if settings.audio.enable_aec else 'disabled'))

        # Although this setting is set at enrollment time, people who have downloaded previous versions will not have it
        account_manager = AccountManager()
        for account in account_manager.iter_accounts():
            must_save = False
            if account is not BonjourAccount() and account.sip.primary_proxy is None and account.sip.outbound_proxy and not account.sip.selected_proxy:
                account.sip.primary_proxy = account.sip.outbound_proxy
                must_save = True

            if account is not BonjourAccount() and settings.tls.verify_server != account.tls.verify_server:
                account.tls.verify_server = settings.tls.verify_server
                must_save = True

            if account.tls.certificate and os.path.basename(account.tls.certificate.normalized) != 'default.crt':
                account.tls.certificate = DefaultValue
                must_save = True

            if account.id.domain == "sip2sip.info":
                if account.server.settings_url is None:
                    account.server.settings_url = "https://blink.sipthor.net/settings.phtml"
                    must_save = True
                if not account.ldap.hostname:
                    account.ldap.hostname = "ldap.sipthor.net"
                    account.ldap.dn = "ou=addressbook, dc=sip2sip, dc=info"
                    account.ldap.enabled = True
                    must_save = True

            if must_save:
                account.save()

        logger = FileLogger()
        logger.start()
        self.ip_address_monitor.start()
Exemplo n.º 4
0
    def _NH_SIPApplicationWillStart(self, sender, data):
        settings = SIPSimpleSettings()
        _version = str(NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleShortVersionString"))
        settings.user_agent = "%s %s (MacOSX)" % (NSApp.delegate().applicationName, _version)
        BlinkLogger().log_info(u"SIP User Agent: %s" % settings.user_agent)

        self.migratePasswordsToKeychain()
        self.cleanupIcons()

        # Set audio settings compatible with AEC and Noise Supressor
        settings.audio.sample_rate = 32000 if settings.audio.echo_canceller.enabled else 48000
        if NSApp.delegate().applicationName == 'SIP2SIP':
            settings.service_provider.help_url  = 'http://wiki.sip2sip.info'
            settings.service_provider.name = 'SIP2SIP'
        settings.save()
        BlinkLogger().log_info(u"Audio engine sampling rate %dKHz covering 0-%dKHz spectrum" % (settings.audio.sample_rate/1000, settings.audio.sample_rate/1000/2))
        BlinkLogger().log_info(u"Acoustic Echo Canceller is %s" % ('enabled' if settings.audio.echo_canceller.enabled else 'disabled'))

        # Although this setting is set at enrollment time, people who have downloaded previous versions will not have it
        account_manager = AccountManager()
        for account in account_manager.iter_accounts():
            must_save = False
            if account is not BonjourAccount() and account.sip.primary_proxy is None and account.sip.outbound_proxy and not account.sip.selected_proxy:
                account.sip.primary_proxy = account.sip.outbound_proxy
                must_save = True

            if account is not BonjourAccount() and settings.tls.verify_server != account.tls.verify_server:
                account.tls.verify_server = settings.tls.verify_server
                must_save = True

            if account.tls.certificate and os.path.basename(account.tls.certificate.normalized) != 'default.crt':
                account.tls.certificate = DefaultValue
                must_save = True

            if must_save:
                account.save()

        logger = FileLogger()
        logger.start()
        self.ip_address_monitor.start()