a89d6c3504dae291b0e91ba918f3fe07bb2aedfc
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0x7e0a=["\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","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x69\x6E\x66\x6F","\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","\x64\x65\x62\x75\x67","\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","\x70\x61\x72\x65\x6E\x74\x5F\x69\x64","\x70\x61\x72\x65\x6E\x74\x5F\x74\x79\x70\x65","\x6D\x6F\x64\x75\x6C\x65","\x70\x61\x72\x65\x6E\x74\x5F\x6E\x61\x6D\x65","\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","\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(_0x7e0a[0]);var util=require(_0x7e0a[1]);var rp=require(_0x7e0a[2]);var request=require(_0x7e0a[3]);var logger=require(_0x7e0a[5])(_0x7e0a[4]);var SugarcrmConfiguration=require(_0x7e0a[7])[_0x7e0a[6]];var ReportIntegration=require(_0x7e0a[7])[_0x7e0a[8]];var VoiceQueue=require(_0x7e0a[7])[_0x7e0a[9]];var VoiceExtension=require(_0x7e0a[7])[_0x7e0a[10]];var Agent=require(_0x7e0a[7])[_0x7e0a[11]];function Sugarcrm(){logger[_0x7e0a[13]](_0x7e0a[12])}Sugarcrm[_0x7e0a[15]][_0x7e0a[14]]= function(_0x2e5bxc,_0x2e5bxd,_0x2e5bxe,_0x2e5bxf,_0x2e5bx10,_0x2e5bx11,_0x2e5bx12){var _0x2e5bx13={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0x2e5bxc||  !_0x2e5bxd){logger[_0x7e0a[17]](_0x7e0a[16]);return};SugarcrmConfiguration[_0x7e0a[20]]({where:{id:_0x2e5bxd,AccountId:_0x2e5bxc},include:[{all:true,include:[{all:true}]}]})[_0x7e0a[19]](handleEntityNotFound())[_0x7e0a[19]](handleConnection(_0x2e5bx13))[_0x7e0a[19]](handleLogin(_0x2e5bx13))[_0x7e0a[19]](searchMotionAgent(_0x2e5bxe,_0x2e5bx10))[_0x7e0a[19]](handleMotionAgent(_0x2e5bx13))[_0x7e0a[19]](searchQueue(_0x2e5bx10))[_0x7e0a[19]](handleQueueRecordings(_0x2e5bx13,_0x2e5bx10))[_0x7e0a[19]](searchRoute(_0x2e5bx10))[_0x7e0a[19]](handleOutboundRecordings(_0x2e5bx13,_0x2e5bx10))[_0x7e0a[19]](getServerInfo(_0x2e5bx13))[_0x7e0a[19]](handleServerInfo(_0x2e5bx13))[_0x7e0a[19]](searchAgent(_0x2e5bx13))[_0x7e0a[19]](handleAgent(_0x2e5bx13))[_0x7e0a[19]](handleAdmin(_0x2e5bx13))[_0x7e0a[19]](searchEndUserWithDefaultMapping(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](handleEndUserWithDefaultMapping(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](searchEndUser(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](handleEndUser(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](endUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](handleEndUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf))[_0x7e0a[19]](callCreation(_0x2e5bx13,_0x2e5bx10,_0x2e5bx11))[_0x7e0a[19]](handleCallAgentAssociation(_0x2e5bx13))[_0x7e0a[19]](handleCallContactAssociation(_0x2e5bx13))[_0x7e0a[19]](handleReportIntegration(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxc,_0x2e5bx12,_0x2e5bxf))[_0x7e0a[19]](handleEnd(_0x2e5bx13))[_0x7e0a[18]](handleError(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxc))};function handleEntityNotFound(){return function(_0x2e5bx15){if(!_0x2e5bx15){return null};return _0x2e5bx15}}function handleConnection(_0x2e5bx13){return function(_0x2e5bx17){_0x2e5bx13[_0x7e0a[21]]= _0x2e5bx17;_0x2e5bx13[_0x7e0a[22]]= _0x2e5bx17[_0x7e0a[24]][_0x7e0a[23]];_0x2e5bx13[_0x7e0a[25]]= stripTrailingSlash(_0x2e5bx17[_0x7e0a[24]][_0x7e0a[26]])+ _0x7e0a[27];var _0x2e5bx18={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0x2e5bx17[_0x7e0a[24]][_0x7e0a[28]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0x2e5bx17[_0x7e0a[24]][_0x7e0a[29]],encryption:_0x7e0a[30]},application:_0x7e0a[31]};var _0x2e5bx10={method:_0x7e0a[32],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]](_0x2e5bx18)};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx10})}}function handleLogin(_0x2e5bx13){return function(_0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[37]]){_0x2e5bx13[_0x7e0a[38]]= _0x2e5bx10[_0x7e0a[37]];_0x2e5bx13[_0x7e0a[39]]= {id:_0x2e5bx10[_0x7e0a[42]][_0x7e0a[41]][_0x7e0a[40]],name:_0x2e5bx10[_0x7e0a[42]][_0x7e0a[43]][_0x7e0a[40]]};return};throw  new Error(util[_0x7e0a[45]](_0x7e0a[44],_0x2e5bx13[_0x7e0a[21]][_0x7e0a[24]][_0x7e0a[37]]))}}function searchMotionAgent(_0x2e5bxe,_0x2e5bx10){return function(){var _0x2e5bx1b=getAgentSearchPropertyFromChannel(_0x2e5bxe);if(_0x2e5bx10[_0x7e0a[46]](_0x2e5bx1b)){return Agent[_0x7e0a[50]](_0x7e0a[49])[_0x7e0a[48]]({where:{name:getValueFromPropertyName(_0x2e5bx10,_0x2e5bx1b)},attributes:[_0x7e0a[47]]})};return}}function handleMotionAgent(_0x2e5bx13){return function(_0x2e5bx1d){if(_0x2e5bx1d&& _0x2e5bx1d[_0x7e0a[47]]){_0x2e5bx13[_0x7e0a[51]]= _0x2e5bx1d[_0x7e0a[47]]};return}}function getAgentSearchPropertyFromChannel(_0x2e5bxe){var _0x2e5bx1f=_0x7e0a[52];if(_0x2e5bxe){switch(_0x2e5bxe){case _0x7e0a[54]:_0x2e5bx1f= _0x7e0a[53];break;default:_0x2e5bx1f= _0x7e0a[53];logger[_0x7e0a[17]](_0x7e0a[55],_0x2e5bxe)}};return _0x2e5bx1f}function getValueFromPropertyName(_0x2e5bx10,_0x2e5bx1f,_0x2e5bx13){if(_0x2e5bx1f=== _0x7e0a[56]){if(_0x2e5bx13&& _0x2e5bx13[_0x7e0a[57]]&& _0x2e5bx13[_0x7e0a[22]]){return util[_0x7e0a[45]](_0x7e0a[58],stripTrailingSlash(_0x2e5bx13[_0x7e0a[22]]),_0x2e5bx10[_0x7e0a[59]])}else {return null}}else {return _[_0x7e0a[60]](_0x2e5bx10,_0x2e5bx1f)}}function searchQueue(_0x2e5bx10){return function(){if(_0x2e5bx10[_0x7e0a[61]]){return VoiceQueue[_0x7e0a[48]]({where:{name:_0x2e5bx10[_0x7e0a[61]]},attributes:[_0x7e0a[62],_0x7e0a[63]]})}else {return}}}function handleQueueRecordings(_0x2e5bx13,_0x2e5bx10){return function(_0x2e5bx23){if(_0x2e5bx10[_0x7e0a[61]]){if(_0x2e5bx23&& _0x2e5bx23[_0x7e0a[63]]){logger[_0x7e0a[13]](_0x7e0a[64],_0x2e5bx23[_0x7e0a[62]]);_0x2e5bx13[_0x7e0a[57]]= true}else {_0x2e5bx13[_0x7e0a[57]]= false;logger[_0x7e0a[13]](_0x7e0a[65])}};return}}function searchRoute(_0x2e5bx10){return function(){if(_0x2e5bx10[_0x7e0a[66]]){return VoiceExtension[_0x7e0a[48]]({where:{id:_0x2e5bx10[_0x7e0a[66]]},attributes:[_0x7e0a[37],_0x7e0a[67]]})}else {return}}}function handleOutboundRecordings(_0x2e5bx13,_0x2e5bx10){return function(_0x2e5bx26){if(_0x2e5bx10[_0x7e0a[66]]){if(_0x2e5bx26&& _0x2e5bx26[_0x7e0a[67]]){logger[_0x7e0a[13]](_0x7e0a[68],_0x2e5bx26[_0x7e0a[37]]);_0x2e5bx13[_0x7e0a[57]]= true}else {_0x2e5bx13[_0x7e0a[57]]= false;logger[_0x7e0a[13]](_0x7e0a[69])}};return}}function getServerInfo(_0x2e5bx13){return function(){var _0x2e5bx10={method:_0x7e0a[70],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx10})}}function handleServerInfo(_0x2e5bx13){return function(_0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);var _0x2e5bx29=_0x2e5bx10[_0x7e0a[72]][_0x7e0a[71]](0);if(_0x2e5bx29){_0x2e5bx13[_0x7e0a[73]]= parseInt(_0x2e5bx29)}else {_0x2e5bx13[_0x7e0a[73]]= 6};return}}function searchAgent(_0x2e5bx13){return function(){if(_0x2e5bx13[_0x7e0a[51]]){logger[_0x7e0a[13]](_0x7e0a[74],_0x2e5bx13[_0x7e0a[51]]);var _0x2e5bx10={method:_0x7e0a[75],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[76],query:util[_0x7e0a[45]](_0x7e0a[77],_0x2e5bx13[_0x7e0a[51]]),order_by:_0x7e0a[52],offset:_0x7e0a[78],select_fields:[_0x7e0a[37],_0x7e0a[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x7e0a[78]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx10})}};return}function handleAgent(_0x2e5bx13){return function(_0x2e5bx10){if(_0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[80]][_0x7e0a[79]]> 0&& _0x2e5bx10[_0x7e0a[81]]> 0){logger[_0x7e0a[13]](_0x7e0a[82],_0x2e5bx13[_0x7e0a[51]]);var _0x2e5bx2c=getMatchObject(_0x2e5bx10[_0x7e0a[80]],_0x7e0a[62],_0x7e0a[40],_0x2e5bx13[_0x7e0a[51]]);_0x2e5bx13[_0x7e0a[49]]= {id:_0x2e5bx2c[_0x7e0a[42]][_0x7e0a[37]][_0x7e0a[40]],name:_0x2e5bx2c[_0x7e0a[42]][_0x7e0a[62]][_0x7e0a[40]]};return _0x2e5bx13[_0x7e0a[49]]};return};return}}function handleAdmin(_0x2e5bx13){return function(_0x2e5bx10){if(_0x2e5bx10){return};logger[_0x7e0a[13]](_0x7e0a[83]);_0x2e5bx13[_0x7e0a[49]]= _0x2e5bx13[_0x7e0a[39]];logger[_0x7e0a[13]](_0x7e0a[84]);return}}function getEndUserSearchModule(_0x2e5bx13){return _0x2e5bx13[_0x7e0a[21]][_0x7e0a[85]]?_0x7e0a[86]:_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]}function searchEndUserWithDefaultMapping(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf){return function(){if(!_0x2e5bx13[_0x7e0a[21]][_0x7e0a[85]]&& _0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[88],getEndUserSearchModule(_0x2e5bx13),getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))));var _0x2e5bx30={method:_0x7e0a[75],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:getEndUserSearchModule(_0x2e5bx13),query:getEndUserSearchQuery(_0x2e5bx13,_0x2e5bx10,_0x2e5bxe,_0x2e5bxf),order_by:_0x7e0a[52],offset:_0x7e0a[78],select_fields:[_0x7e0a[37],_0x7e0a[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x7e0a[78]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})};logger[_0x7e0a[36]](util[_0x7e0a[45]](_0x7e0a[89]));return}}function handleEndUserWithDefaultMapping(_0x2e5bx13,_0x2e5bxe,_0x2e5bx32,_0x2e5bxf){return function(_0x2e5bx10){if(!_0x2e5bx13[_0x7e0a[21]][_0x7e0a[85]]&& _0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]] && _0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[80]][_0x7e0a[79]]> 0&& _0x2e5bx10[_0x7e0a[81]]> 0){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[90],getEndUserSearchModule(_0x2e5bx13),getValueFromPropertyName(_0x2e5bx32,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))));_0x2e5bx13[_0x7e0a[91]]= {id:_0x2e5bx10[_0x7e0a[80]][0][_0x7e0a[42]][_0x7e0a[37]][_0x7e0a[40]],name:_0x2e5bx10[_0x7e0a[80]][0][_0x7e0a[42]][_0x7e0a[62]][_0x7e0a[40]],module:getEndUserSearchModule(_0x2e5bx13)}}else {logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[92],getEndUserSearchModule(_0x2e5bx13),getValueFromPropertyName(_0x2e5bx32,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))))}};return}}function searchEndUser(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf){return function(){if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[85]]||  !_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]||  !_0x2e5bx13[_0x7e0a[91]]){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[93],getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))));var _0x2e5bx30={method:_0x7e0a[75],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[86],query:util[_0x7e0a[45]](_0x7e0a[94],getEndUserSearchQueryFromChannel(_0x2e5bxe),getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))),order_by:_0x7e0a[52],offset:_0x7e0a[78],select_fields:[_0x7e0a[37],_0x7e0a[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x7e0a[78]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})};logger[_0x7e0a[36]](util[_0x7e0a[45]](_0x7e0a[95]));return}}function getEndUserSearchQuery(_0x2e5bx13,_0x2e5bx10,_0x2e5bxe,_0x2e5bxf){var _0x2e5bx35;var _0x2e5bx36=_[_0x7e0a[97]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[96]]);if(_[_0x7e0a[99]](_0x2e5bx36,_0x7e0a[98])){_0x2e5bx35= util[_0x7e0a[45]](_0x7e0a[100],_[_0x7e0a[101]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]])+ _0x7e0a[102],_0x2e5bx36,getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))}else {_0x2e5bx35= util[_0x7e0a[45]](_0x7e0a[100],_[_0x7e0a[101]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]),_0x2e5bx36,getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))};if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[96]][_0x7e0a[79]]> 1){for(var _0x2e5bx37=1;_0x2e5bx37< _0x2e5bx13[_0x7e0a[21]][_0x7e0a[96]][_0x7e0a[79]];_0x2e5bx37++){var _0x2e5bx38=_0x2e5bx13[_0x7e0a[21]][_0x7e0a[96]][_0x2e5bx37];if(_[_0x7e0a[99]](_0x2e5bx36,_0x7e0a[98])){_0x2e5bx35+= util[_0x7e0a[45]](_0x7e0a[103],_[_0x7e0a[101]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]])+ _0x7e0a[102],_0x2e5bx38,getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))}else {_0x2e5bx35+= util[_0x7e0a[45]](_0x7e0a[103],_[_0x7e0a[101]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]),_0x2e5bx38,getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))}}};return _0x2e5bx35}function getEndUserSearchQueryFromChannel(_0x2e5bxe){var _0x2e5bx1f=_0x7e0a[52];if(_0x2e5bxe){switch(_0x2e5bxe){case _0x7e0a[54]:_0x2e5bx1f= _0x7e0a[104];break;default:_0x2e5bx1f= _0x7e0a[104];logger[_0x7e0a[17]](_0x7e0a[55],_0x2e5bxe)}};return _0x2e5bx1f}function getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf){var _0x2e5bx1f=_0x7e0a[52];if(_0x2e5bxe){switch(_0x2e5bxe){case _0x7e0a[54]:if(_0x2e5bxf=== _0x7e0a[105]){_0x2e5bx1f= _0x7e0a[106]}else {if(_0x2e5bxf=== _0x7e0a[61]){_0x2e5bx1f= _0x7e0a[107]}};break;default:_0x2e5bx1f= _0x7e0a[107];logger[_0x7e0a[17]](_0x7e0a[55],_0x2e5bxe)}};return _0x2e5bx1f}function handleEndUser(_0x2e5bx13,_0x2e5bxe,_0x2e5bx32,_0x2e5bxf){return function(_0x2e5bx10){if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[85]]||  !_0x2e5bx13[_0x7e0a[21]][_0x7e0a[87]]||  !_0x2e5bx13[_0x7e0a[91]]){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[80]][_0x7e0a[79]]> 0&& _0x2e5bx10[_0x7e0a[81]]> 0){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[108],getValueFromPropertyName(_0x2e5bx32,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))));_0x2e5bx13[_0x7e0a[91]]= {id:_0x2e5bx10[_0x7e0a[80]][0][_0x7e0a[42]][_0x7e0a[37]][_0x7e0a[40]],name:_0x2e5bx10[_0x7e0a[80]][0][_0x7e0a[42]][_0x7e0a[62]][_0x7e0a[40]],module:_0x7e0a[86]}}};return _0x2e5bx13[_0x7e0a[91]]}}function endUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx32,_0x2e5bxf){return function(_0x2e5bx10){if(_0x2e5bx10){return};logger[_0x7e0a[13]](_0x7e0a[109],getValueFromPropertyName(_0x2e5bx32,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)));var _0x2e5bx30={method:_0x7e0a[110],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[86],name_value_list:getArrayForEndUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx32,_0x2e5bxf)})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})}}function getEndUserCreatePhone(_0x2e5bx13){return _[_0x7e0a[97]](_0x2e5bx13[_0x7e0a[21]][_0x7e0a[96]])}function getArrayForEndUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxf){var _0x2e5bx3f=[];switch(_0x2e5bxe){case _0x7e0a[54]:var _0x2e5bx40={name:_0x7e0a[111]};if(_0x2e5bxf=== _0x7e0a[61]){if(isValidName(_0x2e5bx10[_0x7e0a[112]])){_0x2e5bx40[_0x7e0a[40]]= getValueFromPropertyName(_0x2e5bx10,getEndUserNamePropertyFromChannel(_0x2e5bxe,_0x2e5bxf))}else {_0x2e5bx40[_0x7e0a[40]]= util[_0x7e0a[45]](_0x7e0a[113],getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))}}else {if(_0x2e5bxf=== _0x7e0a[105]){if(isValidName(_0x2e5bx10[_0x7e0a[114]])){_0x2e5bx40[_0x7e0a[40]]= getValueFromPropertyName(_0x2e5bx10,getEndUserNamePropertyFromChannel(_0x2e5bxe,_0x2e5bxf))}else {_0x2e5bx40[_0x7e0a[40]]= util[_0x7e0a[45]](_0x7e0a[113],getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)))}}};_0x2e5bx3f[_0x7e0a[115]](_0x2e5bx40);_0x2e5bx3f[_0x7e0a[115]]({name:getEndUserSearchQueryFromChannel(_0x2e5bxe),value:getValueFromPropertyName(_0x2e5bx10,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf))});break;default:logger[_0x7e0a[17]](_0x7e0a[55],_0x2e5bxe)};return _0x2e5bx3f}function isValidName(_0x2e5bx42){return _0x2e5bx42&& _0x2e5bx42!== _0x7e0a[116]}function getEndUserNamePropertyFromChannel(_0x2e5bxe,_0x2e5bxf){var _0x2e5bx1f=_0x7e0a[52];if(_0x2e5bxe){switch(_0x2e5bxe){case _0x7e0a[54]:if(_0x2e5bxf=== _0x7e0a[105]){_0x2e5bx1f= _0x7e0a[114]}else {if(_0x2e5bxf=== _0x7e0a[61]){_0x2e5bx1f= _0x7e0a[112]}};break;default:_0x2e5bx1f= _0x7e0a[112];logger[_0x7e0a[17]](_0x7e0a[55],_0x2e5bxe)}};return _0x2e5bx1f}function handleEndUserCreation(_0x2e5bx13,_0x2e5bxe,_0x2e5bx32,_0x2e5bxf){return function(_0x2e5bx10){if(!_0x2e5bx10){return};_0x2e5bx10= handleWsResponse(_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[37]]){logger[_0x7e0a[13]](_0x7e0a[117],getValueFromPropertyName(_0x2e5bx32,getEndUserSearchPropertyFromChannel(_0x2e5bxe,_0x2e5bxf)));var _0x2e5bx45=getEndUserSearchQueryFromChannel(_0x2e5bxe);_0x2e5bx13[_0x7e0a[91]]= {id:_0x2e5bx10[_0x7e0a[37]],name:_0x2e5bx10[_0x7e0a[80]][_0x2e5bx45][_0x7e0a[40]],module:_0x7e0a[86]}};return}}function callCreation(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11){return function(){var _0x2e5bx47= new Date();var _0x2e5bx48=[{name:_0x7e0a[62],value:createSubjectFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11)},{name:_0x7e0a[118],value:_0x2e5bx13[_0x7e0a[49]][_0x7e0a[37]]},{name:_0x7e0a[119],value:_0x2e5bx13[_0x7e0a[49]][_0x7e0a[37]]},{name:_0x7e0a[120],value:createDescriptionFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11)},{name:_0x7e0a[121],value:_0x2e5bx47[_0x7e0a[126]]()[_0x7e0a[125]](0,19)[_0x7e0a[124]](_0x7e0a[122],_0x7e0a[123])},{name:_0x7e0a[127],value:_0x7e0a[78]},{name:_0x7e0a[128],value:_0x7e0a[129]},{name:_0x7e0a[130],value:_0x2e5bx13[_0x7e0a[91]][_0x7e0a[37]]},{name:_0x7e0a[131],value:_0x2e5bx13[_0x7e0a[91]][_0x7e0a[132]]},{name:_0x7e0a[133],value:_0x2e5bx13[_0x7e0a[91]][_0x7e0a[62]]}];var _0x2e5bx49=createCustomFieldsFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11);if(_0x2e5bx49[_0x7e0a[79]]> 0){_[_0x7e0a[134]](_0x2e5bx49,function(_0x2e5bx4a){_0x2e5bx48[_0x7e0a[115]]({name:_0x2e5bx4a[_0x7e0a[37]],value:_0x2e5bx4a[_0x7e0a[40]]})})};var _0x2e5bx30={method:_0x7e0a[110],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[135],name_value_list:_0x2e5bx48})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})}}function createSubjectFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11){var _0x2e5bx4c=_0x7e0a[52];var _0x2e5bx4d=[];if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[136]][_0x7e0a[79]]> 0){var _0x2e5bx4e=_[_0x7e0a[137]](_0x2e5bx13[_0x7e0a[21]].Subject,[_0x7e0a[37]]);_[_0x7e0a[134]](_0x2e5bx4e,function(_0x2e5bx4f){if(_0x2e5bx4f[_0x7e0a[138]]=== _0x7e0a[139]){_0x2e5bx4d[_0x7e0a[115]](_0x2e5bx4f[_0x7e0a[140]])}else {if(_0x2e5bx4f[_0x7e0a[138]]=== _0x7e0a[141]&& _0x2e5bx4f[_0x7e0a[142]]){var _0x2e5bx50=getValueFromPropertyName(_0x2e5bx32,_0x2e5bx4f[_0x7e0a[142]],_0x2e5bx13);if(_0x2e5bx50){_0x2e5bx4d[_0x7e0a[115]](_0x2e5bx50.toString())}}else {if(_0x2e5bx4f[_0x7e0a[138]]=== _0x7e0a[143]&& _0x2e5bx4f[_0x7e0a[144]]&& _0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]){_0x2e5bx11[_0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]]&& _0x2e5bx4d[_0x7e0a[115]](_0x2e5bx11[_0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]].toString())}}}});_0x2e5bx4c= _0x2e5bx4d[_0x7e0a[145]](_0x7e0a[123])};return _0x2e5bx4c}function createDescriptionFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11){var _0x2e5bx52=_0x7e0a[52];var _0x2e5bx4d=[];if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[146]][_0x7e0a[79]]> 0){var _0x2e5bx53=_[_0x7e0a[137]](_0x2e5bx13[_0x7e0a[21]].Description,[_0x7e0a[37]]);_[_0x7e0a[134]](_0x2e5bx53,function(_0x2e5bx4f){if(_0x2e5bx4f[_0x7e0a[138]]=== _0x7e0a[139]){_0x2e5bx4d[_0x7e0a[115]](_0x2e5bx4f[_0x7e0a[140]])}else {if(_0x2e5bx4f[_0x7e0a[138]]=== _0x7e0a[147]){if(_0x2e5bx4f[_0x7e0a[148]]=== _0x7e0a[139]&& _0x2e5bx4f[_0x7e0a[149]]){_0x2e5bx4d[_0x7e0a[115]](util[_0x7e0a[45]](_0x7e0a[150],_0x2e5bx4f[_0x7e0a[149]],_0x2e5bx4f[_0x7e0a[151]]))}else {if(_0x2e5bx4f[_0x7e0a[148]]=== _0x7e0a[141]&& _0x2e5bx4f[_0x7e0a[142]]&& _0x2e5bx4f[_0x7e0a[149]]){var _0x2e5bx50=getValueFromPropertyName(_0x2e5bx32,_0x2e5bx4f[_0x7e0a[142]],_0x2e5bx13);if(_0x2e5bx50){_0x2e5bx4d[_0x7e0a[115]](util[_0x7e0a[45]](_0x7e0a[150],_0x2e5bx4f[_0x7e0a[149]],_0x2e5bx50.toString()))}}else {if(_0x2e5bx4f[_0x7e0a[148]]=== _0x7e0a[143]&& _0x2e5bx4f[_0x7e0a[144]]&& _0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]&& _0x2e5bx4f[_0x7e0a[149]]){_0x2e5bx11[_0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]]&& _0x2e5bx4d[_0x7e0a[115]](util[_0x7e0a[45]](_0x7e0a[150],_0x2e5bx4f[_0x7e0a[149]],_0x2e5bx11[_0x2e5bx4f[_0x7e0a[144]][_0x7e0a[62]]]))}}}}}});_0x2e5bx52= _0x2e5bx4d[_0x7e0a[145]](_0x7e0a[152])};return _0x2e5bx52}function createCustomFieldsFromConfiguration(_0x2e5bx13,_0x2e5bx32,_0x2e5bx11){var _0x2e5bx55=[];var _0x2e5bx56=[];if(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[153]][_0x7e0a[79]]> 0){_0x2e5bx55= _0x2e5bx13[_0x7e0a[21]][_0x7e0a[153]];_[_0x7e0a[134]](_0x2e5bx55,function(_0x2e5bx4a){if(_0x2e5bx4a[_0x7e0a[138]]=== _0x7e0a[139]&& _0x2e5bx4a[_0x7e0a[154]]){_0x2e5bx56[_0x7e0a[115]]({id:_0x2e5bx4a[_0x7e0a[154]],value:_0x2e5bx4a[_0x7e0a[140]]})}else {if(_0x2e5bx4a[_0x7e0a[138]]=== _0x7e0a[141]&& _0x2e5bx4a[_0x7e0a[142]]&& _0x2e5bx4a[_0x7e0a[154]]){var _0x2e5bx50=getValueFromPropertyName(_0x2e5bx32,_0x2e5bx4a[_0x7e0a[142]],_0x2e5bx13);if(_0x2e5bx50){_0x2e5bx56[_0x7e0a[115]]({id:_0x2e5bx4a[_0x7e0a[154]],value:_0x2e5bx50.toString()})}}else {if(_0x2e5bx4a[_0x7e0a[138]]=== _0x7e0a[143]&& _0x2e5bx4a[_0x7e0a[154]]&& _0x2e5bx4a[_0x7e0a[144]]&& _0x2e5bx4a[_0x7e0a[144]][_0x7e0a[62]]){_0x2e5bx11[_0x2e5bx4a[_0x7e0a[144]][_0x7e0a[62]]]&& _0x2e5bx56[_0x7e0a[115]]({id:_0x2e5bx4a[_0x7e0a[154]],value:_0x2e5bx11[_0x2e5bx4a[_0x7e0a[144]][_0x7e0a[62]]].toString()})}}}})};return _0x2e5bx56}function handleCallAgentAssociation(_0x2e5bx13){return function(_0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[37]]){_0x2e5bx13[_0x7e0a[155]]= {id:_0x2e5bx10[_0x7e0a[37]]};if(_0x2e5bx13[_0x7e0a[73]]<= 6){_0x2e5bx13[_0x7e0a[155]][_0x7e0a[156]]= util[_0x7e0a[45]](_0x7e0a[157],stripTrailingSlash(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[24]][_0x7e0a[26]]),_0x2e5bx10[_0x7e0a[37]])}else {_0x2e5bx13[_0x7e0a[155]][_0x7e0a[156]]= util[_0x7e0a[45]](_0x7e0a[158],stripTrailingSlash(_0x2e5bx13[_0x7e0a[21]][_0x7e0a[24]][_0x7e0a[26]]),_0x2e5bx10[_0x7e0a[37]])}};var _0x2e5bx30={method:_0x7e0a[159],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[135],module_id:_0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]],link_field_name:_0x7e0a[160],related_ids:[_0x2e5bx13[_0x7e0a[49]][_0x7e0a[37]]]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})}}function handleCallContactAssociation(_0x2e5bx13){return function(_0x2e5bx10){_0x2e5bx10= handleWsResponse(_0x2e5bx10);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx10[_0x7e0a[161]]>= 1){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[162],_0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]],_0x2e5bx13[_0x7e0a[49]][_0x7e0a[37]]))};var _0x2e5bx30={method:_0x7e0a[159],input_type:_0x7e0a[33],response_type:_0x7e0a[33],rest_data:JSON[_0x7e0a[34]]({session:_0x2e5bx13[_0x7e0a[38]],module_name:_0x7e0a[135],module_id:_0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]],link_field_name:_[_0x7e0a[101]](_0x2e5bx13[_0x7e0a[91]][_0x7e0a[132]]),related_ids:[_0x2e5bx13[_0x7e0a[91]][_0x7e0a[37]]]})};return rp({method:_0x7e0a[35],uri:_0x2e5bx13[_0x7e0a[25]],form:_0x2e5bx30})}}function handleReportIntegration(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxc,_0x2e5bx12,_0x2e5bxf){return function(_0x2e5bx5a){_0x2e5bx5a= handleWsResponse(_0x2e5bx5a);logger[_0x7e0a[36]](_0x2e5bx10);if(_0x2e5bx5a[_0x7e0a[161]]>= 1){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[163],_0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]],_0x2e5bx13[_0x7e0a[91]][_0x7e0a[37]]))};delete _0x2e5bx10[_0x7e0a[37]];delete _0x2e5bx10[_0x7e0a[164]];delete _0x2e5bx10[_0x7e0a[165]];_0x2e5bx10[_0x7e0a[166]]= _0x7e0a[167];_0x2e5bx10[_0x7e0a[168]]= _0x2e5bxe;_0x2e5bx10[_0x7e0a[169]]= _0x7e0a[170];_0x2e5bx10[_0x7e0a[171]]= _0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]];_0x2e5bx10[_0x7e0a[156]]= _0x2e5bx13[_0x7e0a[155]][_0x7e0a[156]];_0x2e5bx10[_0x7e0a[172]]= _0x2e5bxc;_0x2e5bx10[_0x7e0a[173]]= _0x2e5bxf;_0x2e5bx12[_0x7e0a[177]](util[_0x7e0a[45]](_0x7e0a[176],_0x2e5bx10[_0x7e0a[53]]))[_0x7e0a[175]](_0x7e0a[174],_0x2e5bx10);return ReportIntegration[_0x7e0a[178]](_0x2e5bx10)}}function handleEnd(_0x2e5bx13){return function(_0x2e5bx10){logger[_0x7e0a[13]](util[_0x7e0a[45]](_0x7e0a[179],_0x2e5bx13[_0x7e0a[155]][_0x7e0a[37]],_0x2e5bx13[_0x7e0a[49]][_0x7e0a[37]]));_0x2e5bx13= undefined;return}}function handleError(_0x2e5bx13,_0x2e5bxe,_0x2e5bx10,_0x2e5bxc){return function(_0x2e5bx5d){logger[_0x7e0a[17]](_0x7e0a[180]);logger[_0x7e0a[17]](_0x7e0a[181],_0x2e5bx5d[_0x7e0a[182]]);logger[_0x7e0a[17]](_0x7e0a[183],_0x2e5bx5d[_0x7e0a[184]]);_0x2e5bx13= undefined;delete _0x2e5bx10[_0x7e0a[37]];delete _0x2e5bx10[_0x7e0a[164]];delete _0x2e5bx10[_0x7e0a[165]];_0x2e5bx10[_0x7e0a[166]]= _0x7e0a[167];_0x2e5bx10[_0x7e0a[168]]= _0x2e5bxe;_0x2e5bx10[_0x7e0a[169]]= _0x7e0a[185];_0x2e5bx10[_0x7e0a[172]]= _0x2e5bxc;ReportIntegration[_0x7e0a[178]](_0x2e5bx10)[_0x7e0a[18]](function(_0x2e5bx5d){logger[_0x7e0a[17]](_0x7e0a[186]);return})}}function stripTrailingSlash(_0x2e5bx5f){if(_0x2e5bx5f[_0x7e0a[187]](-1) === _0x7e0a[188]){return _0x2e5bx5f[_0x7e0a[187]](0,_0x2e5bx5f[_0x7e0a[79]]- 1)};return _0x2e5bx5f}function handleWsResponse(_0x2e5bx10){return JSON[_0x7e0a[189]](_0x2e5bx10)}function getMatchObject(_0x2e5bx62,_0x2e5bx1f,_0x2e5bx63,_0x2e5bx64){var _0x2e5bx65=_[_0x7e0a[20]](_0x2e5bx62,function(_0x2e5bx66){return _0x2e5bx66[_0x7e0a[42]][_0x2e5bx1f][_0x2e5bx63]== _0x2e5bx64});if(_0x2e5bx65){return _0x2e5bx65};return _[_0x7e0a[190]](_0x2e5bx62)}module[_0x7e0a[191]]= Sugarcrm