e9dd05f77dde3dd2eb62a0235ab97c07247868be
[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 _0x878f=['inspect','maxrate','modem','gateway','faxdetect','localstationid','path','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x878f,0x173));var _0xf878=function(_0x54982a,_0xd53ea6){_0x54982a=_0x54982a-0x0;var _0x32f883=_0x878f[_0x54982a];return _0x32f883;};'use strict';var util=require('util');var _=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var logger=require(_0xf878('0x2'))(_0xf878('0x3'));exports[_0xf878('0x4')]=function(_0x3d74cf){return{'message':_0x3d74cf};};exports[_0xf878('0x5')]=function(_0x45a37b,_0x240b48){logger[_0xf878('0x6')](_0x45a37b,util[_0xf878('0x7')](_0x240b48,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4ac8d8,_0x3c5f5c){var _0x62b420={'XMF-ECM':_0x3c5f5c['ecm'],'XMF-HEADERINFO':_0x3c5f5c['headerinfo'],'XMF-MINRATE':_0x3c5f5c['minrate'],'XMF-MAXRATE':_0x3c5f5c[_0xf878('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3c5f5c[_0xf878('0x9')]),'XMF-GATEWAY':_0x3c5f5c[_0xf878('0xa')],'XMF-FAXDETECT':_0x3c5f5c[_0xf878('0xb')],'XMF-T38TIMEOUT':_0x3c5f5c['t38timeout'],'XMF-LOCALSTATIONID':_0x3c5f5c[_0xf878('0xc')],'XMF-PATH':_0x4ac8d8[_0xf878('0xd')]};return _0x62b420;};exports['variablesAction']=function(_0xdf76,_0x4f7e7f){return{'actionid':_0xdf76[_0xf878('0xe')],'action':_0xf878('0xf'),'channel':_0xdf76[_0xf878('0x10')],'Exten':'xcally-motion-fax','Context':_0xf878('0x11'),'Priority':'1','callerid':util[_0xf878('0x12')](_0xf878('0x13'),_0xdf76['headerinfo']?_0xdf76[_0xf878('0x14')]:'',_0xdf76[_0xf878('0xc')]),'variable':_0x4f7e7f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xdf76[_0xf878('0xe')]};};