Built motion from commit dbf3a7e2.|2.6.30
[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 _0x41fb=['fax','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','path','uniqueid','originate','from-sip','\x22%s\x22\x20<%s>','moment','../../../../config/logger'];(function(_0x57aecf,_0x155987){var _0x1eed3e=function(_0x1cec21){while(--_0x1cec21){_0x57aecf['push'](_0x57aecf['shift']());}};_0x1eed3e(++_0x155987);}(_0x41fb,0x14e));var _0xb41f=function(_0x526a22,_0x2c8eba){_0x526a22=_0x526a22-0x0;var _0x4958a3=_0x41fb[_0x526a22];return _0x4958a3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb41f('0x0'));var logger=require(_0xb41f('0x1'))(_0xb41f('0x2'));exports[_0xb41f('0x3')]=function(_0xd9894f){return{'message':_0xd9894f};};exports[_0xb41f('0x4')]=function(_0x282d7b,_0x378e76){logger[_0xb41f('0x5')](_0x282d7b,util[_0xb41f('0x6')](_0x378e76,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x8274ae,_0x37eaf4){var _0x36e3d0={'XMF-ECM':_0x37eaf4[_0xb41f('0x7')],'XMF-HEADERINFO':_0x37eaf4[_0xb41f('0x8')],'XMF-MINRATE':_0x37eaf4[_0xb41f('0x9')],'XMF-MAXRATE':_0x37eaf4[_0xb41f('0xa')],'XMF-MODEM':util[_0xb41f('0xb')](_0xb41f('0xc'),_0x37eaf4[_0xb41f('0xd')]),'XMF-GATEWAY':_0x37eaf4['gateway'],'XMF-FAXDETECT':_0x37eaf4[_0xb41f('0xe')],'XMF-T38TIMEOUT':_0x37eaf4['t38timeout'],'XMF-LOCALSTATIONID':_0x37eaf4[_0xb41f('0xf')],'XMF-PATH':_0x8274ae[_0xb41f('0x10')]};return _0x36e3d0;};exports['variablesAction']=function(_0x15e2f7,_0x994c28){return{'actionid':_0x15e2f7[_0xb41f('0x11')],'action':_0xb41f('0x12'),'channel':_0x15e2f7['channel'],'Exten':'xcally-motion-fax','Context':_0xb41f('0x13'),'Priority':'1','callerid':util[_0xb41f('0xb')](_0xb41f('0x14'),_0x15e2f7[_0xb41f('0x8')]?_0x15e2f7[_0xb41f('0x8')]:'',_0x15e2f7['localstationid']),'variable':_0x994c28,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x15e2f7[_0xb41f('0x11')]};};