src/configuration.js
/**
* @file Contains configuration values and functions.
* @author schampagne
*/
var SDP = require('sdp-transform');
/**
* @module
* Configuration parameters.
*/
module.exports = {
/**
* Dev/Program Info
*/
debug: 1, //0: no debug, 1: yes debug
logToFile: false, //if false, logs go to console
/**
* SIP server parameters
*/
sipServer: 'webrtcvasterisk.task3acrdemo.com',//'192.168.87.3',
sipWsPort: '443',
sipId: '33005',
sipPass: '1qaz1qaz',
credArray: [{ sipId: '33005', sipPass: '1qaz1qaz'}],
/**
* Kurento server location
*/
kurentoServer: "wss://webrtcvasterisk.task3acrdemo.com:8443/kurento", //"ws://kurento.task3acrdemo.com:8111/kurento";
/**
* Media specific parameters
* Go to /media and /recordings of wherever is specified.
* For our docker image:
* /home/centos/acedirect-kurento-docker/recordings/recordings
* /home/centos/acedirect-kurento-docker/recordings/media
*/
path: 'file:///tmp/', //'file://' + __dirname + '/', //Default path to "recordings" and "media" folders
playFileIntro: 'preparing.mp4',
playFileRec: 'recording.mp4',
playEncodedMedia: true,
incomingMediaProfile: 'WEBM',
recordingFormat: 'webm',
allowableVideoCodecs: ['VP8', 'H264'],
allowableAudioCodecs: ['PCMU', 'PCMA'],
/**
* Modify the incoming SDP before it is passed on to Kurento.
*
* CURRENTLY NOT MODIFYING ANYTHING
*/
modifySdpIncoming: function(sdpOffer) {
var sdp = SDP.parse(sdpOffer);
//Set to sendonly
//sdp.direction = 'sendonly';
//Change contact IP in connection field.
//sdp.connection.ip = '192.168.87.3';
return SDP.write(sdp);
},
/**
* Return a modified SDP, based on either the SDP offer or the generated answer provided
*
* CURRENTLY NOT MODIFYING ANYTHING
*/
modifySdpOutgoing: function(sdpOffer, sdpAnswer) {
var sdp = SDP.parse(sdpAnswer);
//Make all ports reflect ports received in offer
/*var offer = SDP.parse(sdpOffer);
var i = 0;
while (offer.media[i] && sdp.media[i]) {
sdp.media[i].port = offer.media[i].port;
i++;
}*/
//Change contact IP in connection field.
//sdp.connection.ip = '192.168.87.3';
//Change the sender line to a specified string.
//sdp.name = "Kurento-Asterisk Videomail Client";
//Force the SDP to say it's recvonly
//sdp.direction = 'recvonly';
return SDP.write(sdp);
}
}