f0a717965aad99e0b76e99c5c474f655358ede0b
[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 _0x17c4=['maxrate','format','\x22%s\x22','modem','t38timeout','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate'];(function(_0x254d73,_0x4f64e1){var _0x278a25=function(_0x5b421f){while(--_0x5b421f){_0x254d73['push'](_0x254d73['shift']());}};_0x278a25(++_0x4f64e1);}(_0x17c4,0x176));var _0x417c=function(_0x502666,_0x45fd9d){_0x502666=_0x502666-0x0;var _0x4c4efd=_0x17c4[_0x502666];return _0x4c4efd;};'use strict';var util=require('util');var _=require(_0x417c('0x0'));var moment=require('moment');var logger=require(_0x417c('0x1'))(_0x417c('0x2'));exports[_0x417c('0x3')]=function(_0x5f3812){return{'message':_0x5f3812};};exports[_0x417c('0x4')]=function(_0x50794f,_0x3cf41f){logger[_0x417c('0x5')](_0x50794f,util[_0x417c('0x6')](_0x3cf41f,{'showHidden':![],'depth':null}));};exports[_0x417c('0x7')]=function(_0xcb4043,_0x49030f){var _0x1b60d8={'XMF-ECM':_0x49030f[_0x417c('0x8')],'XMF-HEADERINFO':_0x49030f['headerinfo'],'XMF-MINRATE':_0x49030f[_0x417c('0x9')],'XMF-MAXRATE':_0x49030f[_0x417c('0xa')],'XMF-MODEM':util[_0x417c('0xb')](_0x417c('0xc'),_0x49030f[_0x417c('0xd')]),'XMF-GATEWAY':_0x49030f['gateway'],'XMF-FAXDETECT':_0x49030f['faxdetect'],'XMF-T38TIMEOUT':_0x49030f[_0x417c('0xe')],'XMF-LOCALSTATIONID':_0x49030f['localstationid'],'XMF-PATH':_0xcb4043[_0x417c('0xf')]};return _0x1b60d8;};exports[_0x417c('0x10')]=function(_0xfc89f4,_0x5ab8d0){return{'actionid':_0xfc89f4[_0x417c('0x11')],'action':'originate','channel':_0xfc89f4[_0x417c('0x12')],'Exten':_0x417c('0x13'),'Context':_0x417c('0x14'),'Priority':'1','callerid':util[_0x417c('0xb')](_0x417c('0x15'),_0xfc89f4['headerinfo']?_0xfc89f4[_0x417c('0x16')]:'',_0xfc89f4[_0x417c('0x17')]),'variable':_0x5ab8d0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xfc89f4[_0x417c('0x11')]};};