6b99a637489e1ac33df6b6c8bba366b641692432
[motion2.git] / server / services / ami / fax / util / util.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 _0xd69b=['\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','../../../../config/logger','fax','logger','info','inspect','addVariables','minrate','format'];(function(_0x4dbf3c,_0xc751a8){var _0xac5f9d=function(_0x50b9f6){while(--_0x50b9f6){_0x4dbf3c['push'](_0x4dbf3c['shift']());}};_0xac5f9d(++_0xc751a8);}(_0xd69b,0x1d9));var _0xbd69=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xd69b[_0x599f41];return _0x2e4d58;};'use strict';var util=require(_0xbd69('0x0'));var _=require(_0xbd69('0x1'));var moment=require('moment');var logger=require(_0xbd69('0x2'))(_0xbd69('0x3'));exports['message']=function(_0x37ab9b){return{'message':_0x37ab9b};};exports[_0xbd69('0x4')]=function(_0xeedc43,_0x4b9d28){logger[_0xbd69('0x5')](_0xeedc43,util[_0xbd69('0x6')](_0x4b9d28,{'showHidden':![],'depth':null}));};exports[_0xbd69('0x7')]=function(_0x440f89,_0x30c685){var _0x1a4021={'XMF-ECM':_0x30c685['ecm'],'XMF-HEADERINFO':_0x30c685['headerinfo'],'XMF-MINRATE':_0x30c685[_0xbd69('0x8')],'XMF-MAXRATE':_0x30c685['maxrate'],'XMF-MODEM':util[_0xbd69('0x9')](_0xbd69('0xa'),_0x30c685[_0xbd69('0xb')]),'XMF-GATEWAY':_0x30c685['gateway'],'XMF-FAXDETECT':_0x30c685[_0xbd69('0xc')],'XMF-T38TIMEOUT':_0x30c685[_0xbd69('0xd')],'XMF-LOCALSTATIONID':_0x30c685[_0xbd69('0xe')],'XMF-PATH':_0x440f89[_0xbd69('0xf')]};return _0x1a4021;};exports['variablesAction']=function(_0x51dc11,_0x5430d3){return{'actionid':_0x51dc11[_0xbd69('0x10')],'action':'originate','channel':_0x51dc11[_0xbd69('0x11')],'Exten':'xcally-motion-fax','Context':_0xbd69('0x12'),'Priority':'1','callerid':util[_0xbd69('0x9')](_0xbd69('0x13'),_0x51dc11[_0xbd69('0x14')]?_0x51dc11[_0xbd69('0x14')]:'',_0x51dc11[_0xbd69('0xe')]),'variable':_0x5430d3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x51dc11['uniqueid']};};