-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Hello Dave,
Me and a colleague of mine are working on an academic project that we are building based on this Drachtio and Freeswitch framework but we have been running into some problems playing audio into our call as was somewhat described here. We use containers for both of them as is suggested in several of your readmes/comments.
I decided to open a new issue with more info so that maybe we could pinpoint the problem since we have been stuck on this for a long time
We changed our app.js to be similar to what you showed us and right now it looks like this:
const Srf = require('drachtio-srf');
const srf = new Srf();
const Mrf = require('drachtio-fsmrf');
const mrf = new Mrf(srf);
srf.connect({
"host": "127.0.0.1",
"port": 9060,
"secret": "cymru"
})
.on('connect', (err, hp) => console.log(`connected to sip on ${hp}`))
.on('error', (err) => console.log(err, 'Error connecting'));
srf.register((req, res) => {
res.send(200);
});
srf.invite(async(req, res) => {
try {
const ms = await mrf.connect(
{ address:'127.0.0.1',
port: 9070,
secret: 'ClueCon'});
const {endpoint, dialog} = await ms.connectCaller(req, res);
console.log('Call connected');
dialog.on('destroy', () => {
console.log('Call ended');
endpoint.destroy();
});
// await endpoint.play('/file.wav');
await endpoint.play('http://www.music.helsinki.fi/tmt/opetus/uusmedia/esim/a2002011001-e02.wav');
console.log('Finished playing');
} catch (err) {
console.log(err);
}
});
Dockerfile:
version: '3'
networks:
sip-stack-drachtio:
driver: bridge
ipam:
config:
- subnet: 172.38.0.0/16
services:
drachtio-server:
image: drachtio/drachtio-server:latest
command: drachtio --contact "sip:*;transport=udp" --loglevel warning --sofia-loglevel 9
container_name: drachtio
ports:
- "9060:9022/tcp"
- "5060:5060/tcp"
- "5060:5060/udp"
networks:
sip-stack-drachtio:
ipv4_address: 172.38.0.13
freeswitch:
image: drachtio/drachtio-freeswitch-mrf:latest
command: freeswitch --sip-port 5060 --rtp-range-start 20000 --rtp-range-end 20040
container_name: freeswitch
ports:
- "9070:8021/tcp"
- "20000-20040:20000-20040/udp"
- "20000-20040:20000-20040/tcp"
networks:
sip-stack-drachtio:
ipv4_address: 172.38.0.14
package related dependencies:
"dependencies": {
"drachtio-fn-fsmrf-sugar": "0.0.9",
"drachtio-fsmrf": "^1.5.7",
"drachtio-mw-registration-parser": "^0.1.0",
"drachtio-srf": "^4.4.18"
}
We use zoiper5 to make a call. The registration process works, the call is accepted and it hangs on silently for some time (around 30s) before printing the "Call ended" and "Finished playing" logs.
Are we doing something wrong? Could this be a container issue? We are not sure what else to test. I've considered running freeswitch locally on my machine to test but the configuration needed to set it up with drachtio is kind of scary for a newbie and deterred me.
Thank you in advance :)