Project

General

Profile

HOWTO - GOAUTODIAL 4 AND VICIDIAL SAME BOX - SOLVED

Added by Kevin C about 4 years ago

It is assumed you either already have goautodial 4 installed as either new or existing and not a vicidial only install.

Backup everything or run a new install to be safe.

First follow the steps here https://goautodial.net/d/4-goautodial-version-4-scratch-install-on-linux if needed or doing a new install. If you have an existing install check some of the settings shown there. The instructions will work if you dont do anything on that link, but it is a baseline that works.

Next for the impatient: (Detailed explanation at the bottom)

sudo cd /usr/src/goautodial/astguiclient/

sudo perl install.pl --web-only

Answer n when asked if you did a default install.

If you dont have your real certs installed (not self signed) do the following:

sudo cp /etc/letsencrypt/live/--YOUR DOMAIN NAME--/certs.pem /etc/pki/tls/certs/localhost.crt
sudo cp /etc/letsencrypt/live/--YOUR DOMAIN NAME--/privkey.pem /etc/pki/tls/private/localhost.key

(NOTE: These are just your cert files and can come wherever you have them. They may not be in /etc/letsencrypt... but they must replace the localhost.crt and localhost.key)

sudo mv /etc/httpd/conf.d/fpm.conf /etc/httpd/conf.d/fpm.conf.orig

sudo mysql asterisk -A

update vicidial_users set load_leads='1', campaign_detail='1',ast_admin_access='1',modify_users='1',alter_agent_interface_options='1',modify_same_user_level='1' where user = 'goadmin';

sudo cp /var/www/html/agc/bp.pl /var/www/html/agc/bp.pl.old

sudo vi /var/www/html/agc/bp.pl

Replace the contents with:

#!/usr/bin/perl

if (length($ARGV0)>1) {
$i=0;

while ($#ARGV >= $i) {
$args = "$args $ARGV[$i]";
$i++;
}

if ($args =~ /--pass=/i) {
@data_in = split(/--pass=/,$args);
$pass = $data_in1;
$pass =~ s/ .*//gi;

$php_script = '
require("dbconnect_mysqli.php");
require("functions.php");
$stmt = "SELECT pass_key,pass_cost FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$SSpass_key = $row[0];
$SSpass_cost = $row[1];
$pass_options = ["cost" => $SSpass_cost,"salt" => base64_encode($SSpass_key)];
$pass_hash = password_hash($argv[1], PASSWORD_BCRYPT, $pass_options);
$pass_hash = substr($pass_hash, 29, 31);
echo "PHASH: $pass_hash\n";
}
';

open my $sm, "|php r '$php_script' - $pass" or die "could not run inline php script";
close $sm;
}
}

Reboot your system

https://--YOUR DOMAIN NAME--/vicidial/welcome.php

You should be able to login with goadmin and its password. If your password contains special characters like \ $ " | ; vicidial will strip them from the password, so if you have trouble logging into vicidial change the password in goautodial and then try to log into vicidial again.

NOTES:

You can use the currenlty created goadmin user as an admin after it has been updated. That is what the SQL does. The existing goadmin is in the ADMIN group but cannot access many admin items. Be mindful of how your changes could affect goautodial since you have new powers now.

It "SEEMS" like goautodial is just installing a normal vicidial install according to goautodials install script. The install script specifically installs vicidial with the --no-web option.
I think the reason for this is 2 fold.

1. goautodial is running with php-fpm which is bad for vicidial Basic Authentication. The PHP_AUTH_USER, PHP_AUTH_PW would not be set so you will get the login prompts but your user/pass are never passed to vicidial.
I could only get it to run without https using a vhost and adding RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
the best solution (at least for me) was to disable php-fpm. Thats is why php-fpm.conf was renamed so it wont run. Maybe vicidial 9.02, 9.1 or 10 can use authentication like the Agent Login screen and not PHP Basic Authentication. Then php-fpm can be used again.

2. goautodial is using php for the password hash and not perl. Any passwords saved to vicidial from goautodial would not be able to be used by the vicidial web app.
That is what the new bp.pl is doing by using the same password algorithm. There are some detailed explanations to disable password hashing but then all the password would need to be decoded and updated in vicidial_users. But I believe most people are not programming or SQL experts so the new bp.pl may not be elegant, but its a simple solution to help most people get things running it a few minutes. It also now gives vicidial users secure passwords without having to install additional perl encryption libraries.

That being said, it "SEEMS" like you can just pull the latest svn vicidial version and put it into /usr/src/goautodial/astguiclient/ then do a regular vicidial upgrade and then update the database.

Possible caveats to test. Enabling the web option in the current version of goautodial "should not" cause any problems since goautodial understands the current database structure, vicidial program options/output etc. Although it is now possible to "change" things in vicidial admin that could possibly break goautodial, but is seems unlikely, but if think you did something, you can change it back.

You could upgrade to the latest version of vicidial and it could "possibly" be something that goautodial doesn't understand, doesn't update, or loses it value that vicidial admin set. Look at the feature, upgrade list of vicidial if you are thinking of upgrading. If is just bug fixes it should be fine. If its new features test the new features with goautodial (have a restore plan). If the database is updated with new columns it may not matter to goautodial depending on what it does, so test,test,test. Backup first though :D

bp.pl.txt (1.05 KB) bp.pl.txt backup and replace contents of bp.pl

Replies (3)

RE: HOWTO - GOAUTODIAL 4 AND VICIDIAL SAME BOX - SOLVED - Added by Kevin C about 4 years ago

The editor is changing some of the syntax in the script used to replace what is in bp.pl

Used the attached file to replace the contents.

bp.pl.txt (1.05 KB) bp.pl.txt backup and replace contents of bp.pl

RE: HOWTO - GOAUTODIAL 4 AND VICIDIAL SAME BOX - SOLVED - Added by Kevin C about 4 years ago

You can install letsencrypt on goautodial (centos 7) by running:

sudo yum install certbot python2-certbot-apache mod_ssl

You still need to setup your domain name with certbot (letsencrypt) and you can find many tutorials on the web.

RE: HOWTO - GOAUTODIAL 4 AND VICIDIAL SAME BOX - SOLVED - Added by Wittie Manansala almost 4 years ago

Hi Kevin,

Thanks for sharing the steps.

    (1-3/3)
    Go to top