f6cf33fde6090617608273c679a1feffb999ecbd
[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 _0xac7f=['inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','fax','message','logger'];(function(_0x3e744,_0x27129){var _0xdbf4b=function(_0x2aee99){while(--_0x2aee99){_0x3e744['push'](_0x3e744['shift']());}};_0xdbf4b(++_0x27129);}(_0xac7f,0x15c));var _0xfac7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xac7f[_0xc4001c];return _0x49f7bc;};'use strict';var util=require(_0xfac7('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0xfac7('0x1'));exports[_0xfac7('0x2')]=function(_0x1bda10){return{'message':_0x1bda10};};exports[_0xfac7('0x3')]=function(_0x2d7b84,_0x19b0a4){logger['info'](_0x2d7b84,util[_0xfac7('0x4')](_0x19b0a4,{'showHidden':![],'depth':null}));};exports[_0xfac7('0x5')]=function(_0x381d9e,_0x40bd30){var _0x138a07={'XMF-ECM':_0x40bd30['ecm'],'XMF-HEADERINFO':_0x40bd30[_0xfac7('0x6')],'XMF-MINRATE':_0x40bd30['minrate'],'XMF-MAXRATE':_0x40bd30[_0xfac7('0x7')],'XMF-MODEM':util[_0xfac7('0x8')](_0xfac7('0x9'),_0x40bd30[_0xfac7('0xa')]),'XMF-GATEWAY':_0x40bd30[_0xfac7('0xb')],'XMF-FAXDETECT':_0x40bd30[_0xfac7('0xc')],'XMF-T38TIMEOUT':_0x40bd30[_0xfac7('0xd')],'XMF-LOCALSTATIONID':_0x40bd30[_0xfac7('0xe')],'XMF-PATH':_0x381d9e[_0xfac7('0xf')]};return _0x138a07;};exports[_0xfac7('0x10')]=function(_0x44bbd3,_0x4acc3b){return{'actionid':_0x44bbd3[_0xfac7('0x11')],'action':_0xfac7('0x12'),'channel':_0x44bbd3[_0xfac7('0x13')],'Exten':'xcally-motion-fax','Context':_0xfac7('0x14'),'Priority':'1','callerid':util['format'](_0xfac7('0x15'),_0x44bbd3[_0xfac7('0x6')]?_0x44bbd3[_0xfac7('0x6')]:'',_0x44bbd3['localstationid']),'variable':_0x4acc3b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x44bbd3[_0xfac7('0x11')]};};