This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Srf = require('drachtio-srf'); | |
| const srf = new Srf(); | |
| const rtpengineClient = require('rtpengine-client').Client; | |
| const { v4: uuid } = require('uuid'); | |
| const sdpTransform = require('sdp-transform'); | |
| const config = { | |
| 'drachtio': { | |
| "host": "drachtio", | |
| "port": 9022, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User Agent A | UAS server | rtpengine | |
| INVITE (offer) | | |
| -------------|-------> | | |
| | ng offer | |
| | ---------|-----> | |
| | ng answer | |
| | <--------|------ | |
| 200 (answer) | | |
| <-------|--------- | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User Agent A | B2BUA server | rtpengine | User Agent B | |
| INVITE (offer) | | | |
| -------------|-------> | | | |
| | ng offer | | |
| | ---------|-----> | | |
| | ng rewritten offer| | |
| | <--------|------ | | |
| | INVITE (rewritten offer) | |
| | ---------|-----------|-----> | |
| | 200 (answer) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.OPENAI_API_BASE = 'http://127.0.0.1:5001/v1'; | |
| const { OpenAI } = require("langchain/llms/openai"); | |
| const model = new OpenAI( | |
| { | |
| openAIApiKey: 'sk-dummy', | |
| temperature: 0.9, | |
| }, | |
| { | |
| basePath: process.env.OPENAI_API_BASE | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| files: | |
| - source: files/codedeploy_install_instruction.patch | |
| destination: /tmp | |
| hooks: | |
| AfterInstall: | |
| - location: scripts/patch_codedeploy_and_restart.sh | |
| timeout: 300 | |
| runas: root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Srf = require('drachtio-srf'); | |
| const Mrf = require('drachtio-fsmrf'); | |
| const config = require('config'); | |
| const srf = new Srf() ; | |
| const mrf = new Mrf(srf) ; | |
| // Connect to drachtio server using SRF - sync | |
| srf.connect(config.get('drachtio'), (err, srf) => { | |
| if (err) return log_to_console(false, `error connecting to drachtio: ${err}`); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const calls = require('./calls'); | |
| srf.invite(async(req, res) => { | |
| const ms = req.app.locals.ms; | |
| const to_number = calls.convertToE164(req.calledNumber); | |
| let ep, dlg; | |
| try { | |
| const {endpoint, dialog} = await ms.connectCaller(req, res); | |
| ep = endpoint; | |
| dlg = dialog; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calls = require('./calls') | |
| srf.invite((req, res) => { | |
| return res.send(500); | |
| const ms = req.app.locals.ms; | |
| ms.connectCaller(req, res, next) | |
| .then(({endpoint, dialog}) => { | |
| console.log("Never get here") | |
| }); | |
| }); // End ms.ConnectCaller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calls = require('./calls') | |
| srf.invite((req, res) => { | |
| const ms = req.app.locals.ms; | |
| ms.connectCaller(req, res, next) | |
| .then(({endpoint, dialog}) => { | |
| setHandlers(req, res, dialog, endpoint) | |
| to = calls.parseURI(req.msg.headers.to); | |
| to_number = calls.convertToE164(to.user) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: all | |
| become: true | |
| become_user: "root" | |
| become_method: sudo | |
| tasks: | |
| - name: Enable epel | |
| shell: | |
| cmd: '/usr/bin/amazon-linux-extras enable epel' | |
| - name: Install epel |
NewerOlder