5 module.exports = function(sequelize, DataTypes) {
7 var ReportCall = sequelize.define('ReportCall', {
9 type: DataTypes.STRING,
14 values: ['inbound', 'internal', 'outbound', 'inbound-fax', 'outbound-fax', 'tigerdial']
16 tag: DataTypes.STRING,
17 accountcode: DataTypes.STRING,
18 source: DataTypes.STRING,
19 destination: DataTypes.STRING,
20 destinationcontext: DataTypes.STRING,
21 callerid: DataTypes.STRING,
22 channel: DataTypes.STRING,
23 destinationchannel: DataTypes.STRING,
24 lastapplication: DataTypes.STRING,
25 lastdata: DataTypes.STRING,
26 starttime: DataTypes.DATE,
29 set: function(answertime) {
30 if (answertime !== '') {
31 this.setDataValue('answertime', answertime);
33 this.setDataValue('answertime', null);
37 endtime: DataTypes.DATE,
38 duration: DataTypes.INTEGER,
39 billableseconds: DataTypes.INTEGER,
40 disposition: DataTypes.STRING,
41 amaflags: DataTypes.STRING,
42 userfield: DataTypes.STRING
44 tableName: 'report_call',
45 associate: function(models) {
46 ReportCall.hasMany(models.ReportQueue, {
48 foreignKey: 'uniqueid',
51 ReportCall.hasMany(models.ReportAgent, {
53 foreignKey: 'uniqueid',