jambonz / sbc-inbound

SBC application that handles inbound calls
MIT License
5 stars 19 forks source link

Fear: Move PRIVATE_VOIP_NETWORK_CIDR configuration to Mysql #157

Closed vdharashive closed 1 month ago

vdharashive commented 1 month ago

PRIVATE_VOIP_NETWORK_CIDR any change in this require restart of services, which is not feasible , hence this configuration to move at db level

davehorton commented 1 month ago

what is the scenario where it would ever need to change, once set? Short of moving the system to a new network, I don't understand the need for this feature

vdharashive commented 1 month ago

@davehorton when jambonz is used to connect with multiple client as sas service , in that case there will be new client getting added , some client choose to connect over private network using VPN, in that case need to provide these private ips to send media and sip ack over private IP rather then public ips of jambonz

nitinpo-Kore commented 1 month ago

@davehorton when we put single ip in Private Network CIDR for example : 22.0.33.105 then it wont work giving below error:

43|sbc-inbound | {"level":30, "time": "2024-08-16T09:26:44.033Z","pid":46534,"hostname":"ip-22-0-30-164","err":{"type":"Error","message":"Invalid argument: / expected","stack":"Error: Invalid argument: / expected\n at new CIDR (/home/admin/apps/sbc-inbound/node_modules/ip6addr/ip6addr.js:352:13)\n at Object.createCIDR (/home/admin/apps/sbc-inbound/node_modules/ip6addr/ip6addr.js:711:12)\n at Matcher.addNetworkClass (/home/admin/apps/sbc-inbound/node_modules/cidr-matcher/src/Matcher.js:20:24)\n at new Matcher (/home/admin/apps/sbc-inbound/node_modules/cidr-matcher/src/Matcher.js:15:14)\n at isPrivateVoipNetwork (/home/admin/apps/sbc-inbound/lib/utils.js:209:23)\n at CallSession.connect (/home/admin/apps/sbc-inbound/lib/call-session.js:190:22)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"},"privateNetworkCidr":"22.0.33.105","msg":"Error checking private network CIDR, probably misconfigured must be a comma separated list of CIDRs"} 43|sbc-inbound | {"level":30, "time": "2024-08-16T09:26:44.034Z","pid":46534,"hostname":"ip-22-0-30-164","err":{"type":"Error","message":"Invalid argument: / expected","stack":"Error: Invalid argument: / expected\n at new CIDR (/home/admin/apps/sbc-inbound/node_modules/ip6addr/ip6addr.js:352:13)\n at Object.createCIDR (/home/admin/apps/sbc-inbound/node_modules/ip6addr/ip6addr.js:711:12)\n at Matcher.addNetworkClass (/home/admin/apps/sbc-inbound/node_modules/cidr-matcher/src/Matcher.js:20:24)\n at new Matcher (/home/admin/apps/sbc-inbound/node_modules/cidr-matcher/src/Matcher.js:15:14)\n at isPrivateVoipNetwork (/home/admin/apps/sbc-inbound/lib/utils.js:209:23)\n at CallSession.connect (/home/admin/apps/sbc-inbound/lib/call-session.js:227:11)"},"privateNetworkCidr":"22.0.33.105","msg":"Error checking private network CIDR, probably misconfigured must be a comma separated list of CIDRs"} 46|savgw-feature-server | {"level":30,"time":1723800404035,"pid":46600,"hostname":"ip-22-0-30-164","uri":{"family":"ipv4","scheme":"sip","user":"9768342044","host":"22.0.30.164","port":5070,"params":{},"headers":{}},"callId":"7e55b399-d654-123d-5a89-0ef13ccecf85","callingNumber":"PRIVATE_TEST","calledNumber":"9768342044","msg":"new incoming call"}

when we add multiple ip like these : 22.0.33.105/32,22.0.33.0/24 its working fine...

davehorton commented 1 month ago

you must add that single arg as 22.0.33.105/32, ie with netmask

nitinpo-Kore commented 1 month ago

you must add that single arg as 22.0.33.105/32, ie with netmask

Without a comma its working fine i have used only [22.0.33.105/32] now.