a35abd0574bbd9a830f2883f5ef8262de9d3a0bb
[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 _0x6c18=['gateway','faxdetect','localstationid','path','channel','xcally-motion-fax','headerinfo','uniqueid','lodash','moment','message','info','addVariables','ecm','minrate','format','\x22%s\x22','modem'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x6c18,0x1a6));var _0x86c1=function(_0x2b35eb,_0x652d07){_0x2b35eb=_0x2b35eb-0x0;var _0x2e0702=_0x6c18[_0x2b35eb];return _0x2e0702;};'use strict';var util=require('util');var _=require(_0x86c1('0x0'));var moment=require(_0x86c1('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x86c1('0x2')]=function(_0x29a179){return{'message':_0x29a179};};exports['logger']=function(_0x4256e1,_0x36b1f2){logger[_0x86c1('0x3')](_0x4256e1,util['inspect'](_0x36b1f2,{'showHidden':![],'depth':null}));};exports[_0x86c1('0x4')]=function(_0x412c8d,_0x27ec16){var _0x166c30={'XMF-ECM':_0x27ec16[_0x86c1('0x5')],'XMF-HEADERINFO':_0x27ec16['headerinfo'],'XMF-MINRATE':_0x27ec16[_0x86c1('0x6')],'XMF-MAXRATE':_0x27ec16['maxrate'],'XMF-MODEM':util[_0x86c1('0x7')](_0x86c1('0x8'),_0x27ec16[_0x86c1('0x9')]),'XMF-GATEWAY':_0x27ec16[_0x86c1('0xa')],'XMF-FAXDETECT':_0x27ec16[_0x86c1('0xb')],'XMF-T38TIMEOUT':_0x27ec16['t38timeout'],'XMF-LOCALSTATIONID':_0x27ec16[_0x86c1('0xc')],'XMF-PATH':_0x412c8d[_0x86c1('0xd')]};return _0x166c30;};exports['variablesAction']=function(_0x526d03,_0x2aefc0){return{'actionid':_0x526d03['uniqueid'],'action':'originate','channel':_0x526d03[_0x86c1('0xe')],'Exten':_0x86c1('0xf'),'Context':'from-sip','Priority':'1','callerid':util[_0x86c1('0x7')]('\x22%s\x22\x20<%s>',_0x526d03[_0x86c1('0x10')]?_0x526d03['headerinfo']:'',_0x526d03[_0x86c1('0xc')]),'variable':_0x2aefc0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x526d03[_0x86c1('0x11')]};};