Elastix 3.0 MT

I'm an existing FOP2 (2.2.8) user (on an older version of Elastix) and I am testing out Elastix 3.0, because I have a need for Multi Tenant soon.

I've installed a fresh Elastix MT and then installed FOP2:
cd /usr/src
wget http://www.fop2.com/download/centos64 -O fop2.tgz

tar zxvf fop2.tgz
cd fop2
make install

vi /etc/asterisk/manager.conf
vi /usr/local/fop2/fop2.cfg
vi  /etc/asterisk/sip.conf

service asterisk restart
service fop2 restart


A few issues I am having and the solutions I've worked out:

1.) I couldn't login to /fop2/admin unless I did define('USE_FREEPBX_AUTH',false);. I hacked secure-functions.php and added this at line 43:
else if(($config_engine=='elastix_mt') && USE_FREEPBX_AUTH==true) {

		$query="SELECT username AS login, 'admin' AS level, name AS name FROM ".$conf['DBNAME'].".acl_user WHERE username='%s' AND md5_password=md5('%s')";

        $res=$db->consulta($query,Array($login,$password));
		print_r($res);

        if($db->num_rows($res)==1) {
            $row = $db->fetch_assoc($result);
            $row['ok']=1;
        } else {
            $row['error']=__('Invalid Credentials');
        }

    }
(mainly checking if config_engine=='elastix_mt' and then changing the SQL query, including changing the password from sha1 to md5 as per the Elastix MT acl_user table.)

Now I can login to the Manager (though obviously I need to fix the 'level' bit and probably UNION from 'acl_group'). It magically created all the fop2 tables in 'elxpbx' and the manager appears to be working.

2.) At first I couldn't login to the panel with any extensions, but I worked out that I needed to use fop2/?context =mycontext.com and the contexts are stored in fop2contexts and the users are in fop2users.


My questions:
1.) Is FOP2 'supported' on Elastix MT?
2.) If so, are there any 'gotchas' or anything to be aware of? (And is the above the best way to achieve auth to the manager?)
3.) I assume I'd be best to use the #exec flag to roll my own configs, to pull extensions from Elastix and create matching FOP2 Users for each context?

Comments

  • You will have to test FOP2 in Elastix MT. It is supposed to work, but not really tested. The key part is the FOP2 Manager you already set your hands on, there is a functions-elastix.php file that will pull information out from ElastixMT tables and fill the appropiate data in the FOP2 Manager tables.. that is the best way to handle it. The latest FOP2 Manager has many improvements and some subtle changes for multi tenant systems, it is not yet released (version 1.0.7), but you can get it if you download version 2.29.02 beta for FOP2 that already includes the manager. AS for the way to log in, on multi tenant systems that do not use freepbx the usual way is to defined a user/pass in config.php and of course disabling use_freepbx_auth. Your modification is fine also if you want to reuse credentials for elastix in itself.. but take into account that the fop2 manager does not have user levels, the user has full privileges on all domains.

    Best regards,
Sign In or Register to comment.