385e47e5c160a33000211ed6bc00160c0a244f85
[motion2.git] / server / services / ami / dialer / action.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x742c=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','number','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x40d7fe,_0x7e9eda){var _0x198c42=function(_0x13bf32){while(--_0x13bf32){_0x40d7fe['push'](_0x40d7fe['shift']());}};_0x198c42(++_0x7e9eda);}(_0x742c,0x92));var _0xc742=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x742c[_0x557f5f];return _0x196eba;};'use strict';var util=require(_0xc742('0x0'));var _=require(_0xc742('0x1'));var moment=require(_0xc742('0x2'));function checkNameSurname(_0x4bf6ff,_0x31cf81,_0x3842db){var _0x46c06f='';if(!_['isNil'](_0x31cf81)&&'string'===typeof _0x31cf81){_0x46c06f+=_0x31cf81;}if(!_[_0xc742('0x3')](_0x3842db)&&_0xc742('0x4')===typeof _0x3842db){_0x46c06f+='\x20'+_0x3842db;}if(_0x46c06f!==''){return _0x46c06f;}return _0x4bf6ff;}function Action(_0x4a9ac9,_0x5e5e96,_0x57b9ad){this[_0xc742('0x5')]=_0x4a9ac9;this[_0xc742('0x6')]=_0x57b9ad||undefined;this[_0xc742('0x7')]=checkNameSurname(_0x5e5e96[_0xc742('0x8')]['phone'],_0x5e5e96[_0xc742('0x8')]['firstName'],_0x5e5e96[_0xc742('0x8')][_0xc742('0x9')]);this['number']=_0x5e5e96['phone'];this[_0xc742('0xa')]=_0x4a9ac9['name'];this[_0xc742('0xb')]=_0x5e5e96[_0xc742('0xb')]||![];this['type']=_0x4a9ac9['type'];this[_0xc742('0xc')]=_0x4a9ac9[_0xc742('0xc')]||0x3;this['scheduledat']=_0x5e5e96[_0xc742('0xd')];this[_0xc742('0xe')]=_0x5e5e96[_0xc742('0xe')];this[_0xc742('0xf')]=_0x5e5e96[_0xc742('0xf')];this[_0xc742('0x10')]=_0x5e5e96[_0xc742('0x10')];this[_0xc742('0x11')]=_0x5e5e96[_0xc742('0x11')];this['countdropretry']=_0x5e5e96[_0xc742('0x12')];this['countabandonedretry']=_0x5e5e96[_0xc742('0x13')];this[_0xc742('0x14')]=_0x5e5e96[_0xc742('0x14')];this[_0xc742('0x15')]=_0x5e5e96['countagentrejectretry'];this[_0xc742('0x16')]=_0x5e5e96['ContactId'];this[_0xc742('0x17')]=_0x5e5e96['ListId'];this[_0xc742('0x18')]=_0x5e5e96[_0xc742('0x18')];this[_0xc742('0x19')]=_0x5e5e96['VoiceQueueId'];this[_0xc742('0x1a')]=_0x5e5e96[_0xc742('0x1a')];this[_0xc742('0x1b')]=_0x5e5e96['id'];this[_0xc742('0x1c')]=_0x5e5e96[_0xc742('0x8')][_0xc742('0x1d')]||'';this['starttime']=moment()[_0xc742('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc742('0x1f')]=_0x5e5e96[_0xc742('0x1f')];this[_0xc742('0x20')]=_0x5e5e96[_0xc742('0x20')];this[_0xc742('0x21')]=_0x5e5e96['callbackat'];this['recallme']=_0x5e5e96[_0xc742('0x22')];this[_0xc742('0x23')]='';this['originatecalleridname']='';}Action[_0xc742('0x24')]['getCaller']=function(){return util[_0xc742('0x1e')](_0xc742('0x25'),this[_0xc742('0x7')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xc742('0x26')][_0xc742('0x27')](this[_0xc742('0x5')]['dialCutDigit']):this['number']);};Action[_0xc742('0x24')][_0xc742('0x28')]=function(){return this[_0xc742('0xa')];};module[_0xc742('0x29')]=Action;