Skip to content

Commit

Permalink
Fixed bug for removing calls without having ex_rtpEngine enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Mar 14, 2021
1 parent 45106d9 commit a1e5813
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 27 deletions.
40 changes: 22 additions & 18 deletions compliance.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
version: '3.7'
services:

redis:
image: redis:4.0.5-alpine
image: redis:6.0.3-alpine
command: ["redis-server", "--appendonly", "yes"]
expose: [6379]

routr-eet:
image: fonoster/routr-eet:latest
expose: [5061, 5062]
env_file: .env
env_file: env_test

routr:
links:
- "routr-eet:sip.provider.net"
build:
context: .
image: fonoster/routr:latest
environment:
ROUTR_EXTERN_ADDR: 127.0.0.1
ROUTR_DS_PROVIDER: redis_data_provider
ROUTR_DS_PARAMETERS: host=redis,port=6379
EXTERN_ADDR: 127.0.0.1
DATA_SOURCE_PROVIDER: redis_data_provider
DATA_SOURCE_PARAMETERS: host=redis,port=6379
expose: [4567, 5060]

provisioner:
build:
context: .rctl
entrypoint: |
sh -c '
while ! nc -z routr 4567; do sleep 5; done
rctl login https://routr:4567/api/v1beta1 -u admin -p changeit
rctl create -f /opt/routr/config/gateways.yml
rctl create -f /opt/routr/config/numbers.yml
rctl create -f /opt/routr/config/domains.yml
rctl create -f /opt/routr/config/agents.yml
while sleep 3600; do :; done
'
image: fonoster/routr-ctl
entrypoint: >
/bin/sh -c "
set -e;
while ! nc -z routr 4567;do sleep 5; done
rctl login https://routr:4567/api/v1beta1 -u admin -p changeit;
rctl create -f /config/gateways.yml
rctl create -f /config/numbers.yml
rctl create -f /config/domains.yml
rctl create -f /config/agents.yml
exit 0;
"
volumes:
- ./config:/opt/routr/config:ro
- ./config:/config:ro
File renamed without changes.
1 change: 0 additions & 1 deletion mod/core/config.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const sinon = require('sinon')
const sinonChai = require('sinon-chai')
chai.use(sinonChai)
const expect = chai.expect
var sandbox = sinon.createSandbox()
const defaults = require('@routr/core/config/config_defaults')(new Date())
const configFromEnv = require('@routr/core/config/config_from_env')

Expand Down
5 changes: 4 additions & 1 deletion mod/core/processor/request_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ class RequestHandler {
)
}

if (request.getMethod() === Request.BYE) {
if (
request.getMethod() === Request.BYE &&
config.spec.ex_rtpEngine.enabled
) {
const callId = request.getHeader(CallIdHeader.NAME).getCallId()
const fromTag = request.getHeader(FromHeader.NAME).getTag()
await this.rtpeConnector.delete(callId, fromTag)
Expand Down
25 changes: 18 additions & 7 deletions nattests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
ipv4_address: $REDIS_PUBLIC_IP
private_net:
ipv4_address: $REDIS_PRIVATE_IP

proxy_a:
links:
- "phone_s1:sip.provider.net"
Expand All @@ -27,6 +28,7 @@ services:
ipv4_address: $PROXY_A_PUBLIC_IP
private_net:
ipv4_address: $PROXY_A_PRIVATE_IP

proxy_b:
links:
- "phone_s1:sip.provider.net"
Expand All @@ -43,8 +45,9 @@ services:
networks:
public_net:
ipv4_address: $PROXY_B_PUBLIC_IP

phone_e1:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060, 9330]
networks:
Expand All @@ -55,8 +58,9 @@ services:
while ! nc -z $PROXY_A_PRIVATE_IP 4567; do sleep 0.1; done
node eet/ua_srv.js
'
phone_e2:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060, 9330]
networks:
Expand All @@ -67,34 +71,39 @@ services:
while ! nc -z $PROXY_A_PRIVATE_IP 4567; do sleep 0.1; done
node eet/ua_srv.js
'
phone_e3:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060]
networks:
public_net:
ipv4_address: $PHONE_E3_IP

phone_e4:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060, 9330]
networks:
public_net:
ipv4_address: $PHONE_E4_IP

phone_s1:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060, 9330]
networks:
public_net:
ipv4_address: $PHONE_S1_IP

phone_s2:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
expose: [5060, 9330]
networks:
public_net:
ipv4_address: $PHONE_S2_IP

provisioner:
build:
context: .rctl
Expand All @@ -115,8 +124,9 @@ services:
'
volumes:
- ./config:/opt/routr/config:ro

controller:
env_file: .env
env_file: env_test
image: fonoster/routr-eet:latest
networks:
public_net:
Expand All @@ -129,6 +139,7 @@ services:
while ! nc -z $PHONE_E2_IP $UA_SRV_DEFAULT_PORT; do sleep 0.1; done
node eet/ua_ctl.js
'
networks:
public_net:
driver: "bridge"
Expand Down

0 comments on commit a1e5813

Please sign in to comment.