Built motion from commit 79c4046.|0.0.100
[motion.git] / server / config / autodialer / index.js
index a47295f..7150ece 100644 (file)
@@ -1,125 +1 @@
-'use strict';
-var util = require('util');
-var Process = require('./process');
-
-module.exports = function(ami) {
-
-  console.log('Autodialer Starting...');
-  var proc = new Process();
-
-  proc.getProcesses(function(res, err) {
-    if(err)
-    {
-      console.log(err);
-      return;
-    }
-    // console.log(res.Contacts);
-    // if (util.isArray(res.Contacts))
-    // {
-    //   var contact = res.Contacts;
-    //   console.log(contact);
-    // }
-    // else
-    // {
-    //   var contacts = res.Contacts;
-    //   if (contacts.length)
-    //   {
-    //     contacts.forEach(function(contact) {
-    //       console.log(contact);
-    //     })
-    //   }
-    // }
-
-
-
-  });
-
-}
-
-// var _ = require('lodash');
-//
-// var agents = ['SIP/massimiliano.bungaro', 'SIP/daniele.cinti'];
-// var channels = [];
-// var peers = [];
-// var contacts = ['600', '600', '600'];
-//
-// var ami;
-//
-// function coreshow() {
-//   channels = [];
-//   if (contacts.length > 0) {
-//     ami.action({
-//       action: 'CoreShowChannels'
-//     }, function(err, res) {
-//       if (err) {
-//         console.log(err);
-//       }
-//       console.log(res);
-//     });
-//   }
-//
-// }
-//
-// function peerstatus() {
-//   peers = [];
-//   if (contacts.length > 0) {
-//     ami.action({
-//       action: 'SIPpeerstatus'
-//     }, function(err, res) {
-//       if (err) {
-//         console.log(err);
-//       }
-//       console.log(res);
-//     })
-//   }
-// }
-//
-// module.exports = function(asterisk_manager) {
-//
-//   ami = asterisk_manager;
-//
-//   peerstatus();
-//
-//   ami.on('peerstatus', function(evt) {
-//     if (evt.peerstatus == 'Reachable') {
-//       peers.push(evt.peer);
-//     }
-//   });
-//
-//   ami.on('coreshowchannel', function(evt) {
-//     channels.push(evt.channel.split('-')[0]);
-//   });
-//
-//   ami.on('sippeerstatuscomplete', function(evt) {
-//     coreshow();
-//   });
-//
-//   ami.on('coreshowchannelscomplete', function(evt) {
-//     console.log('Agents registered ', peers);
-//     console.log('Agents in call ', channels);
-//
-//
-//     var agent = _.find(agents, function(agent) {
-//       return !_.includes(channels, agent);
-//     });
-//
-//     if (agent) {
-//       if (_.includes(peers, agent)) {
-//         ami.action({
-//           action: 'originate',
-//           channel: agent,
-//           exten: contacts.pop(),
-//           context: 'demo',
-//           priority: 1,
-//           async: true
-//         }, function(err, res) {
-//           if (err) {
-//             console.log(err);
-//           }
-//           console.log(res);
-//         });
-//       }
-//     }
-//     peerstatus();
-//   });
-// };
+var _0x986d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x2E\x2F\x70\x72\x6F\x63\x65\x73\x73","\x65\x78\x70\x6F\x72\x74\x73","\x41\x75\x74\x6F\x64\x69\x61\x6C\x65\x72\x20\x53\x74\x61\x72\x74\x69\x6E\x67\x2E\x2E\x2E","\x6C\x6F\x67","\x67\x65\x74\x50\x72\x6F\x63\x65\x73\x73\x65\x73"];_0x986d[0];var util=require(_0x986d[1]);var Process=require(_0x986d[2]);module[_0x986d[3]]=function(_0x5658x3){console[_0x986d[5]](_0x986d[4]);var _0x5658x4= new Process();_0x5658x4[_0x986d[6]](function(_0x5658x5,_0x5658x6){if(_0x5658x6){console[_0x986d[5]](_0x5658x6);return}})}
\ No newline at end of file