Built motion from commit 616d3211.|2.6.4
[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 _0x0b12=['minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','uniqueid','channel','xcally-motion-fax','from-sip','lodash','moment','../../../../config/logger','fax','logger','info','inspect','ecm','headerinfo'];(function(_0x42ead5,_0x560223){var _0x488d74=function(_0x15feb2){while(--_0x15feb2){_0x42ead5['push'](_0x42ead5['shift']());}};_0x488d74(++_0x560223);}(_0x0b12,0x1af));var _0x20b1=function(_0x201b6f,_0xdcfe6f){_0x201b6f=_0x201b6f-0x0;var _0x5a3131=_0x0b12[_0x201b6f];return _0x5a3131;};'use strict';var util=require('util');var _=require(_0x20b1('0x0'));var moment=require(_0x20b1('0x1'));var logger=require(_0x20b1('0x2'))(_0x20b1('0x3'));exports['message']=function(_0x16e0ae){return{'message':_0x16e0ae};};exports[_0x20b1('0x4')]=function(_0x3c2cbc,_0x4db60b){logger[_0x20b1('0x5')](_0x3c2cbc,util[_0x20b1('0x6')](_0x4db60b,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4eecf4,_0x12af04){var _0x228156={'XMF-ECM':_0x12af04[_0x20b1('0x7')],'XMF-HEADERINFO':_0x12af04[_0x20b1('0x8')],'XMF-MINRATE':_0x12af04[_0x20b1('0x9')],'XMF-MAXRATE':_0x12af04[_0x20b1('0xa')],'XMF-MODEM':util[_0x20b1('0xb')](_0x20b1('0xc'),_0x12af04[_0x20b1('0xd')]),'XMF-GATEWAY':_0x12af04[_0x20b1('0xe')],'XMF-FAXDETECT':_0x12af04[_0x20b1('0xf')],'XMF-T38TIMEOUT':_0x12af04[_0x20b1('0x10')],'XMF-LOCALSTATIONID':_0x12af04['localstationid'],'XMF-PATH':_0x4eecf4[_0x20b1('0x11')]};return _0x228156;};exports['variablesAction']=function(_0x4b8a46,_0x51fe7f){return{'actionid':_0x4b8a46[_0x20b1('0x12')],'action':'originate','channel':_0x4b8a46[_0x20b1('0x13')],'Exten':_0x20b1('0x14'),'Context':_0x20b1('0x15'),'Priority':'1','callerid':util[_0x20b1('0xb')]('\x22%s\x22\x20<%s>',_0x4b8a46[_0x20b1('0x8')]?_0x4b8a46[_0x20b1('0x8')]:'',_0x4b8a46['localstationid']),'variable':_0x51fe7f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4b8a46[_0x20b1('0x12')]};};