Built motion from commit (unavailable).|2.0.84
[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 _0xacf8=['UserId','CampaignId','idHopper','ContactFirstName','callback','callbackat','recallme','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','substring','dialCutDigit','exports','util','string','isNil','voiceQueue','uniqueid','Contact','phone','firstName','lastName','queue','name','active','type','dialQueueTimeout','countcongestionretry','ContactId','ListId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xacf8,0xef));var _0x8acf=function(_0xbb66a,_0x28bf42){_0xbb66a=_0xbb66a-0x0;var _0x5b69a5=_0xacf8[_0xbb66a];return _0x5b69a5;};'use strict';var util=require(_0x8acf('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x541c45,_0x5e20eb,_0x2c7ffe){var _0x55c70a='';if(!_['isNil'](_0x5e20eb)&&_0x8acf('0x1')===typeof _0x5e20eb){_0x55c70a+=_0x5e20eb;}if(!_[_0x8acf('0x2')](_0x2c7ffe)&&_0x8acf('0x1')===typeof _0x2c7ffe){_0x55c70a+='\x20'+_0x2c7ffe;}if(_0x55c70a!==''){return _0x55c70a;}return _0x541c45;}function Action(_0x2005cf,_0x943755,_0x4ce6a5){this[_0x8acf('0x3')]=_0x2005cf;this[_0x8acf('0x4')]=_0x4ce6a5||undefined;this['name']=checkNameSurname(_0x943755[_0x8acf('0x5')][_0x8acf('0x6')],_0x943755[_0x8acf('0x5')][_0x8acf('0x7')],_0x943755[_0x8acf('0x5')][_0x8acf('0x8')]);this['number']=_0x943755['Contact'][_0x8acf('0x6')];this[_0x8acf('0x9')]=_0x2005cf[_0x8acf('0xa')];this[_0x8acf('0xb')]=_0x943755[_0x8acf('0xb')]||![];this[_0x8acf('0xc')]=_0x2005cf[_0x8acf('0xc')];this[_0x8acf('0xd')]=_0x2005cf[_0x8acf('0xd')]||0x3;this['scheduledat']=_0x943755['scheduledat'];this['countbusyretry']=_0x943755['countbusyretry'];this[_0x8acf('0xe')]=_0x943755[_0x8acf('0xe')];this['countnoanswerretry']=_0x943755['countnoanswerretry'];this[_0x8acf('0xf')]=_0x943755[_0x8acf('0xf')];this[_0x8acf('0x10')]=_0x943755[_0x8acf('0x10')];this[_0x8acf('0x11')]=_0x943755[_0x8acf('0x11')];this['VoiceQueueId']=_0x943755['VoiceQueueId'];this[_0x8acf('0x12')]=_0x943755['CampaignId'];this[_0x8acf('0x13')]=_0x943755['id'];this[_0x8acf('0x14')]=_0x943755[_0x8acf('0x5')][_0x8acf('0x7')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8acf('0x15')]=_0x943755['callback'];this['callbackuniqueid']=_0x943755['callbackuniqueid'];this[_0x8acf('0x16')]=_0x943755['callbackat'];this[_0x8acf('0x17')]=_0x943755['recallme'];this['originatecalleridnum']='';this[_0x8acf('0x18')]='';}Action['prototype'][_0x8acf('0x19')]=function(){return util[_0x8acf('0x1a')](_0x8acf('0x1b'),this[_0x8acf('0xa')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x8acf('0x1c')][_0x8acf('0x1d')](this[_0x8acf('0x3')][_0x8acf('0x1e')]):this['number']);};Action['prototype']['getQueue']=function(){return this[_0x8acf('0x9')];};module[_0x8acf('0x1f')]=Action;