Jitsi provisioning ?

Status
Not open for further replies.

neradp

New Member
Apr 21, 2018
9
0
1
47
Has anybody wrote jitsi provisioning template ?

Jitsi do http request to given provisioning url ... and awaits simple .properties file..

Is there some: how to write own provisioning templates ?

Or one simple question: how to work with post and get variables in provisioning template ?
 
So .. adding jitsi provision workflow to fusionpbx is simple ...

1. step
Forward page requests e.g. for nginx:

NGINX:
rewrite "^.*/provision/jitsi"  /app/provision/;

2. set jitsi provision url in jitsi config to:

Code:
http://pbx.sad.local/provision/jitsi?user=${username}&password=${password}&os=${osname}&mac=${hwaddr}&uuid=${uuid}&hostname=${hostname}&ext=1000

Attention to mac variable...this is used by fusionpbx provision class.

3. In /var/www/fusionpbx/resources/templates/provision/ create dir jitsi and his subfolder windows (dir folders are only for examples)

In created path ( /var/www/...../provision/jitsi/windows/ ... create file with name {$mac}.cfg , this file is automaticaly loaded by provision class.

Contet of file {$mac}.cfg:

PHP:
provisioning.ALLOW_PREFIX=net.java|org.ice4j|java.net
{literal}net.java.sip.communicator.impl.gui.main=${null}{/literal}
{if isset($impl_gui_main_configforms_SHOW_ACCOUNT_CONFIG)}net.java.sip.communicator.impl.gui.main.configforms.SHOW_ACCOUNT_CONFIG={$impl_gui_main_configforms_SHOW_ACCOUNT_CONFIG}{/if}

{if isset($impl_gui_main_contactlist_CONTACT_ADD_DISABLED)}net.java.sip.communicator.impl.gui.main.contactlist.CONTACT_ADD_DISABLED={$impl_gui_main_contactlist_CONTACT_ADD_DISABLED}{/if}

{if isset($impl_gui_main_contactlist_CREATE_GROUP_DISABLED)}net.java.sip.communicator.impl.gui.main.contactlist.CREATE_GROUP_DISABLED={$impl_gui_main_contactlist_CREATE_GROUP_DISABLED}{/if}

{if isset($impl_gui_main_chatroomslist_GO_TO_CHATROOM_DISABLED)}net.java.sip.communicator.impl.gui.main.chatroomslist.GO_TO_CHATROOM_DISABLED={$impl_gui_main_chatroomslist_GO_TO_CHATROOM_DISABLED}{/if}

provisioning.ENFORCE_PREFIX=net.java|org.ice4j|java.net

This file is smarty template... if you need access to $_REQUEST array use special $smarty variable..

This steps can be done by Advanced -> Provision Editor application from FusionPBX.

4. In Accounts -> Devices -> [VENDORS] create vendor with name jitsi
5. In Accounts-> Devices->[PROFILES] create profile with name jitsi
Create some setting in this profile.. look at picture
profile.png

5. Accounts->Devices ..create some device ... set mac address ... jitsi on windows posts mac with '-' as separator .. select template jitsi/windows and select profile jitsi ... look at pic

profile.png


6. Only and last question I have is .. how to validate given login and password from jitsi on fusionpbx side ? I need valid login info to create correct account config info in template file...

I need more cofee...

This is only example how things works ..it can be useful for somebody...
 
Validating user from jitsi provision request again fusionpbx user source can be done in file app/provision/index.php

putting this code somewhere over line 420 does the magic



PHP:
//jitsi user authentication
    if(strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,5)) == "jitsi") {

    include core/authentication/resources/classes/authentication.php;

    $auth = new authentication();
    $auth->username=$_REQUEST['user'];
    $auth->password=$_REQUEST['password'];
    $auth->domain=$domain_name;
    $auth->domain_uuid=$domain_uuid;

    $response = $auth->validate();


    if($response["authorized"] != "true") {

        syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] authentication failed for ".$response['username']);
        header("HTTP/1.1 401 Unauthorized");
        header("Content-Type: text/html");
        $content = 'Unauthorized Jitsi Provisioning Attempt';
        header("Content-Length: ".strval(strlen($content)));
        echo $content;
        exit;
    }

    }

Now i can do full provisioning jitsi softpone with sip and xmpp account validated againts company domain..( so users can use jitsi in the spirit of the sso policy)

I love fusion :-D
 
Status
Not open for further replies.