mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2025-12-19 04:27:45 +00:00
4
.github/workflows/docker-publish.yml
vendored
4
.github/workflows/docker-publish.yml
vendored
@@ -2,6 +2,8 @@ name: Docker
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
@@ -18,7 +20,7 @@ jobs:
|
|||||||
- name: prepare tag
|
- name: prepare tag
|
||||||
id: prepare_tag
|
id: prepare_tag
|
||||||
run: |
|
run: |
|
||||||
IMAGE_ID=$GITHUB_REPOSITORY
|
IMAGE_ID=jambonz/sbc-outbound
|
||||||
|
|
||||||
# Strip git ref prefix from version
|
# Strip git ref prefix from version
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||||
|
|||||||
@@ -33,19 +33,21 @@ const createBLegToHeader = (req, teams) => {
|
|||||||
return `sip:anonymous@${host}`;
|
return `sip:anonymous@${host}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initCdr = (srf, req) => {
|
const initCdr = (req, invite) => {
|
||||||
const uri = parseUri(req.uri);
|
const {srf} = req;
|
||||||
|
const {trace_id} = req.locals;
|
||||||
|
const uri = parseUri(invite.uri);
|
||||||
const regex = /^\+(\d+)$/;
|
const regex = /^\+(\d+)$/;
|
||||||
let arr = regex.exec(req.calledNumber);
|
let arr = regex.exec(invite.calledNumber);
|
||||||
const to = arr ? arr[1] : req.calledNumber;
|
const to = arr ? arr[1] : invite.calledNumber;
|
||||||
arr = regex.exec(req.callingNumber);
|
arr = regex.exec(invite.callingNumber);
|
||||||
const from = arr ? arr[1] : req.callingNumber;
|
const from = arr ? arr[1] : invite.callingNumber;
|
||||||
const applicationSid = req.get('X-Application-Sid');
|
const applicationSid = req.get('X-Application-Sid');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
account_sid: req.get('X-Account-Sid'),
|
account_sid: req.get('X-Account-Sid'),
|
||||||
call_sid: req.get('X-Call-Sid'),
|
call_sid: req.get('X-Call-Sid'),
|
||||||
sip_callid: req.get('Call-ID'),
|
sip_callid: invite.get('Call-ID'),
|
||||||
...(applicationSid && {application_sid: applicationSid}),
|
...(applicationSid && {application_sid: applicationSid}),
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
@@ -55,7 +57,7 @@ const initCdr = (srf, req) => {
|
|||||||
direction: 'outbound',
|
direction: 'outbound',
|
||||||
host: srf.locals.sipAddress,
|
host: srf.locals.sipAddress,
|
||||||
remote_host: uri.host,
|
remote_host: uri.host,
|
||||||
trace_id: req.get('X-Trace-ID') || '00000000000000000000000000000000'
|
trace_id: trace_id || '00000000000000000000000000000000'
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -424,7 +426,7 @@ class CallSession extends Emitter {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.req.locals.cdr = {
|
this.req.locals.cdr = {
|
||||||
...initCdr(this.req.srf, inv),
|
...initCdr(this.req, inv),
|
||||||
service_provider_sid: this.req.locals.service_provider_sid,
|
service_provider_sid: this.req.locals.service_provider_sid,
|
||||||
account_sid: this.req.locals.account_sid,
|
account_sid: this.req.locals.account_sid,
|
||||||
...(this.req.locals.application_sid && {application_sid: this.req.locals.application_sid}),
|
...(this.req.locals.application_sid && {application_sid: this.req.locals.application_sid}),
|
||||||
|
|||||||
Reference in New Issue
Block a user