42b46db6f0912afd6f999d124c4ad82b11829f4d
[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 _0x39cb=['channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','fax','message','logger','info','inspect','ecm','maxrate','format','\x22%s\x22','modem','localstationid','path','variablesAction','uniqueid','originate'];(function(_0x53be66,_0x9ec3be){var _0x9e5520=function(_0x5c4742){while(--_0x5c4742){_0x53be66['push'](_0x53be66['shift']());}};_0x9e5520(++_0x9ec3be);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var util=require('util');var _=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var logger=require('../../../../config/logger')(_0xb39c('0x2'));exports[_0xb39c('0x3')]=function(_0x5bb582){return{'message':_0x5bb582};};exports[_0xb39c('0x4')]=function(_0x285eca,_0x398d07){logger[_0xb39c('0x5')](_0x285eca,util[_0xb39c('0x6')](_0x398d07,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x32cdcd,_0x2fc868){var _0x40112f={'XMF-ECM':_0x2fc868[_0xb39c('0x7')],'XMF-HEADERINFO':_0x2fc868['headerinfo'],'XMF-MINRATE':_0x2fc868['minrate'],'XMF-MAXRATE':_0x2fc868[_0xb39c('0x8')],'XMF-MODEM':util[_0xb39c('0x9')](_0xb39c('0xa'),_0x2fc868[_0xb39c('0xb')]),'XMF-GATEWAY':_0x2fc868['gateway'],'XMF-FAXDETECT':_0x2fc868['faxdetect'],'XMF-T38TIMEOUT':_0x2fc868['t38timeout'],'XMF-LOCALSTATIONID':_0x2fc868[_0xb39c('0xc')],'XMF-PATH':_0x32cdcd[_0xb39c('0xd')]};return _0x40112f;};exports[_0xb39c('0xe')]=function(_0x1088ee,_0x433ee8){return{'actionid':_0x1088ee[_0xb39c('0xf')],'action':_0xb39c('0x10'),'channel':_0x1088ee[_0xb39c('0x11')],'Exten':'xcally-motion-fax','Context':_0xb39c('0x12'),'Priority':'1','callerid':util[_0xb39c('0x9')](_0xb39c('0x13'),_0x1088ee['headerinfo']?_0x1088ee[_0xb39c('0x14')]:'',_0x1088ee[_0xb39c('0xc')]),'variable':_0x433ee8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1088ee[_0xb39c('0xf')]};};