d06331ca8a3e6cd75465d6ef5c2058e0fa4b8f23
[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 _0x172d=['\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','logger','info','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip'];(function(_0x209dc3,_0x1af1c1){var _0x12a83e=function(_0x196170){while(--_0x196170){_0x209dc3['push'](_0x209dc3['shift']());}};_0x12a83e(++_0x1af1c1);}(_0x172d,0x115));var _0xd172=function(_0x1f42f3,_0x4ef231){_0x1f42f3=_0x1f42f3-0x0;var _0x40bab4=_0x172d[_0x1f42f3];return _0x40bab4;};'use strict';var util=require(_0xd172('0x0'));var _=require(_0xd172('0x1'));var moment=require('moment');var logger=require(_0xd172('0x2'))(_0xd172('0x3'));exports['message']=function(_0x3fffe9){return{'message':_0x3fffe9};};exports[_0xd172('0x4')]=function(_0x304b64,_0x49eb31){logger[_0xd172('0x5')](_0x304b64,util['inspect'](_0x49eb31,{'showHidden':![],'depth':null}));};exports[_0xd172('0x6')]=function(_0x10e6f0,_0x3d5449){var _0xb7bac2={'XMF-ECM':_0x3d5449['ecm'],'XMF-HEADERINFO':_0x3d5449[_0xd172('0x7')],'XMF-MINRATE':_0x3d5449[_0xd172('0x8')],'XMF-MAXRATE':_0x3d5449[_0xd172('0x9')],'XMF-MODEM':util[_0xd172('0xa')](_0xd172('0xb'),_0x3d5449[_0xd172('0xc')]),'XMF-GATEWAY':_0x3d5449[_0xd172('0xd')],'XMF-FAXDETECT':_0x3d5449[_0xd172('0xe')],'XMF-T38TIMEOUT':_0x3d5449['t38timeout'],'XMF-LOCALSTATIONID':_0x3d5449[_0xd172('0xf')],'XMF-PATH':_0x10e6f0[_0xd172('0x10')]};return _0xb7bac2;};exports[_0xd172('0x11')]=function(_0x417ac6,_0xa37025){return{'actionid':_0x417ac6['uniqueid'],'action':_0xd172('0x12'),'channel':_0x417ac6[_0xd172('0x13')],'Exten':_0xd172('0x14'),'Context':_0xd172('0x15'),'Priority':'1','callerid':util[_0xd172('0xa')](_0xd172('0x16'),_0x417ac6['headerinfo']?_0x417ac6['headerinfo']:'',_0x417ac6['localstationid']),'variable':_0xa37025,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x417ac6['uniqueid']};};