Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2706bc2
Update setting.controller.js
macide213 Mar 21, 2024
70ed7fd
Create Dockerfile
macide213 Mar 21, 2024
19fa8c3
Update setting.controller.js
macide213 Mar 21, 2024
d0406f6
Update setting.controller.js
macide213 Mar 21, 2024
00e75aa
Update package.json
macide213 Mar 21, 2024
3d7adbb
Update setting.controller.js
macide213 Mar 21, 2024
4c50153
Update setting.controller.js
macide213 Mar 21, 2024
f9f8135
Update telnyx.helper.js
macide213 Mar 21, 2024
b301da7
Update telnyx.helper.js
macide213 Mar 21, 2024
23f8b71
Update telnyx.helper.js
macide213 Mar 21, 2024
a7477cc
Update telnyx.helper.js
macide213 Mar 21, 2024
b10be69
Update telnyx.helper.js
macide213 Mar 21, 2024
ae83ab9
Update telnyx.helper.js
macide213 Mar 21, 2024
c13218f
Update telnyx.helper.js
macide213 Mar 21, 2024
32f4be0
Update telnyx.helper.js
macide213 Mar 22, 2024
84ad108
Update telnyx.helper.js
macide213 Mar 22, 2024
20ca741
Update telnyx.helper.js
macide213 Mar 22, 2024
7d1be54
update
macide213 Mar 22, 2024
3f7ed83
updates
macide213 Mar 22, 2024
327820d
updates
macide213 Mar 22, 2024
65fa55c
updates
macide213 Mar 22, 2024
df2991a
updtes
macide213 Mar 22, 2024
51d3fd4
updates
macide213 Mar 22, 2024
bb3d6e4
telnyx version to get outboundvoiceprofile create back
macide213 Mar 22, 2024
bcc70c4
debug updates
macide213 Mar 22, 2024
17e0790
debug
macide213 Mar 22, 2024
ded1d69
ebug
macide213 Mar 22, 2024
d697a2b
debuging
macide213 Mar 22, 2024
0893388
debug
macide213 Mar 22, 2024
07b2368
db
macide213 Mar 22, 2024
d789206
db
macide213 Mar 22, 2024
c5bfdec
gfd
macide213 Mar 25, 2024
bde88f5
Create docker-image.yml
macide213 Mar 25, 2024
0dacd9f
Merge branch '0perationPrivacy:main' into main
macide213 Nov 12, 2024
143881b
Update setting.controller.js
macide213 Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag macide/voipsuite:git
- name: Invoke deployment hook
uses: distributhor/workflow-webhook@v3
with:
webhook_type: 'json-extended'
webhook_url: 'https://portainer.derek.bartoli.me/api/stacks/webhooks/d0710922-0f3f-4a54-8035-eae4a4fe8bd6'
data: '{ }'
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM docker.io/library/node:alpine

# Choose the port
EXPOSE 3000:3000

# Environment variables
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
RUN apk update&&apk add git&&rm -rf /var/cache/apk/*
# Install app dependencies
WORKDIR /home/node/app
RUN git clone https://github.com/macide213/VoIP.git .
RUN npm install

# Install app
RUN chown -R node:node .
USER node

CMD [ "node", "app.js" ]
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = require('path');
var session = require('cookie-session')
var compression = require('compression')
app.use(compression())

console.log('new')
var expiryDate = new Date(Date.now() + 60 * 60 * (1000 * 12 * 30)) // 30 day
app.use(session({
name: 'session',
Expand Down
41 changes: 38 additions & 3 deletions app/helper/telnyx.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Telnyx = require('telnyx');
var axios = require('axios');
const moment = require('moment');
const crypto = require('crypto')
var util = require('util');
const { combineURLs } = require("./common.helper")

//Inside lib file declare functions
Expand Down Expand Up @@ -149,19 +150,53 @@ const deleteSIPApp = (apiKey, uuid) => {
}
});
}
function getAllMethods(object) {
Object.getOwnPropertyNames(object).filter(function(property) {
if(property.substring(0,1)=='_'){

}else{
try {
console.log(typeof object[property] + ': ' + property);
} catch (error) {
console.log(error.message)
}

if(typeof object[property] == 'object'){
console.log('----------------start ' + property)
try {
getAllMethods(object[property])
} catch (error) {
console.log(error.message)
}

console.log('----------------stop ' + property)
}
}
});
}

const createOutboundVoice = (apiKey) => {
return new Promise(async (resolve,reject) => {
try{

const myname = `outbound${moment().format('YYYYMMDDHHmm')}`
console.log('----------------telnyx')
const telnyx = Telnyx(apiKey);
getAllMethods(telnyx);
console.log('-------------outboundVoiceProfiles')
getAllMethods(telnyx.outboundVoiceProfiles);
//console.log('telnyx.outboundVoiceProfiles.create')
//getAllMethods(telnyx.outboundVoiceProfiles.create);
// In Node 10
const outboundVoiceProfiles = await telnyx.outboundVoiceProfiles.create(
{"name": `outbound${moment().format('YYYYMMDDHHmm')}`}
{"name": myname}
);
// console.log(outboundVoiceProfiles.data)
getAllMethods(outboundVoiceProfiles)
resolve(outboundVoiceProfiles);
}catch(error){
// console.log(error)
console.log(error.message)
console.log(error.stack)
resolve(false);
}
});
Expand Down Expand Up @@ -342,4 +377,4 @@ const getNumberData = async (data) => {

module.exports = {
requestCurl, createTexmlApp, updateTexmlApp, deleteTexmlApp, createSIPApp, updateSIPApp, deleteSIPApp, createOutboundVoice, deleteOutboundVoice, updatePhoneNumber, emptyMessageProfile, deleteMessageProfile, messageProfileFallback, texmlAppFalback, sIPAppFallback, messageProfileGet, texmlAppGet, sIPAppGet, getNumberData
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"mongoose": "^5.13.8",
"multer": "^1.4.3",
"multer": "^1.4.4-lts.1",
"node-cron": "^3.0.0",
"nodemailer": "^6.6.3",
"nodemailer-openpgp": "^2.1.0",
Expand All @@ -40,7 +40,7 @@
"request": "^2.88.2",
"socket.io": "^4.1.3",
"speakeasy": "^2.0.0",
"telnyx": "^1.18.0",
"telnyx": "1.23.0",
"twilio": "^3.67.0",
"u2f": "^0.1.3",
"validatorjs": "^3.22.1"
Expand Down