Giter Site home page Giter Site logo

opensips / opensips-cp Goto Github PK

View Code? Open in Web Editor NEW
112.0 14.0 79.0 5.15 MB

A Web Control Panel Application for the OpenSIPS, which is intended for both system and user provisioning. It features more than 18 tools, covering important functionalities (MI,statistics) and modules (acc,siptrace,drouting,dialplan) of OpenSIPS.

License: GNU General Public License v2.0

PHP 92.66% JavaScript 4.73% CSS 2.07% Hack 0.11% PLpgSQL 0.43%

opensips-cp's Introduction

OpenSIPS Control Panel (OCP) is a Provisioning Web Portal for OpenSIPS SIP 
Server (www.opensips.org). This software is distributed under GPL v2 license.

Please see the doc online documentation for further details - http://controlpanel.opensips.org/.

To create a new tviewer module, follow the instructions located in web/common/tools/tviewer/README

opensips-cp's People

Contributors

adivjoseph avatar airineidaniel23 avatar amendiola avatar artkos avatar austinlangston avatar bogdan-iancu avatar cleberb avatar dariusstefan avatar farmorg avatar fsilvestre avatar homer-rivera avatar jeffrey2019 avatar khorsmann avatar liviuchircu avatar modernist avatar petekelly avatar pfournier avatar razvancrainea avatar rico29 avatar untiptun avatar vbomfim avatar vladpaiu avatar voicenter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensips-cp's Issues

PHP Parse Error 2.2.3 (opensips) & 6.2 (CP)

Hi,

I get the following error messages in my apache log;

Accessing User Management
PHP Parse error: syntax error, unexpected '}' in /var/www/opensips-cp/web/tools/users/user_management/template/user_management.main.php on line 272, referer: http://10.0.91.9/cp/menu.php

Alias Management
image

ACL Management
image

List Admins
PHP Parse error: syntax error, unexpected '}' in /var/www/opensips-cp/web/tools/admin/list_admins/template/list_admins.main.php on line 150, referer: http://10.0.91.9/cp/menu.php

RTPProxy
PHP Parse error: syntax error, unexpected '}' in /var/www/opensips-cp/web/tools/system/rtpproxy/template/rtpproxy.main.php on line 217, referer: http://10.0.91.9/cp/menu.php

Variable $pointCount

Line 93 of the file below contains the variable $pointcount, I believe the correct name is $pointCount:

opensips-cp/web/tools/system/smonitor/lib/libchart/classes/view/chart/LineChart.php

Replace json by mi in the box.inc.php

When using the master version and opensips 3.1, the file box.inc.

// MI connector (via JSON backend): json:host:port/json
$boxes[$box_id]['mi']['conn']="json:127.0.0.1:8888/json";

In 3.1 the default now is mi instead of json

// MI connector (via JSON backend): json:host:port/mi
$boxes[$box_id]['mi']['conn']="json:127.0.0.1:8888/mi";

Just to match configuration files generated by osipsconfig with the opensips control panel.

opensips-cp install on Ubuntu Ubuntu 18.04.3 LTS

noticed that when following the install guide on sources

sudo apt-get install apache2 libapache2-mod-php php-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php-curl : Depends: php7.2-curl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I was able to go pass this with
sudo apt install libcurl4
and after that the
sudo apt-get install apache2 libapache2-mod-php php-curl
worked.

SQL injection vulnerabilities

e.g. $_GET['table'] is concatenated into a SQL query verbatim.

$user_table = $_GET['table'];
$alias_username=$_POST['alias_username'];
$alias_domain=$_POST['alias_domain'];
$username = $_POST['username'];
$domain= $_POST['domain'];
if ($alias_username=="" || $alias_domain=="" || $username=="" || $domain=="") {
$errors = "Invalid data, the entry was not modified in the database";
} else {
$sql = "SELECT count(*) FROM ".$user_table." WHERE alias_username=? AND alias_domain=? AND id!=?";

Error "Call to undefined method MDB2_Error::fetchAll()"

Hello! Please consult this issue when you have a little time.
I see "HTTP ERROR 500" after enter the password, username and click "Login".
httpd logs:

[Thu Jun 22 07:43:20.095408 2017] [:error] [pid 27566] [client IP:52218] PHP Warning:  Creating default object from empty value in /var/www/opensips-cp/config/db.inc.php on line 24, referer: http://IP/cp/
[Thu Jun 22 07:43:20.131422 2017] [:error] [pid 27566] [client IP:52218] PHP Fatal error:  Call to undefined method MDB2_Error::fetchAll() in /var/www/opensips-cp/web/login.php on line 56, referer: http://IP/cp/

Warning in this code line:

    $config->db_driver = "pgsql";  

Error in this code line:

    $resultset1 = $result1->fetchAll(); 

SElinux disabled. opensips-cp 6.2.
Centos 7 version:

Linux 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I use this commands for install dependencies:

yum install php php-pear php-gd php-pgsql php-mbstring php-xml php-common php-curl php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

I use this commands for install pear:

pear install log
pear install MDB2
pear install MDB2#pgsql

Please help. Does not require an early solution.

SipTrace with MySQL

The standard empty query returns no results.

Looking at the database
SELECT DISTINCT callid FROM sip_trace WHERE status='' AND direction='in' ORDER BY id DESC;

gets

ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list, references column 'opensips.sip_trace.id' which is not in SELECT list; this is incompatible with DISTINCT

I fixed it in opensips/web/tools/system/siptrace/template/tracer.main.php

where line 140 needed to change id to callid to match the postgres call below it,

Timezone warning from login.php

The http log file records a "PHP Warning" w.r.t. use of the date() function. The warning states that "you are required to use the date.timezone setting or the date_default_timezone_set() function". It then states that it will default to UTC. The report states that the infringement occurs at line 91 in /opensips-cp/web/login.php.

Missing single quotes in domains.main.php

When you select Systems>Domains tab, this warning is generated in the httpd log file:
Use of undefined constant read_only - assumed 'read_only' in /var/www/html/opensips-cp/web/tools/system/domains/template/domains.main.php on line 24

Unable to link custom group to any Rule in Dynamic Routing Menu

Hi,

I am getting trouble assigning the group ID to the dr rules. We can create any group but when we add rules in the dynamic routing menu, there is a drop-down to assign group ID. So by default, it shows only 2 groups to assign, 0 and 1.

image

Now if we try to assign that group to our new rule, we did not see anything.
image

So right now, to assign custom group to rule, I manually change db entries in dr_rules table. Please try to solve this bug.

Thanks a lot.

RTPProxy enhancements

Using the newer version of RTPProxy, we could extract some interesting information from the server, such as currently ongoing sessions, the number of packets relayed, etc. We could integrate these statistics in CP for debugging purposes.

A full list of available statistics can be found here:
http://www.rtpproxy.org/post/v2release/

PgSQL port connection

Hello Everyone,
Installed latest version and tried connect to PgSQL database on custom port, but it connection failing.

Line in question

if (!empty($config->db_port) ) $config->db_host = $config->db_host . ":" . $config->db_port;

Installed PHP

[root@aitossgui config]# rpm -qa | grep php
php-fedora-autoloader-1.0.0-2.fc27.noarch
php-pdo-7.1.23-1.fc27.x86_64
php-gd-7.1.23-1.fc27.x86_64
php-process-7.1.23-1.fc27.x86_64
php-pecl-apcu-bc-1.0.3-7.fc27.x86_64
php-pgsql-7.1.23-1.fc27.x86_64
php-json-7.1.23-1.fc27.x86_64
php-cli-7.1.23-1.fc27.x86_64
php-xml-7.1.23-1.fc27.x86_64
php-fpm-7.1.23-1.fc27.x86_64
php-pear-1.10.5-4.fc27.noarch
php-common-7.1.23-1.fc27.x86_64
php-7.1.23-1.fc27.x86_64
php-pecl-apcu-5.1.12-1.fc27.x86_64
Error!: SQLSTATE[08006] [7] could not translate host name "10.100.101.11:5235" to address: Name or service not known

System > Statistics Monitor 7.2.3 issue

Dear Sir
OpenSIP 2.3 + Control Panel 7.2.3
When I click System > Statistics Monitor menu, the returned page is strange, compared with what I did in OpenSIPS 2.2 + Control panel 6.2

The error in the log file is as below:
[Thu Jan 04 23:25:50.215032 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Warning: Creating default object from empty value in /var/www/opensips-cp/config/db.inc.php on line 24, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.263241 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Warning: Creating default object from empty value in /var/www/opensips-cp/config/tools/system/smonitor/local.inc.php on line 25, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.276682 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: A session had already been started - ignoring session_start() in /var/www/opensips-cp/web/tools/system/smonitor/lib/put_select_boxes.php on line 25, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.276781 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined variable: box_val in /var/www/opensips-cp/web/tools/system/smonitor/lib/functions.inc.php on line 198, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.276910 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: A session had already been started - ignoring session_start() in /var/www/opensips-cp/config/session.inc.php on line 23, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.277013 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined index: var in /var/www/opensips-cp/web/tools/system/smonitor/rt_stats.php on line 44, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.277032 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined index: module_id in /var/www/opensips-cp/web/tools/system/smonitor/rt_stats.php on line 64, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.277042 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined index: modules_no in /var/www/opensips-cp/web/tools/system/smonitor/rt_stats.php on line 72, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.277057 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined index: reset_stats in /var/www/opensips-cp/web/tools/system/smonitor/rt_stats.php on line 75, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:25:50.277083 2018] [:error] [pid 18886] [client 172.21.254.209:51128] PHP Notice: Undefined index: modules_no in /var/www/opensips-cp/web/tools/system/smonitor/template/rt_stats.main.php on line 32, referer: http://172.21.253.242/cp/menu.php

Thanks.

can't load opensips-cp\web\tools\*\*\lib\*.main.js

Hi,I‘m using opensips-cp8.3.0 nginx1.16.1 and PHP7.3-fpm PHP7.3.11-0(cli) on ubuntu0.19.10.2
but opensips controlpanel display as followings:
1
2
3
and there are errs in nginx'log like this:
[error] 701#701: *477 FastCGI sent in stderr: "PHP message: PHP Warning: require(lib/.main.js): failed to open stream: No such file or directory in /var/www/html/opensips-cp/web/tools/users/user_management/user_management.php on line 24PHP message: PHP Fatal error: require(): Failed opening required 'lib/.main.js' (include_path='.:/usr/share/php') in /var/www/html/opensips-cp/web/tools/users/user_management/user_management.php on line 24" while reading response header from upstream, client: , server: , request: "GET /opensips-cp/web/tools/users/user_management/user_management.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "xxx", referrer: "https://xxx/opensips-cp/web/menu.php"
is there's any suggestions that helps solve the problem

[admin] creating new access users

There is an issue: a newly created access user can got receive permissions to manage the access users. Basically only the initial "admin" has the ability to create new access users.

Tables PostgreSQL

I can not find the file:

config/tools/admin/add_admin/ocp_admin_privileges.pgsql

Has postgresql support been removed?

Won't run using PHP 7.0

Because I needed to install a new Debian distro (Debian 9 Stretch), PHP 5.x is no longer part of my system.
Now I entirely fail to use control panel.
It seems to fail in MDB2#mysql part - causing error:
PHP Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/MDB2.php on line 390

Have tried it with both versions (Control Panel 7.2.3 and 6.2 as well)
Any idea about how to run opensips control panel on a recent Linux distribution?

Thanks in advance!

(Btw. digging trough your great book "Building Telephony Systems with OpenSIPS, Second Edition" - which is a great source of help!)

Error "Failed to issue query, error message : MDB2 Error: unknown error"

Good day! I found problem in Users -> User Management.
error_screen

opensips-cp makes a request to postgres:

select count(*) from subscriber s  order by s.id asc

In logs i see:

Jun 23 07:21:14 144153 postgres[7132]: [5-1] < 2017-06-23 07:21:14.967 UTC >ERROR:  column "s.id" must appear in the GROUP BY clause or be used in an aggregate function at character 45
Jun 23 07:21:14 144153 postgres[7132]: [5-2] < 2017-06-23 07:21:14.967 UTC >STATEMENT:  select count(*) from subscriber s  order by s.id asc

Attach the pcap file with packets(Frame 16 is bad request):
bad_request.pcap.zip

In postgres table i have:

opensips=# select * from domain;
 id |    domain     | attrs |       last_modified        
----+---------------+-------+----------------------------
  1 | 89.223.25.188 |       | 2017-05-23 11:41:33.813304

PHP Warnings

Although not attributable to specific cases of incorrect behaviour, I found a number of instances of PHP Warning messages in the httpd log file after clicking on a few tabs to view data in different modules:

  1. Creating default object from empty value in /var/www/html/opensips-cp/config/tools/system/smonitor/local.inc.php on line 25

  2. Invalid argument supplied for foreach() in /var/www/html/opensips-cp/web/tools/admin/list_admins/template/list_admins.edit_tools.php on line 58

  3. Invalid argument supplied for foreach() in /var/www/html/opensips-cp/web/tools/admin/list_admins/list_admins.php on line 235

CDR Viewer error when search with TIME criteria

Dear Sir/Madam
In OCP 7.2.3 with OpenSIP 2.3, PostgreSQL.
System > CDR Viewer
The default CDR Viewer main page is OK.
When search with criteria, it will return below error message:
Failed to issue query, error message : MDB2 Error: unknown error

Thanks.

errors in /var/log/apache2/error.log:

[Mon Jan 08 12:28:37.424892 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Warning: Creating default object from empty value in /var/www/opensips-cp/config/tools/system/cdrviewer/local.inc.php on line 28, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search [Mon Jan 08 12:28:37.441317 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Notice: Undefined variable: show_all in /var/www/opensips-cp/web/tools/system/cdrviewer/cdrviewer.php on line 47, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search [Mon Jan 08 12:28:37.441359 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Notice: Undefined variable: search_regexp in /var/www/opensips-cp/web/tools/system/cdrviewer/cdrviewer.php on line 57, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search [Mon Jan 08 12:28:37.441371 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Notice: Undefined variable: cdr_field in /var/www/opensips-cp/web/tools/system/cdrviewer/cdrviewer.php on line 58, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search [Mon Jan 08 12:28:37.441389 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Notice: Undefined variable: export in /var/www/opensips-cp/web/tools/system/cdrviewer/cdrviewer.php on line 66, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search [Mon Jan 08 12:28:37.441547 2018] [:error] [pid 5333] [client 172.21.254.211:61045] PHP Notice: Undefined variable: sql_search in /var/www/opensips-cp/web/tools/system/cdrviewer/template/cdrviewer.main.php on line 71, referer: http://172.21.253.242/cp/tools/system/cdrviewer/cdrviewer.php?action=search

Impossible to send MI command

Ubuntu 18.04.2 LTS
OpenSIPS 2.4.6-1
opensips-cp branch master & 8.2.4

Hello,

When I try to send MI command, I have all the time this error:
Unknwon/Unsupported type[] for MI URL <>

I just change the line's port in boxes config:
$boxes[$box_id]['mi']['conn']="json:127.0.0.1:8080/json";

Everything else is by default and when I test OpenSIPS json, it's working.
curl "http://127.0.0.1:8080/json/uptime"
{"Now": "Mon Jul 8 11:43:45 2019", "Up since": "Mon Jul 8 11:36:04 2019", "Up time": "461 [sec]"}

In Apache2, I get this errors:
[Mon Jul 08 11:47:18.964602 2019] [php7:notice] [pid 12082] [client 10.200.0.1:34978] PHP Notice: session_start(): A session had already been started - ignoring in /var/www/opensips/config/session.inc.php on line 23, referer: http://sip04.prddmz.audiotel.com/cp/tools/system/mi/mi.php?action=execute [Mon Jul 08 11:47:18.964950 2019] [php7:notice] [pid 12082] [client 10.200.0.1:34978] PHP Notice: Undefined variable: box_val in /var/www/opensips/web/tools/system/mi/lib/functions.inc.php on line 55, referer: http://sip04.prddmz.audiotel.com/cp/tools/system/mi/mi.php?action=execute [Mon Jul 08 11:47:18.965193 2019] [php7:warn] [pid 12082] [client 10.200.0.1:34978] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/opensips/web/tools/system/mi/lib/functions.inc.php on line 32, referer: http://sip04.prddmz.audiotel.com/cp/tools/system/mi/mi.php?action=execute

Tested on Chrome/Firefox with OpenSIPs CP locally installed or on a different server, PHP 7.2 and PHP 5.

I found a quick fix

--- a/web/tools/system/mi/mi.php
+++ b/web/tools/system/mi/mi.php
@@ -47,7 +47,7 @@ if ($_GET['action']=="execute")
$command=$_POST['mi_cmd'];
if ($command=="") $error=true;
if (!$error ) {
-
+ $current_box = "json:127.0.0.1:8080/json";
$message=mi_command($command,$current_box,$errors,$status);

$stupidtags = array("<",">");`

Thanks.

drouting: "MDB2 Error: no such field" when searching for gateway ip address

https://github.com/OpenSIPS/opensips-cp/blob/master/web/tools/system/drouting/template/gateways.main.php#L174

When searching for a specific gateway IP the error message is : mdb2 - no such field. When printing out the sql query it revealed that the query result is ordered by "ruleid" ?

But the gateways table does not have a ruleid at all. When removing the order by from line 174 the gateway search works just fine, but i am wondering whether this is a bug or it has another reason?

Cannot edit admin users

Add New Admin works as expected, so does delete, but editing an existing admin user does not work.
There is a message "- is already an existing admin -" on the screen when I click Save.

System > Mi Commands

Dear Sir
OpenSIPS 2.3 + Control Panel 7.2.3(lastest commit)

When I click System > Mi Commands, there is error in /var/log/apache2/error.log
And mi commands is not populated in the drop down list, right to the eXecute button.

[Thu Jan 04 23:17:40.798701 2018] [:error] [pid 18875] [client 172.21.254.209:51009] PHP Notice: Undefined variable: box_val in /var/www/opensips-cp/web/tools/system/mi/lib/functions.inc.php on line 55, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:17:40.798975 2018] [:error] [pid 18875] [client 172.21.254.209:51009] PHP Notice: A session had already been started - ignoring session_start() in /var/www/opensips-cp/config/session.inc.php on line 23, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:17:40.799193 2018] [:error] [pid 18875] [client 172.21.254.209:51009] PHP Notice: Undefined index: action in /var/www/opensips-cp/web/tools/system/mi/mi.php on line 58, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:17:40.799235 2018] [:error] [pid 18875] [client 172.21.254.209:51009] PHP Notice: Undefined index: action in /var/www/opensips-cp/web/tools/system/mi/mi.php on line 92, referer: http://172.21.253.242/cp/menu.php [Thu Jan 04 23:17:40.799244 2018] [:error] [pid 18875] [client 172.21.254.209:51009] PHP Notice: Undefined index: action in /var/www/opensips-cp/web/tools/system/mi/mi.php on line 99, referer: http://172.21.253.242/cp/menu.php

Also, when I input 'which' command to execute, it also doesn't work.
[Thu Jan 04 23:22:50.291084 2018] [:error] [pid 18877] [client 172.21.254.209:51069] PHP Notice: Undefined variable: box_val in /var/www/opensips-cp/web/tools/system/mi/lib/functions.inc.php on line 55, referer: http://172.21.253.242/cp/tools/system/mi/mi.php [Thu Jan 04 23:22:50.291318 2018] [:error] [pid 18877] [client 172.21.254.209:51069] PHP Notice: A session had already been started - ignoring session_start() in /var/www/opensips-cp/config/session.inc.php on line 23, referer: http://172.21.253.242/cp/tools/system/mi/mi.php [Thu Jan 04 23:22:50.295352 2018] [:error] [pid 18877] [client 172.21.254.209:51069] PHP Notice: Undefined variable: arguments in /var/www/opensips-cp/web/tools/system/mi/mi.php on line 72, referer: http://172.21.253.242/cp/tools/system/mi/mi.php

I followed the instruction carefully with book and control panel website.
OpenSIPS 2.2 + Control Panel 6.2 works fine.

Thanks.

Load_balancer option

Hello Team,

I;m getting below error while clicking show all/search in load_balancer module.
OS: CentOS 7
Opensips: 3.0.1
Opensips-CP: 8

PHP Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/html/opensips-cp/web/common/mi_comm.php:55\nStack trace:\n#0 /var/www/html/opensips-cp/web/common/mi_comm.php(87): write2json('lb_list', NULL, '127.0.0.1:8888/...', '')\n#1 /var/www/html/opensips-cp/web/tools/system/loadbalancer/template/loadbalancer.main.php(122): mi_command('lb_list', NULL, 'json:127.0.0.1:...', '')\n#2 /var/www/html/opensips-cp/web/tools/system/loadbalancer/loadbalancer.php(215): require('/var/www/html/o...')\n#3 {main}\n thrown in /var/www/html/opensips-cp/web/common/mi_comm.php on line 55, referer: https://x.x.x.x/opensips-cp/web/tools/system/loadbalancer/loadbalancer.php?action=search

Admin access control not working

Edit the access controls for an admin user and remove the tick from the "User Management" tool. Save.
Now login as the user and you are able to change the permissions back again even though you should not have permission to do so. This happens because the argument passed to get_priv() in index.php is "list_admins" and the checks done within the function attempt to match this tool name to the names already known and stored in an array of "tabs". There is no tab in that array with the name "list_admins" so the 'read_only' session variable does not get initialised. Modules then interpret the uninitialised session variable as meaning full access is permitted.

CDR Viewer error when search with CDR Field criteria = method

Dear Sir or Madam
As method is keyword in postgreSQL, so when search with CDR field and field = method, the SQL will hit error.

It should changed from

select count(*) from acc where (1=1) and method like "%INVITE%"

to:

select count(*) from acc where (1=1) and "method" like '%INVITE%'

warning!!
below statement won't work in postgreSQL:
select count(*) from acc where (1=1) and "method" like "%INVITE%"

Update dispatcher and load_balancer tools for OpenSIPS 2.3

With the addition of FreeSWITCH-flavoured weight calculations, both tools require an update either in order to support the newly added concepts (dispatcher + load_balancer) or simply ensure proper functioning / backwards-compatibility (dispatcher, where the weight column has changed from INT to CHAR).

Update documentation

Hardcoded directory dependency

In your install guide, for Apache config you are using /var/www/html/opensips-cp, but we found a couple places in the code and scripts where you are using /var/www/opensips-cp. For root directory, we are using /var/www/opensips-cp on Debian. So all we needed to do was alter the directory in the Apache config. Ideally, we should be able to put it wherever and name it whatever and not have to worry about hardcoded dependencies in the code or in scripts.

https://github.com/OpenSIPS/opensips-cp/search?q=var%2Fwww%2Fopensips-cp&unscoped_q=var%2Fwww%2Fopensips-cp

Apache Config

Apache config for Apache v2.4 should use Require all granted, Require all denied instead of

Order allow,deny
alow from all

and

Order deny, allow
deny from all

I think the old way still works for Apache 2.4 but it's discouraged. Any new installs would most likely be using an OS with Apache v2.4 these days.
https://httpd.apache.org/docs/2.4/upgrading.html

PHP 7

Your instructions are referring to php 5 but any new installs will be using php 7. We are using php 7.3 and so far it seems to work. So if you install on Debian 9 the php directory will not be /etc/php5

The web has notice information

Hi,I installed OCP 8.2.4 according to official documents (http://controlpanel.opensips.org/htmldoc_8_2_4/INSTALL.html)
My Version Info:CentOS 6.5, php 7.0.14, nginx 1.11.2
But I see a lot of notice information on the web. like:

Notice: Undefined offset: 1 in /opt/htdocs/opensips-cp/web/tools/system/loadbalancer/template/loadbalancer.main.php on line 177
Notice: Undefined variable: lb_auto in /opt/htdocs/opensips-cp/web/tools/system/loadbalancer/template/loadbalancer.main.php on line 186
Notice: Undefined offset: 1 in /opt/htdocs/opensips-cp/web/tools/system/loadbalancer/template/loadbalancer.main.php on line 189
....

Is this caused by the php or nginx is not installed properly?
PS:I tried xampp xampp 1.8.2、5.6.40, But I still had this kind of problem.

undefined function apc_store() in homer.php

Dear Sir/Madam
I am try to make integration between Homer and OpenSIPS Control Panel.
When I click homer link in control panel, there is an 500(Internal Server Error).
http://172.21.253.242/cp/tools/system/homer/homer.php

There is also error in log file: /var/log/apache2/error.log
What should I do to fix it?

[Thu Jan 04 14:12:25.287841 2018] [:error] [pid 10616] [client 172.21.254.208:61842] PHP Fatal error: Call to undefined function apc_store() in /var/www/opensips-cp/web/tools/system/homer/homer.php on line 50, referer: http://172.21.253.242/cp/menu.php

Suggestion to removing short tags

Here's one suggestion to removing short tags of the code, following the best practice recommendation in PHP7:

Shell commands used:

# cd /var/www/
# cp -a opensips-cp{,.bak}
# cd opensips-cp
# find . -iname '*.php' -type f -print0 | xargs -0 sed -i -e 's/<?$/<?php/g' -e 's/<? /<?php /g' -e '/<?php/! s/<?\([^=\"\ ]\)/<?php \1/g'

I performed a validation test with the command:

# cd /var/www
# git diff opensips-cp.bak opensips-cp

With this change, will no longer have to change the default behavior of the short_open_tag parameter in the php.ini file (value is Off in Debian Stretch).

In my test environment everything is functional, but I recommend evaluating it more deeply.

Cross-Site Scripting (XSS) vulnerabilities

Server XSS occurs when untrusted user supplied data is included in an HTTP response generated by the server.
-- https://owasp.org/www-community/Types_of_Cross-Site_Scripting

<form action="<?=$page_name?>?action=modify_tools&id=<?=$_GET['id']?>&uname=<?=$_GET['uname']?>" method="post">

For example, both $_GET['id'] and $_GET['uname'] are user supplied data.

I'd recommend use of static code analysis tools like SonarQube for discovering basic XSS vulnerabilities.

Cannot connect to OpenSIPS Server via Management Interface (/tmp/opensips_fifo)

Hello colleagues! I install opensips-cp on Centos 7(opensips-cp-6.2), and i see error in few modules:
Cannot connect to OpenSIPS Server via Management Interface (/tmp/opensips_fifo)
dfgdfgdfg

i check opensips-fifo file, it`s correct:
dfgdfgdfg1

opensipsctl fifo work good:
dfgdfgdfg2

in opensips.cfg:

FIFO Management Interface

loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_mode", 0666)
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

i am sorry for waste your time, but please, can you help me with this issue? Thanks!

opensips user management page not dispaly

I have issue with print_groups and print_domains functions

in acl_management, alias_management and user management.

replace "print_domains" by
<input type="text" name="lst_domain" value="<?=$search_domain?>" maxlength="16" class="searchInput">

and works

opensips 3.0 and latest opensips control panel.

mysql 5.7, php 7.2

MI commands page proxy dropdown menu problem

Using the latest 8.2.4 (cloned today) I noticed that whatever sip prox I'm choosing in System -> MI Commands, always the first proxy will be chosen. So clocking to the dropdown switch in the top right of the screen won't do anything.
Here you can find the confoguration of the boxes
boxes.txt

[BUG] Permission Module: insert ipv6 Addresses

OpenSIPS v3.0.0
version: opensips 3.0.0-beta (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-FUTEX-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 470d714
main.c compiled on 19:51:59 May 27 2019 with gcc 9.1.0

GUI insert of a ipv6 Address
When using opensip-cl to insert an ipv6 address to the permission table it will decline with an error.

Table: Permissions

Start OpenSIPS-CP (git version)
Open HTTPS web-url
Menu: Permissions
Button: Add Address
Insert values

Group: 10
Address: 2003:17:452:110:: (Netmask for a /64 subnet)
Mask: 64
Port: 5060
Protocol: TCP

--> !!! Invalid IP address, the entry was not modified in the database

The same error message will be shown, if ipv6 is precise (e.g: 2003:4444:452:110:0:0:0:10; Mask: 128)
Seems like the input parser isn't capable.

Expected behavior
new table entry with the given values.

OS/environment information

Operating System: arch-linux
OpenSIPS installation: arch packages (opensips-git, opensips-modules-git

Improvement
accept the ipv6 address in brackets, like

pecisely on node: [<4d>colon<4d>colon<4d>colon<4d>colon<4d>colon<4d>colon<4d>colon<4d>] * nodes netmaks: [<[a-fA-F0-9]>colon<[a-fA-F-0-9]>colon colon]

drouting attr field problem.

I use the latest version of opensips-cp.
There seems to be a problem in the gui for attr in gateways of drouting.
In the gui I can only type in 16 chars, where as the filed is defined as 254 chars.

When I insert a long string in the db directly, then it is displayed correctly, however when I try to change the string and then save it.
Opensips-cp gives a warning that I should shorten my string to 16 chars. I believe that you should be able use the full-length of the field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.