7517fb15a8d57be647004ab1edafe718f280d408
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0x6c9a=["\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x72\x65\x71\x75\x65\x73\x74","\x53\x75\x67\x61\x72\x63\x72\x6D\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x55\x73\x65\x72","\x53\x75\x67\x61\x72\x63\x72\x6D\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x50\x61\x73\x73\x65\x64\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73\x20\x61\x72\x65\x20\x6E\x6F\x74\x20\x65\x6E\x6F\x75\x67\x68\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x74\x69\x63\x6B\x65\x74\x3A\x20\x6D\x69\x73\x73\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64\x20\x6F\x72\x20\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x49\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64","\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x73\x65\x72\x76\x65\x72\x55\x52\x4C","\x73\x65\x72\x76\x65\x72\x55\x72\x6C","\x53\x75\x67\x61\x72\x63\x72\x6D\x41\x63\x63\x6F\x75\x6E\x74","\x75\x72\x69","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x2F\x73\x65\x72\x76\x69\x63\x65\x2F\x76\x34\x5F\x31\x2F\x72\x65\x73\x74\x2E\x70\x68\x70","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x50\x4C\x41\x49\x4E","\x78\x43\x41\x4C\x4C\x59\x20\x4D\x6F\x74\x69\x6F\x6E\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x6C\x6F\x67\x69\x6E","\x4A\x53\x4F\x4E","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x50\x4F\x53\x54","\x69\x64","\x73\x65\x73\x73\x69\x6F\x6E\x49\x44","\x61\x64\x6D\x69\x6E","\x76\x61\x6C\x75\x65","\x75\x73\x65\x72\x5F\x69\x64","\x6E\x61\x6D\x65\x5F\x76\x61\x6C\x75\x65\x5F\x6C\x69\x73\x74","\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65","\x41\x63\x63\x6F\x75\x6E\x74\x20\x25\x64\x20\x69\x73\x20\x6E\x6F\x74\x20\x76\x61\x6C\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x61\x67\x65\x6E\x74\x4E\x61\x6D\x65","","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x76\x6F\x69\x63\x65","\x43\x68\x61\x6E\x6E\x65\x6C\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x55\x52\x4C","\x72\x65\x63\x6F\x72\x64\x45\x6E\x61\x62\x6C\x65","\x25\x73\x2F\x61\x70\x69\x2F\x76\x6F\x69\x63\x65\x2F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73\x2F\x25\x73\x2F\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x3F\x74\x79\x70\x65\x3D\x75\x6E\x69\x71\x75\x65\x69\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x72\x65\x73\x75\x6C\x74","\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x6F\x72\x6D\x61\x74","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x51\x75\x65\x75\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x72\x6F\x75\x74\x65\x49\x64","\x72\x65\x63\x6F\x72\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x67\x65\x74\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x66\x6F","\x63\x68\x61\x72\x41\x74","\x76\x65\x72\x73\x69\x6F\x6E","\x73\x65\x72\x76\x65\x72\x56\x65\x72\x73\x69\x6F\x6E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x67\x65\x6E\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x67\x65\x74\x5F\x65\x6E\x74\x72\x79\x5F\x6C\x69\x73\x74","\x45\x6D\x70\x6C\x6F\x79\x65\x65\x73","\x49\x4E\x53\x54\x52\x20\x28\x20\x43\x4F\x4E\x43\x41\x54\x28\x75\x73\x65\x72\x73\x2E\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65\x2C\x27\x20\x27\x2C\x20\x75\x73\x65\x72\x73\x2E\x6C\x61\x73\x74\x5F\x6E\x61\x6D\x65\x29\x2C\x20\x22\x25\x73\x22\x29\x20\x3E\x20\x30","\x30","\x6C\x65\x6E\x67\x74\x68","\x65\x6E\x74\x72\x79\x5F\x6C\x69\x73\x74","\x72\x65\x73\x75\x6C\x74\x5F\x63\x6F\x75\x6E\x74","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x67\x65\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x67\x65\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2E\x20\x55\x73\x65\x20\x74\x68\x65\x20\x61\x64\x6D\x69\x6E\x20\x61\x63\x63\x6F\x75\x6E\x74","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x64\x6D\x69\x6E\x20\x73\x65\x6C\x65\x63\x74\x65\x64","\x64\x65\x66\x61\x75\x6C\x74\x4D\x61\x70\x70\x69\x6E\x67","\x43\x6F\x6E\x74\x61\x63\x74\x73","\x6D\x61\x70\x70\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x53\x6B\x69\x70\x70\x65\x64\x20\x73\x65\x61\x72\x63\x68\x20\x69\x6E\x20\x43\x75\x73\x74\x6F\x6D\x20\x4D\x61\x70\x70\x69\x6E\x67\x20\x6D\x6F\x64\x75\x6C\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x66\x6F\x75\x6E\x64\x3A\x20\x25\x73","\x65\x6E\x64\x75\x73\x65\x72","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A\x20\x25\x73","\x63\x6F\x6E\x74\x61\x63\x74\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x53\x6B\x69\x70\x70\x65\x64\x20\x73\x65\x61\x72\x63\x68\x20\x69\x6E\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x6D\x6F\x64\x75\x6C\x65\x3A\x20\x64\x65\x66\x61\x75\x6C\x74\x20\x6D\x61\x70\x70\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x20\x6F\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x20\x61\x6C\x72\x65\x64\x79\x20\x66\x6F\x75\x6E\x64\x20\x69\x6E\x20\x43\x75\x73\x74\x6F\x6D\x20\x4D\x61\x70\x70\x69\x6E\x67\x20\x6D\x6F\x64\x75\x6C\x65","\x6D\x61\x70\x70\x69\x6E\x67\x46\x69\x65\x6C\x64\x73","\x68\x65\x61\x64","\x5F\x63","\x65\x6E\x64\x73\x57\x69\x74\x68","\x25\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x74\x6F\x4C\x6F\x77\x65\x72","\x5F\x63\x73\x74\x6D","\x20\x4F\x52\x20\x25\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x70\x68\x6F\x6E\x65\x5F\x68\x6F\x6D\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x66\x6F\x75\x6E\x64\x3A\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x73\x65\x74\x5F\x65\x6E\x74\x72\x79","\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x43\x61\x6C\x6C\x65\x72\x20\x2D\x20\x25\x73","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x70\x75\x73\x68","\x3C\x75\x6E\x6B\x6E\x6F\x77\x6E\x3E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x63\x72\x65\x61\x74\x65\x64\x3A","\x61\x73\x73\x69\x67\x6E\x65\x64\x5F\x75\x73\x65\x72\x5F\x69\x64","\x63\x72\x65\x61\x74\x65\x64\x5F\x62\x79","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x64\x61\x74\x65\x5F\x73\x74\x61\x72\x74","\x54","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x73\x6C\x69\x63\x65","\x74\x6F\x49\x53\x4F\x53\x74\x72\x69\x6E\x67","\x64\x75\x72\x61\x74\x69\x6F\x6E\x5F\x68\x6F\x75\x72\x73","\x64\x75\x72\x61\x74\x69\x6F\x6E\x5F\x6D\x69\x6E\x75\x74\x65\x73","\x31\x35","\x66\x6F\x72\x45\x61\x63\x68","\x43\x61\x6C\x6C\x73","\x53\x75\x62\x6A\x65\x63\x74","\x73\x6F\x72\x74\x42\x79","\x74\x79\x70\x65","\x73\x74\x72\x69\x6E\x67","\x63\x6F\x6E\x74\x65\x6E\x74","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x72\x69\x61\x62\x6C\x65\x4E\x61\x6D\x65","\x63\x75\x73\x74\x6F\x6D\x56\x61\x72\x69\x61\x62\x6C\x65","\x56\x61\x72\x69\x61\x62\x6C\x65","\x6A\x6F\x69\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6B\x65\x79\x56\x61\x6C\x75\x65","\x6B\x65\x79\x54\x79\x70\x65","\x6B\x65\x79","\x25\x73\x3A\x20\x25\x73","\x6B\x65\x79\x43\x6F\x6E\x74\x65\x6E\x74","\x0A","\x46\x69\x65\x6C\x64","\x69\x64\x46\x69\x65\x6C\x64","\x63\x61\x6C\x6C","\x75\x72\x6C","\x25\x73\x2F\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x3F\x61\x63\x74\x69\x6F\x6E\x3D\x61\x6A\x61\x78\x75\x69\x23\x61\x6A\x61\x78\x55\x49\x4C\x6F\x63\x3D\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x25\x33\x46\x6D\x6F\x64\x75\x6C\x65\x25\x33\x44\x43\x61\x6C\x6C\x73\x25\x32\x36\x61\x63\x74\x69\x6F\x6E\x25\x33\x44\x45\x64\x69\x74\x56\x69\x65\x77\x25\x32\x36\x72\x65\x63\x6F\x72\x64\x25\x33\x44\x25\x73","\x25\x73\x2F\x23\x62\x77\x63\x2F\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x3F\x6D\x6F\x64\x75\x6C\x65\x3D\x43\x61\x6C\x6C\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x45\x64\x69\x74\x56\x69\x65\x77\x26\x72\x65\x63\x6F\x72\x64\x3D\x25\x73","\x73\x65\x74\x5F\x72\x65\x6C\x61\x74\x69\x6F\x6E\x73\x68\x69\x70","\x75\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x74\x68\x65\x20\x61\x67\x65\x6E\x74\x20\x25\x73","\x6D\x6F\x64\x75\x6C\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x74\x68\x65\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x25\x73","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x73\x75\x67\x61\x72\x63\x72\x6D","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x69\x74\x53\x74\x61\x74\x75\x73","\x73\x75\x63\x63\x65\x73\x73","\x74\x69\x63\x6B\x65\x74\x49\x64","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x3A\x73\x75\x67\x61\x72\x63\x72\x6D","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x74\x6F","\x63\x72\x65\x61\x74\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x64\x69\x73\x70\x6C\x61\x79\x65\x64\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x61\x6C\x6C\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x66\x61\x69\x6C\x65\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x52\x65\x70\x6F\x72\x74\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x63\x72\x65\x61\x74\x65","\x73\x75\x62\x73\x74\x72","\x2F","\x70\x61\x72\x73\x65","\x66\x69\x72\x73\x74","\x65\x78\x70\x6F\x72\x74\x73"];var _=require(_0x6c9a[0]);var util=require(_0x6c9a[1]);var rp=require(_0x6c9a[2]);var request=require(_0x6c9a[3]);var SugarcrmConfiguration=require(_0x6c9a[5])[_0x6c9a[4]];var ReportIntegration=require(_0x6c9a[5])[_0x6c9a[6]];var VoiceQueue=require(_0x6c9a[5])[_0x6c9a[7]];var VoiceExtension=require(_0x6c9a[5])[_0x6c9a[8]];var Agent=require(_0x6c9a[5])[_0x6c9a[9]];function Sugarcrm(){console[_0x6c9a[11]](_0x6c9a[10])}Sugarcrm[_0x6c9a[13]][_0x6c9a[12]]= function(_0x3ac7xb,_0x3ac7xc,_0x3ac7xd,_0x3ac7xe,_0x3ac7xf,_0x3ac7x10,_0x3ac7x11){var _0x3ac7x12={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0x3ac7xb||  !_0x3ac7xc){console[_0x6c9a[15]](_0x6c9a[14]);return};SugarcrmConfiguration[_0x6c9a[18]]({where:{id:_0x3ac7xc,AccountId:_0x3ac7xb},include:[{all:true,include:[{all:true}]}]})[_0x6c9a[17]](handleEntityNotFound())[_0x6c9a[17]](handleConnection(_0x3ac7x12))[_0x6c9a[17]](handleLogin(_0x3ac7x12))[_0x6c9a[17]](searchMotionAgent(_0x3ac7xd,_0x3ac7xf))[_0x6c9a[17]](handleMotionAgent(_0x3ac7x12))[_0x6c9a[17]](searchQueue(_0x3ac7xf))[_0x6c9a[17]](handleQueueRecordings(_0x3ac7x12,_0x3ac7xf))[_0x6c9a[17]](searchRoute(_0x3ac7xf))[_0x6c9a[17]](handleOutboundRecordings(_0x3ac7x12,_0x3ac7xf))[_0x6c9a[17]](getServerInfo(_0x3ac7x12))[_0x6c9a[17]](handleServerInfo(_0x3ac7x12))[_0x6c9a[17]](searchAgent(_0x3ac7x12))[_0x6c9a[17]](handleAgent(_0x3ac7x12))[_0x6c9a[17]](handleAdmin(_0x3ac7x12))[_0x6c9a[17]](searchEndUserWithDefaultMapping(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](handleEndUserWithDefaultMapping(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](searchEndUser(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](handleEndUser(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](endUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](handleEndUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe))[_0x6c9a[17]](callCreation(_0x3ac7x12,_0x3ac7xf,_0x3ac7x10))[_0x6c9a[17]](handleCallAgentAssociation(_0x3ac7x12))[_0x6c9a[17]](handleCallContactAssociation(_0x3ac7x12))[_0x6c9a[17]](handleReportIntegration(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xb,_0x3ac7x11,_0x3ac7xe))[_0x6c9a[17]](handleEnd(_0x3ac7x12))[_0x6c9a[16]](handleError(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xb))};function handleEntityNotFound(){return function(_0x3ac7x14){if(!_0x3ac7x14){return null};return _0x3ac7x14}}function handleConnection(_0x3ac7x12){return function(_0x3ac7x16){_0x3ac7x12[_0x6c9a[19]]= _0x3ac7x16;_0x3ac7x12[_0x6c9a[20]]= _0x3ac7x16[_0x6c9a[22]][_0x6c9a[21]];_0x3ac7x12[_0x6c9a[23]]= stripTrailingSlash(_0x3ac7x16[_0x6c9a[22]][_0x6c9a[24]])+ _0x6c9a[25];var _0x3ac7x17={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0x3ac7x16[_0x6c9a[22]][_0x6c9a[26]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0x3ac7x16[_0x6c9a[22]][_0x6c9a[27]],encryption:_0x6c9a[28]},application:_0x6c9a[29]};var _0x3ac7xf={method:_0x6c9a[30],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]](_0x3ac7x17)};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7xf})}}function handleLogin(_0x3ac7x12){return function(_0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[34]]){_0x3ac7x12[_0x6c9a[35]]= _0x3ac7xf[_0x6c9a[34]];_0x3ac7x12[_0x6c9a[36]]= {id:_0x3ac7xf[_0x6c9a[39]][_0x6c9a[38]][_0x6c9a[37]],name:_0x3ac7xf[_0x6c9a[39]][_0x6c9a[40]][_0x6c9a[37]]};return};throw  new Error(util[_0x6c9a[42]](_0x6c9a[41],_0x3ac7x12[_0x6c9a[19]][_0x6c9a[22]][_0x6c9a[34]]))}}function searchMotionAgent(_0x3ac7xd,_0x3ac7xf){return function(){var _0x3ac7x1a=getAgentSearchPropertyFromChannel(_0x3ac7xd);if(_0x3ac7xf[_0x6c9a[43]](_0x3ac7x1a)){return Agent[_0x6c9a[47]](_0x6c9a[46])[_0x6c9a[45]]({where:{name:getValueFromPropertyName(_0x3ac7xf,_0x3ac7x1a)},attributes:[_0x6c9a[44]]})};return}}function handleMotionAgent(_0x3ac7x12){return function(_0x3ac7x1c){if(_0x3ac7x1c&& _0x3ac7x1c[_0x6c9a[44]]){_0x3ac7x12[_0x6c9a[48]]= _0x3ac7x1c[_0x6c9a[44]]};return}}function getAgentSearchPropertyFromChannel(_0x3ac7xd){var _0x3ac7x1e=_0x6c9a[49];if(_0x3ac7xd){switch(_0x3ac7xd){case _0x6c9a[51]:_0x3ac7x1e= _0x6c9a[50];break;default:_0x3ac7x1e= _0x6c9a[50];console[_0x6c9a[15]](_0x6c9a[52],_0x3ac7xd)}};return _0x3ac7x1e}function getValueFromPropertyName(_0x3ac7xf,_0x3ac7x1e,_0x3ac7x12){if(_0x3ac7x1e=== _0x6c9a[53]){if(_0x3ac7x12&& _0x3ac7x12[_0x6c9a[54]]&& _0x3ac7x12[_0x6c9a[20]]){return util[_0x6c9a[42]](_0x6c9a[55],stripTrailingSlash(_0x3ac7x12[_0x6c9a[20]]),_0x3ac7xf[_0x6c9a[56]])}else {return null}}else {return _[_0x6c9a[57]](_0x3ac7xf,_0x3ac7x1e)}}function searchQueue(_0x3ac7xf){return function(){if(_0x3ac7xf[_0x6c9a[58]]){return VoiceQueue[_0x6c9a[45]]({where:{name:_0x3ac7xf[_0x6c9a[58]]},attributes:[_0x6c9a[59],_0x6c9a[60]]})}else {return}}}function handleQueueRecordings(_0x3ac7x12,_0x3ac7xf){return function(_0x3ac7x22){if(_0x3ac7xf[_0x6c9a[58]]){if(_0x3ac7x22&& _0x3ac7x22[_0x6c9a[60]]){console[_0x6c9a[11]](_0x6c9a[61],_0x3ac7x22[_0x6c9a[59]]);_0x3ac7x12[_0x6c9a[54]]= true}else {_0x3ac7x12[_0x6c9a[54]]= false;console[_0x6c9a[11]](_0x6c9a[62])}};return}}function searchRoute(_0x3ac7xf){return function(){if(_0x3ac7xf[_0x6c9a[63]]){return VoiceExtension[_0x6c9a[45]]({where:{id:_0x3ac7xf[_0x6c9a[63]]},attributes:[_0x6c9a[34],_0x6c9a[64]]})}else {return}}}function handleOutboundRecordings(_0x3ac7x12,_0x3ac7xf){return function(_0x3ac7x25){if(_0x3ac7xf[_0x6c9a[63]]){if(_0x3ac7x25&& _0x3ac7x25[_0x6c9a[64]]){console[_0x6c9a[11]](_0x6c9a[65],_0x3ac7x25[_0x6c9a[34]]);_0x3ac7x12[_0x6c9a[54]]= true}else {_0x3ac7x12[_0x6c9a[54]]= false;console[_0x6c9a[11]](_0x6c9a[66])}};return}}function getServerInfo(_0x3ac7x12){return function(){var _0x3ac7xf={method:_0x6c9a[67],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7xf})}}function handleServerInfo(_0x3ac7x12){return function(_0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);var _0x3ac7x28=_0x3ac7xf[_0x6c9a[69]][_0x6c9a[68]](0);if(_0x3ac7x28){_0x3ac7x12[_0x6c9a[70]]= parseInt(_0x3ac7x28)}else {_0x3ac7x12[_0x6c9a[70]]= 6};return}}function searchAgent(_0x3ac7x12){return function(){if(_0x3ac7x12[_0x6c9a[48]]){console[_0x6c9a[11]](_0x6c9a[71],_0x3ac7x12[_0x6c9a[48]]);var _0x3ac7xf={method:_0x6c9a[72],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[73],query:util[_0x6c9a[42]](_0x6c9a[74],_0x3ac7x12[_0x6c9a[48]]),order_by:_0x6c9a[49],offset:_0x6c9a[75],select_fields:[_0x6c9a[34],_0x6c9a[59]],link_name_to_fields_array:[],max_results:-1,deleted:_0x6c9a[75]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7xf})}};return}function handleAgent(_0x3ac7x12){return function(_0x3ac7xf){if(_0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[77]][_0x6c9a[76]]> 0&& _0x3ac7xf[_0x6c9a[78]]> 0){console[_0x6c9a[11]](_0x6c9a[79],_0x3ac7x12[_0x6c9a[48]]);var _0x3ac7x2b=getMatchObject(_0x3ac7xf[_0x6c9a[77]],_0x6c9a[59],_0x6c9a[37],_0x3ac7x12[_0x6c9a[48]]);_0x3ac7x12[_0x6c9a[46]]= {id:_0x3ac7x2b[_0x6c9a[39]][_0x6c9a[34]][_0x6c9a[37]],name:_0x3ac7x2b[_0x6c9a[39]][_0x6c9a[59]][_0x6c9a[37]]};return _0x3ac7x12[_0x6c9a[46]]};return};return}}function handleAdmin(_0x3ac7x12){return function(_0x3ac7xf){if(_0x3ac7xf){return};console[_0x6c9a[11]](_0x6c9a[80]);_0x3ac7x12[_0x6c9a[46]]= _0x3ac7x12[_0x6c9a[36]];console[_0x6c9a[11]](_0x6c9a[81]);return}}function getEndUserSearchModule(_0x3ac7x12){return _0x3ac7x12[_0x6c9a[19]][_0x6c9a[82]]?_0x6c9a[83]:_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]}function searchEndUserWithDefaultMapping(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe){return function(){if(!_0x3ac7x12[_0x6c9a[19]][_0x6c9a[82]]&& _0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[85],getEndUserSearchModule(_0x3ac7x12),getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))));var _0x3ac7x2f={method:_0x6c9a[72],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:getEndUserSearchModule(_0x3ac7x12),query:getEndUserSearchQuery(_0x3ac7x12,_0x3ac7xf,_0x3ac7xd,_0x3ac7xe),order_by:_0x6c9a[49],offset:_0x6c9a[75],select_fields:[_0x6c9a[34],_0x6c9a[59]],link_name_to_fields_array:[],max_results:-1,deleted:_0x6c9a[75]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})};console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[86]));return}}function handleEndUserWithDefaultMapping(_0x3ac7x12,_0x3ac7xd,_0x3ac7x31,_0x3ac7xe){return function(_0x3ac7xf){if(!_0x3ac7x12[_0x6c9a[19]][_0x6c9a[82]]&& _0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]] && _0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[77]][_0x6c9a[76]]> 0&& _0x3ac7xf[_0x6c9a[78]]> 0){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[87],getEndUserSearchModule(_0x3ac7x12),getValueFromPropertyName(_0x3ac7x31,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))));_0x3ac7x12[_0x6c9a[88]]= {id:_0x3ac7xf[_0x6c9a[77]][0][_0x6c9a[39]][_0x6c9a[34]][_0x6c9a[37]],name:_0x3ac7xf[_0x6c9a[77]][0][_0x6c9a[39]][_0x6c9a[59]][_0x6c9a[37]],module:getEndUserSearchModule(_0x3ac7x12)}}else {console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[89],getEndUserSearchModule(_0x3ac7x12),getValueFromPropertyName(_0x3ac7x31,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))))}};return}}function searchEndUser(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe){return function(){if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[82]]||  !_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]||  !_0x3ac7x12[_0x6c9a[88]]){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[90],getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))));var _0x3ac7x2f={method:_0x6c9a[72],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[83],query:util[_0x6c9a[42]](_0x6c9a[91],getEndUserSearchQueryFromChannel(_0x3ac7xd),getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))),order_by:_0x6c9a[49],offset:_0x6c9a[75],select_fields:[_0x6c9a[34],_0x6c9a[59]],link_name_to_fields_array:[],max_results:-1,deleted:_0x6c9a[75]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})};console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[92]));return}}function getEndUserSearchQuery(_0x3ac7x12,_0x3ac7xf,_0x3ac7xd,_0x3ac7xe){var _0x3ac7x34;var _0x3ac7x35=_[_0x6c9a[94]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[93]]);if(_[_0x6c9a[96]](_0x3ac7x35,_0x6c9a[95])){_0x3ac7x34= util[_0x6c9a[42]](_0x6c9a[97],_[_0x6c9a[98]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]])+ _0x6c9a[99],_0x3ac7x35,getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))}else {_0x3ac7x34= util[_0x6c9a[42]](_0x6c9a[97],_[_0x6c9a[98]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]),_0x3ac7x35,getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))};if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[93]][_0x6c9a[76]]> 1){for(var _0x3ac7x36=1;_0x3ac7x36< _0x3ac7x12[_0x6c9a[19]][_0x6c9a[93]][_0x6c9a[76]];_0x3ac7x36++){var _0x3ac7x37=_0x3ac7x12[_0x6c9a[19]][_0x6c9a[93]][_0x3ac7x36];if(_[_0x6c9a[96]](_0x3ac7x35,_0x6c9a[95])){_0x3ac7x34+= util[_0x6c9a[42]](_0x6c9a[100],_[_0x6c9a[98]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]])+ _0x6c9a[99],_0x3ac7x37,getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))}else {_0x3ac7x34+= util[_0x6c9a[42]](_0x6c9a[100],_[_0x6c9a[98]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]),_0x3ac7x37,getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))}}};return _0x3ac7x34}function getEndUserSearchQueryFromChannel(_0x3ac7xd){var _0x3ac7x1e=_0x6c9a[49];if(_0x3ac7xd){switch(_0x3ac7xd){case _0x6c9a[51]:_0x3ac7x1e= _0x6c9a[101];break;default:_0x3ac7x1e= _0x6c9a[101];console[_0x6c9a[15]](_0x6c9a[52],_0x3ac7xd)}};return _0x3ac7x1e}function getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe){var _0x3ac7x1e=_0x6c9a[49];if(_0x3ac7xd){switch(_0x3ac7xd){case _0x6c9a[51]:if(_0x3ac7xe=== _0x6c9a[102]){_0x3ac7x1e= _0x6c9a[103]}else {if(_0x3ac7xe=== _0x6c9a[58]){_0x3ac7x1e= _0x6c9a[104]}};break;default:_0x3ac7x1e= _0x6c9a[104];console[_0x6c9a[15]](_0x6c9a[52],_0x3ac7xd)}};return _0x3ac7x1e}function handleEndUser(_0x3ac7x12,_0x3ac7xd,_0x3ac7x31,_0x3ac7xe){return function(_0x3ac7xf){if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[82]]||  !_0x3ac7x12[_0x6c9a[19]][_0x6c9a[84]]||  !_0x3ac7x12[_0x6c9a[88]]){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[77]][_0x6c9a[76]]> 0&& _0x3ac7xf[_0x6c9a[78]]> 0){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[105],getValueFromPropertyName(_0x3ac7x31,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))));_0x3ac7x12[_0x6c9a[88]]= {id:_0x3ac7xf[_0x6c9a[77]][0][_0x6c9a[39]][_0x6c9a[34]][_0x6c9a[37]],name:_0x3ac7xf[_0x6c9a[77]][0][_0x6c9a[39]][_0x6c9a[59]][_0x6c9a[37]],module:_0x6c9a[83]}}};return _0x3ac7x12[_0x6c9a[88]]}}function endUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7x31,_0x3ac7xe){return function(_0x3ac7xf){if(_0x3ac7xf){return};console[_0x6c9a[11]](_0x6c9a[106],getValueFromPropertyName(_0x3ac7x31,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)));var _0x3ac7x2f={method:_0x6c9a[107],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[83],name_value_list:getArrayForEndUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7x31,_0x3ac7xe)})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})}}function getEndUserCreatePhone(_0x3ac7x12){return _[_0x6c9a[94]](_0x3ac7x12[_0x6c9a[19]][_0x6c9a[93]])}function getArrayForEndUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xe){var _0x3ac7x3e=[];switch(_0x3ac7xd){case _0x6c9a[51]:var _0x3ac7x3f={name:_0x6c9a[108]};if(_0x3ac7xe=== _0x6c9a[58]){if(isValidName(_0x3ac7xf[_0x6c9a[109]])){_0x3ac7x3f[_0x6c9a[37]]= getValueFromPropertyName(_0x3ac7xf,getEndUserNamePropertyFromChannel(_0x3ac7xd,_0x3ac7xe))}else {_0x3ac7x3f[_0x6c9a[37]]= util[_0x6c9a[42]](_0x6c9a[110],getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))}}else {if(_0x3ac7xe=== _0x6c9a[102]){if(isValidName(_0x3ac7xf[_0x6c9a[111]])){_0x3ac7x3f[_0x6c9a[37]]= getValueFromPropertyName(_0x3ac7xf,getEndUserNamePropertyFromChannel(_0x3ac7xd,_0x3ac7xe))}else {_0x3ac7x3f[_0x6c9a[37]]= util[_0x6c9a[42]](_0x6c9a[110],getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)))}}};_0x3ac7x3e[_0x6c9a[112]](_0x3ac7x3f);_0x3ac7x3e[_0x6c9a[112]]({name:getEndUserSearchQueryFromChannel(_0x3ac7xd),value:getValueFromPropertyName(_0x3ac7xf,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe))});break;default:console[_0x6c9a[15]](_0x6c9a[52],_0x3ac7xd)};return _0x3ac7x3e}function isValidName(_0x3ac7x41){return _0x3ac7x41&& _0x3ac7x41!== _0x6c9a[113]}function getEndUserNamePropertyFromChannel(_0x3ac7xd,_0x3ac7xe){var _0x3ac7x1e=_0x6c9a[49];if(_0x3ac7xd){switch(_0x3ac7xd){case _0x6c9a[51]:if(_0x3ac7xe=== _0x6c9a[102]){_0x3ac7x1e= _0x6c9a[111]}else {if(_0x3ac7xe=== _0x6c9a[58]){_0x3ac7x1e= _0x6c9a[109]}};break;default:_0x3ac7x1e= _0x6c9a[109];console[_0x6c9a[15]](_0x6c9a[52],_0x3ac7xd)}};return _0x3ac7x1e}function handleEndUserCreation(_0x3ac7x12,_0x3ac7xd,_0x3ac7x31,_0x3ac7xe){return function(_0x3ac7xf){if(!_0x3ac7xf){return};_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[34]]){console[_0x6c9a[11]](_0x6c9a[114],getValueFromPropertyName(_0x3ac7x31,getEndUserSearchPropertyFromChannel(_0x3ac7xd,_0x3ac7xe)));var _0x3ac7x44=getEndUserSearchQueryFromChannel(_0x3ac7xd);_0x3ac7x12[_0x6c9a[88]]= {id:_0x3ac7xf[_0x6c9a[34]],name:_0x3ac7xf[_0x6c9a[77]][_0x3ac7x44][_0x6c9a[37]],module:_0x6c9a[83]}};return}}function callCreation(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10){return function(){var _0x3ac7x46= new Date();var _0x3ac7x47=[{name:_0x6c9a[59],value:createSubjectFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10)},{name:_0x6c9a[115],value:_0x3ac7x12[_0x6c9a[46]][_0x6c9a[34]]},{name:_0x6c9a[116],value:_0x3ac7x12[_0x6c9a[46]][_0x6c9a[34]]},{name:_0x6c9a[117],value:createDescriptionFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10)},{name:_0x6c9a[118],value:_0x3ac7x46[_0x6c9a[123]]()[_0x6c9a[122]](0,19)[_0x6c9a[121]](_0x6c9a[119],_0x6c9a[120])},{name:_0x6c9a[124],value:_0x6c9a[75]},{name:_0x6c9a[125],value:_0x6c9a[126]}];var _0x3ac7x48=createCustomFieldsFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10);if(_0x3ac7x48[_0x6c9a[76]]> 0){_[_0x6c9a[127]](_0x3ac7x48,function(_0x3ac7x49){_0x3ac7x47[_0x6c9a[112]]({name:_0x3ac7x49[_0x6c9a[34]],value:_0x3ac7x49[_0x6c9a[37]]})})};var _0x3ac7x2f={method:_0x6c9a[107],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[128],name_value_list:_0x3ac7x47})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})}}function createSubjectFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10){var _0x3ac7x4b=_0x6c9a[49];var _0x3ac7x4c=[];if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[129]][_0x6c9a[76]]> 0){var _0x3ac7x4d=_[_0x6c9a[130]](_0x3ac7x12[_0x6c9a[19]].Subject,[_0x6c9a[34]]);_[_0x6c9a[127]](_0x3ac7x4d,function(_0x3ac7x4e){if(_0x3ac7x4e[_0x6c9a[131]]=== _0x6c9a[132]){_0x3ac7x4c[_0x6c9a[112]](_0x3ac7x4e[_0x6c9a[133]])}else {if(_0x3ac7x4e[_0x6c9a[131]]=== _0x6c9a[134]&& _0x3ac7x4e[_0x6c9a[135]]){var _0x3ac7x4f=getValueFromPropertyName(_0x3ac7x31,_0x3ac7x4e[_0x6c9a[135]],_0x3ac7x12);if(_0x3ac7x4f){_0x3ac7x4c[_0x6c9a[112]](_0x3ac7x4f.toString())}}else {if(_0x3ac7x4e[_0x6c9a[131]]=== _0x6c9a[136]&& _0x3ac7x4e[_0x6c9a[137]]&& _0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]){_0x3ac7x10[_0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]]&& _0x3ac7x4c[_0x6c9a[112]](_0x3ac7x10[_0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]].toString())}}}});_0x3ac7x4b= _0x3ac7x4c[_0x6c9a[138]](_0x6c9a[120])};return _0x3ac7x4b}function createDescriptionFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10){var _0x3ac7x51=_0x6c9a[49];var _0x3ac7x4c=[];if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[139]][_0x6c9a[76]]> 0){var _0x3ac7x52=_[_0x6c9a[130]](_0x3ac7x12[_0x6c9a[19]].Description,[_0x6c9a[34]]);_[_0x6c9a[127]](_0x3ac7x52,function(_0x3ac7x4e){if(_0x3ac7x4e[_0x6c9a[131]]=== _0x6c9a[132]){_0x3ac7x4c[_0x6c9a[112]](_0x3ac7x4e[_0x6c9a[133]])}else {if(_0x3ac7x4e[_0x6c9a[131]]=== _0x6c9a[140]){if(_0x3ac7x4e[_0x6c9a[141]]=== _0x6c9a[132]&& _0x3ac7x4e[_0x6c9a[142]]){_0x3ac7x4c[_0x6c9a[112]](util[_0x6c9a[42]](_0x6c9a[143],_0x3ac7x4e[_0x6c9a[142]],_0x3ac7x4e[_0x6c9a[144]]))}else {if(_0x3ac7x4e[_0x6c9a[141]]=== _0x6c9a[134]&& _0x3ac7x4e[_0x6c9a[135]]&& _0x3ac7x4e[_0x6c9a[142]]){var _0x3ac7x4f=getValueFromPropertyName(_0x3ac7x31,_0x3ac7x4e[_0x6c9a[135]],_0x3ac7x12);if(_0x3ac7x4f){_0x3ac7x4c[_0x6c9a[112]](util[_0x6c9a[42]](_0x6c9a[143],_0x3ac7x4e[_0x6c9a[142]],_0x3ac7x4f.toString()))}}else {if(_0x3ac7x4e[_0x6c9a[141]]=== _0x6c9a[136]&& _0x3ac7x4e[_0x6c9a[137]]&& _0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]&& _0x3ac7x4e[_0x6c9a[142]]){_0x3ac7x10[_0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]]&& _0x3ac7x4c[_0x6c9a[112]](util[_0x6c9a[42]](_0x6c9a[143],_0x3ac7x4e[_0x6c9a[142]],_0x3ac7x10[_0x3ac7x4e[_0x6c9a[137]][_0x6c9a[59]]]))}}}}}});_0x3ac7x51= _0x3ac7x4c[_0x6c9a[138]](_0x6c9a[145])};return _0x3ac7x51}function createCustomFieldsFromConfiguration(_0x3ac7x12,_0x3ac7x31,_0x3ac7x10){var _0x3ac7x54=[];var _0x3ac7x55=[];if(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[146]][_0x6c9a[76]]> 0){_0x3ac7x54= _0x3ac7x12[_0x6c9a[19]][_0x6c9a[146]];_[_0x6c9a[127]](_0x3ac7x54,function(_0x3ac7x49){if(_0x3ac7x49[_0x6c9a[131]]=== _0x6c9a[132]&& _0x3ac7x49[_0x6c9a[147]]){_0x3ac7x55[_0x6c9a[112]]({id:_0x3ac7x49[_0x6c9a[147]],value:_0x3ac7x49[_0x6c9a[133]]})}else {if(_0x3ac7x49[_0x6c9a[131]]=== _0x6c9a[134]&& _0x3ac7x49[_0x6c9a[135]]&& _0x3ac7x49[_0x6c9a[147]]){var _0x3ac7x4f=getValueFromPropertyName(_0x3ac7x31,_0x3ac7x49[_0x6c9a[135]],_0x3ac7x12);if(_0x3ac7x4f){_0x3ac7x55[_0x6c9a[112]]({id:_0x3ac7x49[_0x6c9a[147]],value:_0x3ac7x4f.toString()})}}else {if(_0x3ac7x49[_0x6c9a[131]]=== _0x6c9a[136]&& _0x3ac7x49[_0x6c9a[147]]&& _0x3ac7x49[_0x6c9a[137]]&& _0x3ac7x49[_0x6c9a[137]][_0x6c9a[59]]){_0x3ac7x10[_0x3ac7x49[_0x6c9a[137]][_0x6c9a[59]]]&& _0x3ac7x55[_0x6c9a[112]]({id:_0x3ac7x49[_0x6c9a[147]],value:_0x3ac7x10[_0x3ac7x49[_0x6c9a[137]][_0x6c9a[59]]].toString()})}}}})};return _0x3ac7x55}function handleCallAgentAssociation(_0x3ac7x12){return function(_0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[34]]){_0x3ac7x12[_0x6c9a[148]]= {id:_0x3ac7xf[_0x6c9a[34]]};if(_0x3ac7x12[_0x6c9a[70]]<= 6){_0x3ac7x12[_0x6c9a[148]][_0x6c9a[149]]= util[_0x6c9a[42]](_0x6c9a[150],stripTrailingSlash(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[22]][_0x6c9a[24]]),_0x3ac7xf[_0x6c9a[34]])}else {_0x3ac7x12[_0x6c9a[148]][_0x6c9a[149]]= util[_0x6c9a[42]](_0x6c9a[151],stripTrailingSlash(_0x3ac7x12[_0x6c9a[19]][_0x6c9a[22]][_0x6c9a[24]]),_0x3ac7xf[_0x6c9a[34]])}};var _0x3ac7x2f={method:_0x6c9a[152],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[128],module_id:_0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]],link_field_name:_0x6c9a[153],related_ids:[_0x3ac7x12[_0x6c9a[46]][_0x6c9a[34]]]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})}}function handleCallContactAssociation(_0x3ac7x12){return function(_0x3ac7xf){_0x3ac7xf= handleWsResponse(_0x3ac7xf);if(_0x3ac7xf[_0x6c9a[154]]>= 1){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[155],_0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]],_0x3ac7x12[_0x6c9a[46]][_0x6c9a[34]]))};var _0x3ac7x2f={method:_0x6c9a[152],input_type:_0x6c9a[31],response_type:_0x6c9a[31],rest_data:JSON[_0x6c9a[32]]({session:_0x3ac7x12[_0x6c9a[35]],module_name:_0x6c9a[128],module_id:_0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]],link_field_name:_[_0x6c9a[98]](_0x3ac7x12[_0x6c9a[88]][_0x6c9a[156]]),related_ids:[_0x3ac7x12[_0x6c9a[88]][_0x6c9a[34]]]})};return rp({method:_0x6c9a[33],uri:_0x3ac7x12[_0x6c9a[23]],form:_0x3ac7x2f})}}function handleReportIntegration(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xb,_0x3ac7x11,_0x3ac7xe){return function(_0x3ac7x59){_0x3ac7x59= handleWsResponse(_0x3ac7x59);if(_0x3ac7x59[_0x6c9a[154]]>= 1){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[157],_0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]],_0x3ac7x12[_0x6c9a[88]][_0x6c9a[34]]))};delete _0x3ac7xf[_0x6c9a[34]];delete _0x3ac7xf[_0x6c9a[158]];delete _0x3ac7xf[_0x6c9a[159]];_0x3ac7xf[_0x6c9a[160]]= _0x6c9a[161];_0x3ac7xf[_0x6c9a[162]]= _0x3ac7xd;_0x3ac7xf[_0x6c9a[163]]= _0x6c9a[164];_0x3ac7xf[_0x6c9a[165]]= _0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]];_0x3ac7xf[_0x6c9a[149]]= _0x3ac7x12[_0x6c9a[148]][_0x6c9a[149]];_0x3ac7xf[_0x6c9a[166]]= _0x3ac7xb;_0x3ac7xf[_0x6c9a[167]]= _0x3ac7xe;_0x3ac7x11[_0x6c9a[171]](util[_0x6c9a[42]](_0x6c9a[170],_0x3ac7xf[_0x6c9a[50]]))[_0x6c9a[169]](_0x6c9a[168],_0x3ac7xf);return ReportIntegration[_0x6c9a[172]](_0x3ac7xf)}}function handleEnd(_0x3ac7x12){return function(_0x3ac7xf){console[_0x6c9a[11]](util[_0x6c9a[42]](_0x6c9a[173],_0x3ac7x12[_0x6c9a[148]][_0x6c9a[34]],_0x3ac7x12[_0x6c9a[46]][_0x6c9a[34]]));_0x3ac7x12= undefined;return}}function handleError(_0x3ac7x12,_0x3ac7xd,_0x3ac7xf,_0x3ac7xb){return function(_0x3ac7x5c){console[_0x6c9a[15]](_0x6c9a[174]);console[_0x6c9a[15]](_0x6c9a[175],_0x3ac7x5c[_0x6c9a[176]]);console[_0x6c9a[15]](_0x6c9a[177],_0x3ac7x5c[_0x6c9a[178]]);_0x3ac7x12= undefined;delete _0x3ac7xf[_0x6c9a[34]];delete _0x3ac7xf[_0x6c9a[158]];delete _0x3ac7xf[_0x6c9a[159]];_0x3ac7xf[_0x6c9a[160]]= _0x6c9a[161];_0x3ac7xf[_0x6c9a[162]]= _0x3ac7xd;_0x3ac7xf[_0x6c9a[163]]= _0x6c9a[179];_0x3ac7xf[_0x6c9a[166]]= _0x3ac7xb;ReportIntegration[_0x6c9a[172]](_0x3ac7xf)[_0x6c9a[16]](function(_0x3ac7x5c){console[_0x6c9a[15]](_0x6c9a[180]);return})}}function stripTrailingSlash(_0x3ac7x5e){if(_0x3ac7x5e[_0x6c9a[181]](-1) === _0x6c9a[182]){return _0x3ac7x5e[_0x6c9a[181]](0,_0x3ac7x5e[_0x6c9a[76]]- 1)};return _0x3ac7x5e}function handleWsResponse(_0x3ac7xf){return JSON[_0x6c9a[183]](_0x3ac7xf)}function getMatchObject(_0x3ac7x61,_0x3ac7x1e,_0x3ac7x62,_0x3ac7x63){var _0x3ac7x64=_[_0x6c9a[18]](_0x3ac7x61,function(_0x3ac7x65){return _0x3ac7x65[_0x6c9a[39]][_0x3ac7x1e][_0x3ac7x62]== _0x3ac7x63});if(_0x3ac7x64){return _0x3ac7x64};return _[_0x6c9a[184]](_0x3ac7x61)}module[_0x6c9a[185]]= Sugarcrm