xyj70 / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

smtp settings are missing at core/default_settings/default_settings.php #317

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Checkout fusionpbx from svn and install it
2. Go to Advanced->Default Settings.

What is the expected output? What do you see instead?
The 'Email' category with smtp settings is missing.

What version of the product are you using? On what operating system?
r2820, r2781, r2782

Please provide any additional information below.
The issue is reproducible starting from r2782. r2781 works fine.

BTW, shouldn't 'Email' category be defined in install.sh as all three other 
categories which are also placed in the v_default_settings table?

Original issue reported on code.google.com by Vitaly.T...@gmail.com on 9 Sep 2012 at 11:48

GoogleCodeExporter commented 9 years ago
I just did an installation on the Raspberry Pi and the email category under 
default settings does exit.

Original comment by markjcrane@gmail.com on 9 Sep 2012 at 10:57

GoogleCodeExporter commented 9 years ago
On the Raspbery Pi I'm using sqlite and it is definitely defining the variables 
in advanced -> default settings on r2820. 

It might have to do with the database? What database are you using?

BTW, shouldn't 'Email' category be defined in install.sh as all three other 
categories which are also placed in the v_default_settings table?

As far as I'm concerned its not the job of the install script to write anything 
to the database. I can't depend on one or any script to do this because there 
are many operating systems that FusionPBX supports. It would be far better to 
ask this information in the FusionPBX install.php.

Original comment by markjcrane@gmail.com on 9 Sep 2012 at 11:07

GoogleCodeExporter commented 9 years ago
I'm using MySQL and Ubuntu 12.04 LTS.

I've just re-installed r1820 twice. In the first case there was Email section, 
in the second case there wasn't :)
In the first case I had freeswitch running, in the second it was shut down.
Could stopped freeswitch cause the problem?

As far as I can see, install.sh writes a lot to the database.
Below is an extract from install.sh which fills v_default_settings with all 
categories but 'Email':

//add the default settings
        $x = 0;
        $tmp[$x]['name'] = 'uuid';
        $tmp[$x]['value'] = $menu_uuid;
        $tmp[$x]['category'] = 'domain';
        $tmp[$x]['subcategory'] = 'menu';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'name';
        $tmp[$x]['category'] = 'domain';
        $tmp[$x]['subcategory'] = 'time_zone';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'name';
        $tmp[$x]['value'] = $install_template_name;
        $tmp[$x]['category'] = 'domain';
        $tmp[$x]['subcategory'] = 'template';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $install_tmp_dir;
        $tmp[$x]['category'] = 'server';
        $tmp[$x]['subcategory'] = 'temp';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $startup_script_dir;
        $tmp[$x]['category'] = 'server';
        $tmp[$x]['subcategory'] = 'startup_script';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $install_backup_dir;
        $tmp[$x]['category'] = 'server';
        $tmp[$x]['subcategory'] = 'backup';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_bin_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'bin';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $install_switch_base_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'base';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_conf_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'conf';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_db_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'db';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_log_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'log';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_extensions_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'extensions';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_gateways_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'gateways';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_dialplan_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'dialplan';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_mod_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'mod';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_scripts_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'scripts';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_grammar_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'grammar';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_storage_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'storage';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_voicemail_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'voicemail';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_recordings_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'recordings';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = $switch_sounds_dir;
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'sounds';
        $tmp[$x]['enabled'] = 'true';
        $x++;
        $tmp[$x]['name'] = 'dir';
        $tmp[$x]['value'] = '';
        $tmp[$x]['category'] = 'switch';
        $tmp[$x]['subcategory'] = 'provision';
        $tmp[$x]['enabled'] = 'false';
        $x++;
        $db_tmp->beginTransaction();
        foreach($tmp as $row) {
            $sql = "insert into v_default_settings ";
            $sql .= "(";
            $sql .= "default_setting_uuid, ";
            $sql .= "default_setting_name, ";
            $sql .= "default_setting_value, ";
            $sql .= "default_setting_category, ";
            $sql .= "default_setting_subcategory, ";
            $sql .= "default_setting_enabled ";
            $sql .= ") ";
            $sql .= "values ";
            $sql .= "(";
            $sql .= "'".uuid()."', ";
            $sql .= "'".$row['name']."', ";
            $sql .= "'".$row['value']."', ";
            $sql .= "'".$row['category']."', ";
            $sql .= "'".$row['subcategory']."', ";
            $sql .= "'".$row['enabled']."' ";
            $sql .= ");";
            if ($v_debug) {
                fwrite($fp, $sql."\n");
            }
            $db_tmp->exec(check_sql($sql));
            unset($sql);
        }
        $db_tmp->commit();
        unset($tmp);

Original comment by Vitaly.T...@gmail.com on 10 Sep 2012 at 4:06

GoogleCodeExporter commented 9 years ago
r2820, not r1820 in the comment above.

Original comment by Vitaly.T...@gmail.com on 10 Sep 2012 at 4:07

GoogleCodeExporter commented 9 years ago
That is php code and therefore you must be referring to install.php.

"Could stopped freeswitch cause the problem?"
Very unlikely.

The email settings are not being set directly in the install.php file because 
they are being set elsewhere.

Original comment by markjcrane@gmail.com on 10 Sep 2012 at 5:30

GoogleCodeExporter commented 9 years ago
>Very unlikely.
I also think so but I describe what I see :)
I'll try to install/reinstall fusionpbx a few times later today an report what 
I've found.

This all looks strange, I agree. And I try to minimize the test case as much as 
I can.

Original comment by Vitaly.T...@gmail.com on 10 Sep 2012 at 5:52

GoogleCodeExporter commented 9 years ago
>That is php code and therefore you must be referring to install.php.
Sure :) Thought about php and wrote sh. Sorry for the misprint.

Original comment by Vitaly.T...@gmail.com on 10 Sep 2012 at 5:53

GoogleCodeExporter commented 9 years ago
Believe or not, I can reproduce the issue with stopped freeswitch and I can't 
reproduce it with running freeswitch.

How I'm reproducing (Ubuntu 12.04 LTS / mySQL / fusionpbx r2822)

1.1. remove includes/config.php
1.2. drop the fusionpbx database.
1.3. stop freeswitch from the console.
1.4. run fusionpbx installer, choose 'accessible' theme.
1.5. login as superadmin.
1.6. Go to Advanced -> Default Settings.
No 'Email' category.

2.1. remove includes/config.php
2.2. drop the fusionpbx database.
2.3. start freeswitch from the console.
2.4. run fusionpbx installer, choose 'accessible' theme.
2.5. login as superadmin.
2.6. Go to Advanced -> Default Settings.
There is 'Email' category.

Repeat staps 1.x
No 'Email' category.

Repeat staps 2.x
There is 'Email' category.

Original comment by Vitaly.T...@gmail.com on 10 Sep 2012 at 7:16

GoogleCodeExporter commented 9 years ago
Your install may be timing out. The web server may need to be adjusted to 
increase the execution time allowed.

You can go to advanced -> upgrade schema run that and then look in advanced -> 
default settings and you will see the values you are looking for.

Original comment by markjcrane@gmail.com on 10 Sep 2012 at 11:23

GoogleCodeExporter commented 9 years ago
This helped. Thanks!

But if the freeswitch is turned off, I need to go to advanced->upgrade schema 
each time I install fusionpbx.

Increasing max_execution_time to 300 in php.ini doesn't resolve the issue.

So, the correct steps not to reproduce the issue are:
1.1. remove includes/config.php
1.2. drop the fusionpbx database.
1.3. stop freeswitch from the console.
1.4. run fusionpbx installer, choose 'accessible' theme.
1.5. login as superadmin.
1.5.1. Go to Advanced -> Upgrade Schema. Press "Apply Settings".
1.6. Go to Advanced -> Default Settings.
There is 'Email' category.

I assume that although the workaround is found, the issue still persists.

Original comment by Vitaly.T...@gmail.com on 11 Sep 2012 at 5:21

GoogleCodeExporter commented 9 years ago
I don't think its a php timeout its a web server timeout.

There is also an alternate command line to run Advanced -> Upgrade schema.

cd /var/www/fusionpbx
php /var/www/fusionpbx/core/upgrade/upgrade.php

Original comment by markjcrane@gmail.com on 11 Sep 2012 at 6:52

GoogleCodeExporter commented 9 years ago
I've changed Timeout to 3000 in apache2.conf, restarted Apache Web Server.

Still can reproduce the problem. In fact, fusionpbx gets installed quite fast, 
so I don't think the problem lays in timeout settings.

So, steps from Comment 10 helps to workaround the issue.

Could it be a side effect of (incomplete?) move smtp settings from 
system->settings to advanced->default settings? Where the v_default_settings 
table is filled initially?  (I see install.php - see Comment 3.)

Original comment by Vitaly.T...@gmail.com on 11 Sep 2012 at 7:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I assume you are installing as Single Tenant. In that case the problem is in 
code/upgrade/upgrade_domains.php. Line 75 should be == 1, not == 0.
You can verify the result by checking System/variables, you will see domain is 
disabled. After the fix, do an upgrade schema and the setting will be correct. 
It should be enabled for Single Tenant.

I figured this out last night, Mark has to verify the fix as I only tested it 
for Single Tenant.

Original comment by gerrit308 on 17 Oct 2012 at 1:18

GoogleCodeExporter commented 9 years ago
Please try with Rev 3055 or later, this should be fixed now

Original comment by gerrit308 on 18 Oct 2012 at 7:30