Skip to content

Commit

Permalink
Getting ready for RC6
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Oct 18, 2021
1 parent e0eb662 commit f28cc7d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:buster-20200414
FROM debian:buster
LABEL maintainer="Pedro Sanders <[email protected]>"

ENV TINI_VERSION v0.19.0
Expand Down
10 changes: 3 additions & 7 deletions mod/core/processor/request_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const {
configureIdentity,
configureXHeaders,
configureCSeq,
isInDialog
isInDialog,
getTargetTransport
} = require('@routr/core/processor/request_utils')
const { directionFromRequest } = require('@routr/rtpengine/utils')
const { RoutingType } = require('@routr/core/routing_type')
Expand Down Expand Up @@ -159,12 +160,7 @@ class RequestHandler {
)

// Next hop transport protocol
const targetTransport = route
? route.transport
: request
.getRequestURI()
.getParameter('transport')
.toLowerCase()
const targetTransport = getTargetTransport(route, request)

LOG.debug(
`core.processor.RequestHandler.processRoute [targetTransport = ${targetTransport}]`
Expand Down
20 changes: 18 additions & 2 deletions mod/core/processor/request_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ const configureRoute = (request, originInterfaceAddr, targetInterfaceAddr) => {
const requestOut = request.clone()
const routeHeader = request.getHeader(RouteHeader.NAME)
if (routeHeader) {
// 52.174.241.181
const host = routeHeader
.getAddress()
.getURI()
Expand All @@ -127,7 +126,7 @@ const configureRoute = (request, originInterfaceAddr, targetInterfaceAddr) => {
)

LOG.debug(
`core.processor.RequestUtils.configureRoute [host = ${host}, port=${port}]`
`core.processor.RequestUtils.configureRoute [host = ${host}, port = ${port}]`
)

const c = [originInterfaceAddr, targetInterfaceAddr].filter(
Expand Down Expand Up @@ -283,6 +282,22 @@ const isInDialog = request =>
request.getHeader(ToHeader.NAME).getTag() !== null &&
request.getHeader(FromHeader.NAME).getTag() !== null

const getTargetTransport = (route, request) => {
const routeHeader = request.getHeader(RouteHeader.NAME)

if (routeHeader) {
const transport = routeHeader.getParameter('transport') || 'tcp'
return transport.toLowerCase()
} else if (route) {
return route.transport
}

return request
.getRequestURI()
.getParameter('transport')
.toLowerCase()
}

module.exports.getEdgeAddr = getEdgeAddr
module.exports.configureRoute = configureRoute
module.exports.configureVia = configureVia
Expand All @@ -296,3 +311,4 @@ module.exports.configureIdentity = configureIdentity
module.exports.configureXHeaders = configureXHeaders
module.exports.configureCSeq = configureCSeq
module.exports.isInDialog = isInDialog
module.exports.getTargetTransport = getTargetTransport
2 changes: 1 addition & 1 deletion mod/core/processor/response_processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ResponseProcessor {

if (
config.spec.ex_rtpEngine.enabled &&
isOk(response) &&
(isOk(response) || response.getStatusCode() === 183) &&
hasSDP(response)
) {
const obj = await this.rtpeConnector.answer(
Expand Down
5 changes: 3 additions & 2 deletions mod/data_api/files_datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ class FilesDataSource {
RESOURCES[CNT]
}.yml\` is invalid`
)
} else {
System.exit(1)
} /*else {
LOG.error(e)
}
System.exit(1)
System.exit(1)*/
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f28cc7d

Please sign in to comment.