Built motion from commit ff78e754.|2.6.29
[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 _0x66cf=['from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','moment','../../../../config/logger','message','logger','info','inspect','ecm','maxrate','format','modem','gateway','faxdetect','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66cf,0x1a2));var _0xf66c=function(_0x55904,_0x185976){_0x55904=_0x55904-0x0;var _0x2f21d9=_0x66cf[_0x55904];return _0x2f21d9;};'use strict';var util=require(_0xf66c('0x0'));var _=require('lodash');var moment=require(_0xf66c('0x1'));var logger=require(_0xf66c('0x2'))('fax');exports[_0xf66c('0x3')]=function(_0x226c05){return{'message':_0x226c05};};exports[_0xf66c('0x4')]=function(_0x206f93,_0x269433){logger[_0xf66c('0x5')](_0x206f93,util[_0xf66c('0x6')](_0x269433,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x56dc7b,_0x470edc){var _0x263b9e={'XMF-ECM':_0x470edc[_0xf66c('0x7')],'XMF-HEADERINFO':_0x470edc['headerinfo'],'XMF-MINRATE':_0x470edc['minrate'],'XMF-MAXRATE':_0x470edc[_0xf66c('0x8')],'XMF-MODEM':util[_0xf66c('0x9')]('\x22%s\x22',_0x470edc[_0xf66c('0xa')]),'XMF-GATEWAY':_0x470edc[_0xf66c('0xb')],'XMF-FAXDETECT':_0x470edc[_0xf66c('0xc')],'XMF-T38TIMEOUT':_0x470edc['t38timeout'],'XMF-LOCALSTATIONID':_0x470edc['localstationid'],'XMF-PATH':_0x56dc7b[_0xf66c('0xd')]};return _0x263b9e;};exports[_0xf66c('0xe')]=function(_0x4faac3,_0x30b0ab){return{'actionid':_0x4faac3[_0xf66c('0xf')],'action':_0xf66c('0x10'),'channel':_0x4faac3[_0xf66c('0x11')],'Exten':_0xf66c('0x12'),'Context':_0xf66c('0x13'),'Priority':'1','callerid':util[_0xf66c('0x9')](_0xf66c('0x14'),_0x4faac3[_0xf66c('0x15')]?_0x4faac3[_0xf66c('0x15')]:'',_0x4faac3[_0xf66c('0x16')]),'variable':_0x30b0ab,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4faac3['uniqueid']};};