Built motion from commit (unavailable).|2.0.74
[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 _0xa630=['number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','util','lodash','string','isNil','voiceQueue','uniqueid','name','Contact','phone','lastName'];(function(_0x35027c,_0x4af623){var _0x4bba7d=function(_0x1d84f9){while(--_0x1d84f9){_0x35027c['push'](_0x35027c['shift']());}};_0x4bba7d(++_0x4af623);}(_0xa630,0xbe));var _0x0a63=function(_0x3cc126,_0x4e0bd9){_0x3cc126=_0x3cc126-0x0;var _0x568ca5=_0xa630[_0x3cc126];return _0x568ca5;};'use strict';var util=require(_0x0a63('0x0'));var _=require(_0x0a63('0x1'));var moment=require('moment');function checkNameSurname(_0x52ad93,_0x1a9586,_0x4f6b34){var _0xd0a045='';if(!_['isNil'](_0x1a9586)&&_0x0a63('0x2')===typeof _0x1a9586){_0xd0a045+=_0x1a9586;}if(!_[_0x0a63('0x3')](_0x4f6b34)&&_0x0a63('0x2')===typeof _0x4f6b34){_0xd0a045+='\x20'+_0x4f6b34;}if(_0xd0a045!==''){return _0xd0a045;}return _0x52ad93;}function Action(_0x2380f8,_0x37b4c9,_0x4b7474){this[_0x0a63('0x4')]=_0x2380f8;this[_0x0a63('0x5')]=_0x4b7474||undefined;this[_0x0a63('0x6')]=checkNameSurname(_0x37b4c9[_0x0a63('0x7')][_0x0a63('0x8')],_0x37b4c9[_0x0a63('0x7')]['firstName'],_0x37b4c9[_0x0a63('0x7')][_0x0a63('0x9')]);this[_0x0a63('0xa')]=_0x37b4c9[_0x0a63('0x7')][_0x0a63('0x8')];this[_0x0a63('0xb')]=_0x2380f8[_0x0a63('0x6')];this[_0x0a63('0xc')]=_0x37b4c9[_0x0a63('0xc')]||![];this[_0x0a63('0xd')]=_0x2380f8['type'];this[_0x0a63('0xe')]=_0x2380f8[_0x0a63('0xe')]||0x3;this[_0x0a63('0xf')]=_0x37b4c9[_0x0a63('0xf')];this['countbusyretry']=_0x37b4c9[_0x0a63('0x10')];this['countcongestionretry']=_0x37b4c9[_0x0a63('0x11')];this[_0x0a63('0x12')]=_0x37b4c9[_0x0a63('0x12')];this[_0x0a63('0x13')]=_0x37b4c9[_0x0a63('0x13')];this[_0x0a63('0x14')]=_0x37b4c9[_0x0a63('0x14')];this[_0x0a63('0x15')]=_0x37b4c9['UserId'];this[_0x0a63('0x16')]=_0x37b4c9['VoiceQueueId'];this[_0x0a63('0x17')]=_0x37b4c9[_0x0a63('0x17')];this[_0x0a63('0x18')]=_0x37b4c9['id'];this[_0x0a63('0x19')]=_0x37b4c9[_0x0a63('0x7')][_0x0a63('0x1a')]||'';this[_0x0a63('0x1b')]=moment()[_0x0a63('0x1c')](_0x0a63('0x1d'));this[_0x0a63('0x1e')]=_0x37b4c9[_0x0a63('0x1e')];this['callbackuniqueid']=_0x37b4c9['callbackuniqueid'];this[_0x0a63('0x1f')]=_0x37b4c9['callbackat'];this[_0x0a63('0x20')]=_0x37b4c9['recallme'];this[_0x0a63('0x21')]='';this[_0x0a63('0x22')]='';}Action[_0x0a63('0x23')][_0x0a63('0x24')]=function(){return util['format'](_0x0a63('0x25'),this['name'],this[_0x0a63('0x4')][_0x0a63('0x26')]>0x0?this[_0x0a63('0xa')][_0x0a63('0x27')](this[_0x0a63('0x4')][_0x0a63('0x26')]):this[_0x0a63('0xa')]);};Action[_0x0a63('0x23')]['getQueue']=function(){return this['queue'];};module['exports']=Action;