Skip to content

Commit

Permalink
fix for #153
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Jul 24, 2024
1 parent 4153a14 commit f21b1b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ function handle(removeFromSet, setName, signal) {

const parseHostPorts = (hostports) => {
let obj = {};
logger.info({hostports}, 'sip endpoints');
for (const hp of hostports) {
const arr = /^(.*)\/(.*):(\d+)$/.exec(hp);
if (arr) {
Expand All @@ -378,6 +379,12 @@ const parseHostPorts = (hostports) => {
udp: `${ipv4}:${port}`
};
break;
case 'tcp':
obj = {
...obj,
tcp: `${ipv4}:${port}`
};
break;
case 'tls':
obj = {
...obj,
Expand All @@ -395,6 +402,9 @@ const parseHostPorts = (hostports) => {
if (!obj.tls) {
obj.tls = `${srf.locals.sipAddress}:5061`;
}
if (!obj.tcp) {
obj.tcp = `${srf.locals.sipAddress}:5060`;
}
}
logger.info({obj}, 'sip endpoints');
return obj;
Expand Down

0 comments on commit f21b1b5

Please sign in to comment.