Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync branch #196

Merged
merged 15 commits into from
May 13, 2024
2 changes: 1 addition & 1 deletion src/basic-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export PATH+=':/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
readonly PKS_GIT_URL="https://raw.githubusercontent.com/mwolff44/pyfreebilling"
readonly PKS_INSTALL_DIR="/srv/pks/scripts"
readonly PKS_BIN_DIR="/usr/local/bin"
readonly VERSION="v4.0.1"
readonly VERSION="v4.1.2"

# Install the PKS script from repository
installScript() {
Expand Down
7 changes: 5 additions & 2 deletions src/pks
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
export PATH+=':/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

# Variables
VERSION="v4.1.1"
VERSION="v4.1.2"
readonly PKS_GIT_URL="https://raw.githubusercontent.com/mwolff44/pyfreebilling"
readonly DATA_DIR="/srv"
ENV_FILE="/srv/pks/.env"
Expand Down Expand Up @@ -377,6 +377,9 @@ installFunc(){
# Create necessary directories
install -d "${DATA_DIR}/pks/db"
install -d "${DATA_DIR}/pks/redis"
install -d "${DATA_DIR}/pks/caddy"
install -d "${DATA_DIR}/pks/caddy/config"
install -d "${DATA_DIR}/pks/caddy/data"

# Create files for configuration
[[ -f "${DATA_DIR}/pks/.env" ]] || touch "${DATA_DIR}/pks/.env"
Expand All @@ -390,7 +393,7 @@ installFunc(){
# [[ -f "${DATA_DIR}/pks/db/version" ]] || curl -fsSL -o "${DATA_DIR}/pks/db/version" "$PKS_GIT_URL/$VERSION/src/sip/db/version"

## Define env variables
if [ -f "${DATA_DIR}/pks/.install.lock" ]; then
if [[ -f "${DATA_DIR}/pks/.install.lock" ]]; then
printf " %b %b Not a new install. Edit manually .env file for any changes! %b\\n" "${TICK}" "${COL_YELLOW}" "${COL_NC}"
else
# Set DBTEXT as DB
Expand Down
20 changes: 16 additions & 4 deletions src/sip/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
pks-sip:
container_name: pks-sip
hostname: sip.pks.local
image: mwolff44w/pks-sipproxy:v4.1.1
image: mwolff44w/pks-sipproxy:v4.1.2
restart: unless-stopped
volumes:
- pks-db-data:/etc/kamailio/db:ro
Expand Down Expand Up @@ -116,8 +116,8 @@ services:
restart: unless-stopped
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- caddy-config:/config
- caddy-data:/data
- pks-caddy-config:/config
- pks-caddy-data:/data
logging:
driver: "json-file"
options:
Expand All @@ -132,7 +132,7 @@ services:
pks-admin:
container_name: pks-admin
hostname: admin.pks.local
image: mwolff44w/pks-admin:v1.3.0
image: mwolff44w/pks-admin:v1.3.1
restart: unless-stopped
depends_on:
pks-db:
Expand Down Expand Up @@ -165,3 +165,15 @@ volumes:
type: 'none'
o: 'bind'
device: '/srv/pks/db'
pks-caddy-config:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/srv/pks/caddy/config'
pks-caddy-data:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/srv/pks/caddy/data'
8 changes: 0 additions & 8 deletions src/sip/kamailio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,6 @@ route[REQINIT] {
xlog("Malformed SIP request from $si:$sp\n");
exit;
}

if (is_method("INVITE")) {
if !($rU =~ "^[0-9]{1,15}$") {
# we expect the R-URI username to consist of up to 15 digits only
xlog("Malformed R-URI username: '$rU'\n");
exit;
}
}
}

# Handle requests within SIP dialogs
Expand Down