Built motion from commit d1eab355.|2.6.28
[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 _0x926c=['xcally-motion-fax','from-sip','format','headerinfo','uniqueid','util','../../../../config/logger','fax','message','logger','inspect','addVariables','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','variablesAction','originate','channel'];(function(_0xf36a76,_0x3967b3){var _0x414aa5=function(_0x84dc89){while(--_0x84dc89){_0xf36a76['push'](_0xf36a76['shift']());}};_0x414aa5(++_0x3967b3);}(_0x926c,0xe1));var _0xc926=function(_0x3b5208,_0x368ecb){_0x3b5208=_0x3b5208-0x0;var _0x6ad09e=_0x926c[_0x3b5208];return _0x6ad09e;};'use strict';var util=require(_0xc926('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xc926('0x1'))(_0xc926('0x2'));exports[_0xc926('0x3')]=function(_0x24751e){return{'message':_0x24751e};};exports[_0xc926('0x4')]=function(_0x50fc4d,_0x318ea7){logger['info'](_0x50fc4d,util[_0xc926('0x5')](_0x318ea7,{'showHidden':![],'depth':null}));};exports[_0xc926('0x6')]=function(_0x1053e6,_0x4d6899){var _0x5751ce={'XMF-ECM':_0x4d6899['ecm'],'XMF-HEADERINFO':_0x4d6899['headerinfo'],'XMF-MINRATE':_0x4d6899[_0xc926('0x7')],'XMF-MAXRATE':_0x4d6899[_0xc926('0x8')],'XMF-MODEM':util['format'](_0xc926('0x9'),_0x4d6899[_0xc926('0xa')]),'XMF-GATEWAY':_0x4d6899[_0xc926('0xb')],'XMF-FAXDETECT':_0x4d6899[_0xc926('0xc')],'XMF-T38TIMEOUT':_0x4d6899['t38timeout'],'XMF-LOCALSTATIONID':_0x4d6899[_0xc926('0xd')],'XMF-PATH':_0x1053e6['path']};return _0x5751ce;};exports[_0xc926('0xe')]=function(_0x16b3bd,_0x539f27){return{'actionid':_0x16b3bd['uniqueid'],'action':_0xc926('0xf'),'channel':_0x16b3bd[_0xc926('0x10')],'Exten':_0xc926('0x11'),'Context':_0xc926('0x12'),'Priority':'1','callerid':util[_0xc926('0x13')]('\x22%s\x22\x20<%s>',_0x16b3bd['headerinfo']?_0x16b3bd[_0xc926('0x14')]:'',_0x16b3bd[_0xc926('0xd')]),'variable':_0x539f27,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x16b3bd[_0xc926('0x15')]};};