02403b5913a188150a74a8590002f30d2896521d
[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 _0xdace=['t38timeout','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','moment','../../../../config/logger','fax','logger','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','faxdetect'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0xdace,0xc5));var _0xedac=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0xdace[_0x4664db];return _0x5615b4;};'use strict';var util=require(_0xedac('0x0'));var _=require('lodash');var moment=require(_0xedac('0x1'));var logger=require(_0xedac('0x2'))(_0xedac('0x3'));exports['message']=function(_0x413d77){return{'message':_0x413d77};};exports[_0xedac('0x4')]=function(_0x15d3bd,_0xefb142){logger['info'](_0x15d3bd,util[_0xedac('0x5')](_0xefb142,{'showHidden':![],'depth':null}));};exports[_0xedac('0x6')]=function(_0x39328a,_0x5ecbd3){var _0x4081c6={'XMF-ECM':_0x5ecbd3[_0xedac('0x7')],'XMF-HEADERINFO':_0x5ecbd3[_0xedac('0x8')],'XMF-MINRATE':_0x5ecbd3['minrate'],'XMF-MAXRATE':_0x5ecbd3[_0xedac('0x9')],'XMF-MODEM':util[_0xedac('0xa')](_0xedac('0xb'),_0x5ecbd3['modem']),'XMF-GATEWAY':_0x5ecbd3['gateway'],'XMF-FAXDETECT':_0x5ecbd3[_0xedac('0xc')],'XMF-T38TIMEOUT':_0x5ecbd3[_0xedac('0xd')],'XMF-LOCALSTATIONID':_0x5ecbd3['localstationid'],'XMF-PATH':_0x39328a['path']};return _0x4081c6;};exports[_0xedac('0xe')]=function(_0x25395d,_0x57f637){return{'actionid':_0x25395d[_0xedac('0xf')],'action':'originate','channel':_0x25395d[_0xedac('0x10')],'Exten':_0xedac('0x11'),'Context':_0xedac('0x12'),'Priority':'1','callerid':util[_0xedac('0xa')](_0xedac('0x13'),_0x25395d[_0xedac('0x8')]?_0x25395d[_0xedac('0x8')]:'',_0x25395d[_0xedac('0x14')]),'variable':_0x57f637,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25395d['uniqueid']};};