Table of Contents

Siremis v5.1.x - Adding New DB Table Views

Siremis offers a flexible way of managing the records inside database tables used by Kamailio. Most of them are covered by existing Siremis distribution, still there are some missing (expected to be added in the next releases), but also it many cases you may have custom tables used by Kamailio (via sqlops module for example).

Starting with this version, Siremis comes with several PHP tools that allows you to generate views for tables in Kamailio database in no time.

Preparing The Tools

First you have to install Siremis so that Kamailio's database connection attributes are set. Then, in the top directory of Siremis (i.e., /var/www/siremis-x.y.z) do:

make toolsx

To run the db table view generation tool, you have to install command line php - php5-cli or php7.0-cli. On Debian/Ubuntu:

apt-get install php-cli
# or
apt-get install php5-cli
# or
apt-get install php7.0-cli

Generating New Table View

From Siremis' top directory, go to siremis/bin/toolx.

You have to execute gen_meta.php, giving as parameter the database connection ID (for Kamailio database this is Serdb), name of the table and the Siremis submodule ID.

Next command shows how the view for mtree table was generated.

cd siremis/bin/toolx
php gen_meta.php Sipdb mtree sipadmin.rtg.mtree

In this example, Siremis submodule ID is sipadmin.srv.mtree, meaning:

If you look inside siremis/modules/sipadmin/srv/mtree/, there are two subdirectories:

Another file that was generated is the Siremis Web View for mtree management. It is located at:

siremis/modules/sipadmin/view/MtreeListView.xml

It includes the references to the Form objects used for this view.

Inserting New View In Menu

All that is needed to manage the records in mtree table was generated in previous step, Missing part is linking it from Siremis menu in order to access the operations to manage mtree table.

The menu of Siremis module sipadmin is located at:

siremis/modules/sipadmin/mod.xml

Edit it and add a new entry in the XML tree. For mtree, we added it to Server Services:

...
    <Menu>
        <MenuItem Name="System.Sipadmin" Title="SIPAdmin Menu" Description="SIP Admin Management" URL="/sipadmin/sipadmin_default" IconImage="spacer.gif" IconCssClass="" Order="25">
...
              <MenuItem Name="System.Sipadmin.Srv" Title="Server Services" Parent="System.Sipadmin" Order="20">
...
                    <MenuItem Name="System.Sipadmin.Srv.Mtree.List" Title="Mtree List" Description=""
					URL="{@home:url}/sipadmin/mtree_list" Order="90"/>
...

The mtree entry is the last MenuItem node in the above snippet. The main attributes for it are:

Removing The Tools

The tools files are available via web browser. Although they require command line interaction, their security exposure was not analyzed, so as soon as you finish using them, just remove them. In the top directory of Siremis run:

make cleantoolsx

More Docs

Siremis is built on top of phpopenbiz and cubi frameworks, you can read more documentation about how to extend it at:

Many tutorials are available in project's wiki pages: