dOpensource / dsiprouter

UI Interface for implementing Kamailio to provide PBX Hosting and SIP Trunking Services
https://dsiprouter.org
Apache License 2.0
196 stars 105 forks source link

installation updates #599

Open devopsec opened 1 month ago

devopsec commented 1 month ago
mackhendricks commented 1 month ago

@devopsec can you provide test cases for each one of these use cases. Check out this PR for an example: https://github.com/dOpensource/dsiprouter/pull/590 (I need to be more detailed as well, but it's a start)

The Homer and RTPEngine commits will require a Homer server and a Remote RTPEngine Server. We need to have this setup in our Dev/QA environment so that @chelseatcarter can validate it works.

devopsec commented 1 month ago

@mackhendricks I was considering what the quickest way to get that info out would be and I think I will give some quick instructions on the PRs , like in your example PR, rather than build out unit tests (that would have to be maintained) for each one.

@chelseatcarter below I will outline the tests I did for each patch during development.
The goal would be to validate that this entire patchset as a whole does not break other components or features (E2E). You wouldn't need to test all the features in the testing spreadsheet but any that may have side effects.

Here we go:


Allow Python Selection for hashCreds()

Does dsiprouter resetpassword still correctly set the credentials?

Try logging in via the GUI using the credentials that the CLI printed.

Can they still be decrypted afterwards by the library?

source /opt/dsiprouter/dsiprouter/dsip_lib.sh
decryptConfigAttrib KAM_DB_PASS /etc/dsiprouter/gui/settings.py; echo '';

Fix HA Script Not Removing init Commands

After a cluster install with pacemaker does dsip-init.service get configured correctly?
Example cluster install:

## dsiprouter install: synchronized settings (all settings), active/passive routing/VIP, active/active DBs
./dsiprouter.sh clusterinstall -i ~/.ssh/dopensource-key.pem root@v0722-sbc01.test.dsiprouter.net root@v0722-sbc02.test.dsiprouter.net -- -all -dsipcsync 1
./HA/mysql/installAAGaleraReplication.sh -i ~/.ssh/dopensource-key.pem root@v0722-sbc01.test.dsiprouter.net root@v0722-sbc02.test.dsiprouter.net
./HA/pacemaker/installKamCluster.sh -vip 206.189.252.38 --do-token=dop_v1_... -i ~/.ssh/dopensource-key.pem root@v0722-sbc01.test.dsiprouter.net root@v0722-sbc02.test.dsiprouter.net

Then check to make sure the update* commands were removed:

grep 'dsiprouter update' /lib/systemd/system/dsip-init.service

Allow External RTPEngine to be Configured Support Remote RTPEngine Media Server

Install rtpengine on node1:

git clone -b installation_updates https://github.com/devopsec/dsiprouter.git /opt/dsiprouter
/opt/dsiprouter/dsiprouter.sh install -rtp

Update RTPEngine on node1 to allow remote connections.
Edit rtpengine config (vim /etc/rtpengine/rtpengine.conf) and set listen-ng = 0.0.0.0:7722.
Add firewall rule:

firewall-cmd --zone=public --add-port=7722/udp --permanent
firewall-cmd --reload

Install dsiprouter with remote rtpengine connection on node2:

git clone -b installation_updates https://github.com/devopsec/dsiprouter.git /opt/dsiprouter
/opt/dsiprouter/dsiprouter.sh install --rtpengine-uri='udp:NODE1_IP:7722'

Create a test carrier group, endpoint group, and inbound route to that endpoint group.
Send a test call that hits the inbound route.
Do we still have audio?
Is the SDP c= parameter set to the ip address of node1 instead of node2? (viewable via network capture, such as in sngrep).


Compartmentalize Mysql Portion of Installation

Does mysql still install correctly with dsiprouter.sh install -all?
Can mysql be installed separately using dsiprouter.sh install -mysql?


Fix Homer Updates in RTPEngine Config Fix HEP Port Not Set In Some Cases

On an install with homer provided, are the settings passed down to kamailio and rtpengine configs?
Note that homer does not really need to exist on a separate server to test this.

git clone -b installation_updates https://github.com/devopsec/dsiprouter.git /opt/dsiprouter
/opt/dsiprouter/dsiprouter.sh install -all -homer '127.0.0.1:9060'

grep HOMER /etc/rtpengine/rtpengine.conf
grep HOMER /etc/kamailio/kamailio.cfg

Do the same updates get applied correctly when the settings are changes and configure* commands are run?
First update HOMER_HEP_HOST and HOMER_HEP_PORT in /etc/dsiprouter/gui/settings.py:

HOMER_HEP_HOST = '127.0.0.1'
HOMER_HEP_PORT = 9999

Run the configure commands and check rtpengine / kamailio configs:

dsiprouter configurertp
dsiprouter configurekam

grep HOMER /etc/rtpengine/rtpengine.conf
grep HOMER /etc/kamailio/kamailio.cfg

My recommendation for OS selection would be to test stable supported OS as listed in the docs and dsiprouter.sh.