abde1a22c532b3e9c3a88c507a85527729adf9d4
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0x3b37=["\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(_0x3b37[0]);var util=require(_0x3b37[1]);var rp=require(_0x3b37[2]);var request=require(_0x3b37[3]);var logger=require(_0x3b37[5])(_0x3b37[4]);var SugarcrmConfiguration=require(_0x3b37[7])[_0x3b37[6]];var ReportIntegration=require(_0x3b37[7])[_0x3b37[8]];var VoiceQueue=require(_0x3b37[7])[_0x3b37[9]];var VoiceExtension=require(_0x3b37[7])[_0x3b37[10]];var Agent=require(_0x3b37[7])[_0x3b37[11]];function Sugarcrm(){logger[_0x3b37[13]](_0x3b37[12])}Sugarcrm[_0x3b37[15]][_0x3b37[14]]= function(_0xcea6xc,_0xcea6xd,_0xcea6xe,_0xcea6xf,_0xcea6x10,_0xcea6x11,_0xcea6x12){var _0xcea6x13={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0xcea6xc||  !_0xcea6xd){logger[_0x3b37[17]](_0x3b37[16]);return};SugarcrmConfiguration[_0x3b37[20]]({where:{id:_0xcea6xd,AccountId:_0xcea6xc},include:[{all:true,include:[{all:true}]}]})[_0x3b37[19]](handleEntityNotFound())[_0x3b37[19]](handleConnection(_0xcea6x13))[_0x3b37[19]](handleLogin(_0xcea6x13))[_0x3b37[19]](searchMotionAgent(_0xcea6xe,_0xcea6x10))[_0x3b37[19]](handleMotionAgent(_0xcea6x13))[_0x3b37[19]](searchQueue(_0xcea6x10))[_0x3b37[19]](handleQueueRecordings(_0xcea6x13,_0xcea6x10))[_0x3b37[19]](searchRoute(_0xcea6x10))[_0x3b37[19]](handleOutboundRecordings(_0xcea6x13,_0xcea6x10))[_0x3b37[19]](getServerInfo(_0xcea6x13))[_0x3b37[19]](handleServerInfo(_0xcea6x13))[_0x3b37[19]](searchAgent(_0xcea6x13))[_0x3b37[19]](handleAgent(_0xcea6x13))[_0x3b37[19]](handleAdmin(_0xcea6x13))[_0x3b37[19]](searchEndUserWithDefaultMapping(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](handleEndUserWithDefaultMapping(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](searchEndUser(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](handleEndUser(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](endUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](handleEndUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf))[_0x3b37[19]](callCreation(_0xcea6x13,_0xcea6x10,_0xcea6x11))[_0x3b37[19]](handleCallAgentAssociation(_0xcea6x13))[_0x3b37[19]](handleCallContactAssociation(_0xcea6x13))[_0x3b37[19]](handleReportIntegration(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xc,_0xcea6x12,_0xcea6xf))[_0x3b37[19]](handleEnd(_0xcea6x13))[_0x3b37[18]](handleError(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xc))};function handleEntityNotFound(){return function(_0xcea6x15){if(!_0xcea6x15){return null};return _0xcea6x15}}function handleConnection(_0xcea6x13){return function(_0xcea6x17){_0xcea6x13[_0x3b37[21]]= _0xcea6x17;_0xcea6x13[_0x3b37[22]]= _0xcea6x17[_0x3b37[24]][_0x3b37[23]];_0xcea6x13[_0x3b37[25]]= stripTrailingSlash(_0xcea6x17[_0x3b37[24]][_0x3b37[26]])+ _0x3b37[27];var _0xcea6x18={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0xcea6x17[_0x3b37[24]][_0x3b37[28]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0xcea6x17[_0x3b37[24]][_0x3b37[29]],encryption:_0x3b37[30]},application:_0x3b37[31]};var _0xcea6x10={method:_0x3b37[32],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]](_0xcea6x18)};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x10})}}function handleLogin(_0xcea6x13){return function(_0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[37]]){_0xcea6x13[_0x3b37[38]]= _0xcea6x10[_0x3b37[37]];_0xcea6x13[_0x3b37[39]]= {id:_0xcea6x10[_0x3b37[42]][_0x3b37[41]][_0x3b37[40]],name:_0xcea6x10[_0x3b37[42]][_0x3b37[43]][_0x3b37[40]]};return};throw  new Error(util[_0x3b37[45]](_0x3b37[44],_0xcea6x13[_0x3b37[21]][_0x3b37[24]][_0x3b37[37]]))}}function searchMotionAgent(_0xcea6xe,_0xcea6x10){return function(){var _0xcea6x1b=getAgentSearchPropertyFromChannel(_0xcea6xe);if(_0xcea6x10[_0x3b37[46]](_0xcea6x1b)){return Agent[_0x3b37[50]](_0x3b37[49])[_0x3b37[48]]({where:{name:getValueFromPropertyName(_0xcea6x10,_0xcea6x1b)},attributes:[_0x3b37[47]]})};return}}function handleMotionAgent(_0xcea6x13){return function(_0xcea6x1d){if(_0xcea6x1d&& _0xcea6x1d[_0x3b37[47]]){_0xcea6x13[_0x3b37[51]]= _0xcea6x1d[_0x3b37[47]]};return}}function getAgentSearchPropertyFromChannel(_0xcea6xe){var _0xcea6x1f=_0x3b37[52];if(_0xcea6xe){switch(_0xcea6xe){case _0x3b37[54]:_0xcea6x1f= _0x3b37[53];break;default:_0xcea6x1f= _0x3b37[53];logger[_0x3b37[17]](_0x3b37[55],_0xcea6xe)}};return _0xcea6x1f}function getValueFromPropertyName(_0xcea6x10,_0xcea6x1f,_0xcea6x13){if(_0xcea6x1f=== _0x3b37[56]){if(_0xcea6x13&& _0xcea6x13[_0x3b37[57]]&& _0xcea6x13[_0x3b37[22]]){return util[_0x3b37[45]](_0x3b37[58],stripTrailingSlash(_0xcea6x13[_0x3b37[22]]),_0xcea6x10[_0x3b37[59]])}else {return null}}else {return _[_0x3b37[60]](_0xcea6x10,_0xcea6x1f)}}function searchQueue(_0xcea6x10){return function(){if(_0xcea6x10[_0x3b37[61]]){return VoiceQueue[_0x3b37[48]]({where:{name:_0xcea6x10[_0x3b37[61]]},attributes:[_0x3b37[62],_0x3b37[63]]})}else {return}}}function handleQueueRecordings(_0xcea6x13,_0xcea6x10){return function(_0xcea6x23){if(_0xcea6x10[_0x3b37[61]]){if(_0xcea6x23&& _0xcea6x23[_0x3b37[63]]){logger[_0x3b37[13]](_0x3b37[64],_0xcea6x23[_0x3b37[62]]);_0xcea6x13[_0x3b37[57]]= true}else {_0xcea6x13[_0x3b37[57]]= false;logger[_0x3b37[13]](_0x3b37[65])}};return}}function searchRoute(_0xcea6x10){return function(){if(_0xcea6x10[_0x3b37[66]]){return VoiceExtension[_0x3b37[48]]({where:{id:_0xcea6x10[_0x3b37[66]]},attributes:[_0x3b37[37],_0x3b37[67]]})}else {return}}}function handleOutboundRecordings(_0xcea6x13,_0xcea6x10){return function(_0xcea6x26){if(_0xcea6x10[_0x3b37[66]]){if(_0xcea6x26&& _0xcea6x26[_0x3b37[67]]){logger[_0x3b37[13]](_0x3b37[68],_0xcea6x26[_0x3b37[37]]);_0xcea6x13[_0x3b37[57]]= true}else {_0xcea6x13[_0x3b37[57]]= false;logger[_0x3b37[13]](_0x3b37[69])}};return}}function getServerInfo(_0xcea6x13){return function(){var _0xcea6x10={method:_0x3b37[70],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x10})}}function handleServerInfo(_0xcea6x13){return function(_0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);var _0xcea6x29=_0xcea6x10[_0x3b37[72]][_0x3b37[71]](0);if(_0xcea6x29){_0xcea6x13[_0x3b37[73]]= parseInt(_0xcea6x29)}else {_0xcea6x13[_0x3b37[73]]= 6};return}}function searchAgent(_0xcea6x13){return function(){if(_0xcea6x13[_0x3b37[51]]){logger[_0x3b37[13]](_0x3b37[74],_0xcea6x13[_0x3b37[51]]);var _0xcea6x10={method:_0x3b37[75],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[76],query:util[_0x3b37[45]](_0x3b37[77],_0xcea6x13[_0x3b37[51]]),order_by:_0x3b37[52],offset:_0x3b37[78],select_fields:[_0x3b37[37],_0x3b37[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x3b37[78]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x10})}};return}function handleAgent(_0xcea6x13){return function(_0xcea6x10){if(_0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[80]][_0x3b37[79]]> 0&& _0xcea6x10[_0x3b37[81]]> 0){logger[_0x3b37[13]](_0x3b37[82],_0xcea6x13[_0x3b37[51]]);var _0xcea6x2c=getMatchObject(_0xcea6x10[_0x3b37[80]],_0x3b37[62],_0x3b37[40],_0xcea6x13[_0x3b37[51]]);_0xcea6x13[_0x3b37[49]]= {id:_0xcea6x2c[_0x3b37[42]][_0x3b37[37]][_0x3b37[40]],name:_0xcea6x2c[_0x3b37[42]][_0x3b37[62]][_0x3b37[40]]};return _0xcea6x13[_0x3b37[49]]};return};return}}function handleAdmin(_0xcea6x13){return function(_0xcea6x10){if(_0xcea6x10){return};logger[_0x3b37[13]](_0x3b37[83]);_0xcea6x13[_0x3b37[49]]= _0xcea6x13[_0x3b37[39]];logger[_0x3b37[13]](_0x3b37[84]);return}}function getEndUserSearchModule(_0xcea6x13){return _0xcea6x13[_0x3b37[21]][_0x3b37[85]]?_0x3b37[86]:_0xcea6x13[_0x3b37[21]][_0x3b37[87]]}function searchEndUserWithDefaultMapping(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf){return function(){if(!_0xcea6x13[_0x3b37[21]][_0x3b37[85]]&& _0xcea6x13[_0x3b37[21]][_0x3b37[87]]){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[88],getEndUserSearchModule(_0xcea6x13),getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))));var _0xcea6x30={method:_0x3b37[75],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:getEndUserSearchModule(_0xcea6x13),query:getEndUserSearchQuery(_0xcea6x13,_0xcea6x10,_0xcea6xe,_0xcea6xf),order_by:_0x3b37[52],offset:_0x3b37[78],select_fields:[_0x3b37[37],_0x3b37[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x3b37[78]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})};logger[_0x3b37[36]](util[_0x3b37[45]](_0x3b37[89]));return}}function handleEndUserWithDefaultMapping(_0xcea6x13,_0xcea6xe,_0xcea6x32,_0xcea6xf){return function(_0xcea6x10){if(!_0xcea6x13[_0x3b37[21]][_0x3b37[85]]&& _0xcea6x13[_0x3b37[21]][_0x3b37[87]] && _0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[80]][_0x3b37[79]]> 0&& _0xcea6x10[_0x3b37[81]]> 0){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[90],getEndUserSearchModule(_0xcea6x13),getValueFromPropertyName(_0xcea6x32,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))));_0xcea6x13[_0x3b37[91]]= {id:_0xcea6x10[_0x3b37[80]][0][_0x3b37[42]][_0x3b37[37]][_0x3b37[40]],name:_0xcea6x10[_0x3b37[80]][0][_0x3b37[42]][_0x3b37[62]][_0x3b37[40]],module:getEndUserSearchModule(_0xcea6x13)}}else {logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[92],getEndUserSearchModule(_0xcea6x13),getValueFromPropertyName(_0xcea6x32,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))))}};return}}function searchEndUser(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf){return function(){if(_0xcea6x13[_0x3b37[21]][_0x3b37[85]]||  !_0xcea6x13[_0x3b37[21]][_0x3b37[87]]||  !_0xcea6x13[_0x3b37[91]]){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[93],getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))));var _0xcea6x30={method:_0x3b37[75],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[86],query:util[_0x3b37[45]](_0x3b37[94],getEndUserSearchQueryFromChannel(_0xcea6xe),getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))),order_by:_0x3b37[52],offset:_0x3b37[78],select_fields:[_0x3b37[37],_0x3b37[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0x3b37[78]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})};logger[_0x3b37[36]](util[_0x3b37[45]](_0x3b37[95]));return}}function getEndUserSearchQuery(_0xcea6x13,_0xcea6x10,_0xcea6xe,_0xcea6xf){var _0xcea6x35;var _0xcea6x36=_[_0x3b37[97]](_0xcea6x13[_0x3b37[21]][_0x3b37[96]]);if(_[_0x3b37[99]](_0xcea6x36,_0x3b37[98])){_0xcea6x35= util[_0x3b37[45]](_0x3b37[100],_[_0x3b37[101]](_0xcea6x13[_0x3b37[21]][_0x3b37[87]])+ _0x3b37[102],_0xcea6x36,getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))}else {_0xcea6x35= util[_0x3b37[45]](_0x3b37[100],_[_0x3b37[101]](_0xcea6x13[_0x3b37[21]][_0x3b37[87]]),_0xcea6x36,getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))};if(_0xcea6x13[_0x3b37[21]][_0x3b37[96]][_0x3b37[79]]> 1){for(var _0xcea6x37=1;_0xcea6x37< _0xcea6x13[_0x3b37[21]][_0x3b37[96]][_0x3b37[79]];_0xcea6x37++){var _0xcea6x38=_0xcea6x13[_0x3b37[21]][_0x3b37[96]][_0xcea6x37];if(_[_0x3b37[99]](_0xcea6x36,_0x3b37[98])){_0xcea6x35+= util[_0x3b37[45]](_0x3b37[103],_[_0x3b37[101]](_0xcea6x13[_0x3b37[21]][_0x3b37[87]])+ _0x3b37[102],_0xcea6x38,getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))}else {_0xcea6x35+= util[_0x3b37[45]](_0x3b37[103],_[_0x3b37[101]](_0xcea6x13[_0x3b37[21]][_0x3b37[87]]),_0xcea6x38,getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))}}};return _0xcea6x35}function getEndUserSearchQueryFromChannel(_0xcea6xe){var _0xcea6x1f=_0x3b37[52];if(_0xcea6xe){switch(_0xcea6xe){case _0x3b37[54]:_0xcea6x1f= _0x3b37[104];break;default:_0xcea6x1f= _0x3b37[104];logger[_0x3b37[17]](_0x3b37[55],_0xcea6xe)}};return _0xcea6x1f}function getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf){var _0xcea6x1f=_0x3b37[52];if(_0xcea6xe){switch(_0xcea6xe){case _0x3b37[54]:if(_0xcea6xf=== _0x3b37[105]){_0xcea6x1f= _0x3b37[106]}else {if(_0xcea6xf=== _0x3b37[61]){_0xcea6x1f= _0x3b37[107]}};break;default:_0xcea6x1f= _0x3b37[107];logger[_0x3b37[17]](_0x3b37[55],_0xcea6xe)}};return _0xcea6x1f}function handleEndUser(_0xcea6x13,_0xcea6xe,_0xcea6x32,_0xcea6xf){return function(_0xcea6x10){if(_0xcea6x13[_0x3b37[21]][_0x3b37[85]]||  !_0xcea6x13[_0x3b37[21]][_0x3b37[87]]||  !_0xcea6x13[_0x3b37[91]]){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[80]][_0x3b37[79]]> 0&& _0xcea6x10[_0x3b37[81]]> 0){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[108],getValueFromPropertyName(_0xcea6x32,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))));_0xcea6x13[_0x3b37[91]]= {id:_0xcea6x10[_0x3b37[80]][0][_0x3b37[42]][_0x3b37[37]][_0x3b37[40]],name:_0xcea6x10[_0x3b37[80]][0][_0x3b37[42]][_0x3b37[62]][_0x3b37[40]],module:_0x3b37[86]}}};return _0xcea6x13[_0x3b37[91]]}}function endUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x32,_0xcea6xf){return function(_0xcea6x10){if(_0xcea6x10){return};logger[_0x3b37[13]](_0x3b37[109],getValueFromPropertyName(_0xcea6x32,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)));var _0xcea6x30={method:_0x3b37[110],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[86],name_value_list:getArrayForEndUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x32,_0xcea6xf)})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})}}function getEndUserCreatePhone(_0xcea6x13){return _[_0x3b37[97]](_0xcea6x13[_0x3b37[21]][_0x3b37[96]])}function getArrayForEndUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xf){var _0xcea6x3f=[];switch(_0xcea6xe){case _0x3b37[54]:var _0xcea6x40={name:_0x3b37[111]};if(_0xcea6xf=== _0x3b37[61]){if(isValidName(_0xcea6x10[_0x3b37[112]])){_0xcea6x40[_0x3b37[40]]= getValueFromPropertyName(_0xcea6x10,getEndUserNamePropertyFromChannel(_0xcea6xe,_0xcea6xf))}else {_0xcea6x40[_0x3b37[40]]= util[_0x3b37[45]](_0x3b37[113],getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))}}else {if(_0xcea6xf=== _0x3b37[105]){if(isValidName(_0xcea6x10[_0x3b37[114]])){_0xcea6x40[_0x3b37[40]]= getValueFromPropertyName(_0xcea6x10,getEndUserNamePropertyFromChannel(_0xcea6xe,_0xcea6xf))}else {_0xcea6x40[_0x3b37[40]]= util[_0x3b37[45]](_0x3b37[113],getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)))}}};_0xcea6x3f[_0x3b37[115]](_0xcea6x40);_0xcea6x3f[_0x3b37[115]]({name:getEndUserSearchQueryFromChannel(_0xcea6xe),value:getValueFromPropertyName(_0xcea6x10,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf))});break;default:logger[_0x3b37[17]](_0x3b37[55],_0xcea6xe)};return _0xcea6x3f}function isValidName(_0xcea6x42){return _0xcea6x42&& _0xcea6x42!== _0x3b37[116]}function getEndUserNamePropertyFromChannel(_0xcea6xe,_0xcea6xf){var _0xcea6x1f=_0x3b37[52];if(_0xcea6xe){switch(_0xcea6xe){case _0x3b37[54]:if(_0xcea6xf=== _0x3b37[105]){_0xcea6x1f= _0x3b37[114]}else {if(_0xcea6xf=== _0x3b37[61]){_0xcea6x1f= _0x3b37[112]}};break;default:_0xcea6x1f= _0x3b37[112];logger[_0x3b37[17]](_0x3b37[55],_0xcea6xe)}};return _0xcea6x1f}function handleEndUserCreation(_0xcea6x13,_0xcea6xe,_0xcea6x32,_0xcea6xf){return function(_0xcea6x10){if(!_0xcea6x10){return};_0xcea6x10= handleWsResponse(_0xcea6x10);if(_0xcea6x10[_0x3b37[37]]){logger[_0x3b37[13]](_0x3b37[117],getValueFromPropertyName(_0xcea6x32,getEndUserSearchPropertyFromChannel(_0xcea6xe,_0xcea6xf)));var _0xcea6x45=getEndUserSearchQueryFromChannel(_0xcea6xe);_0xcea6x13[_0x3b37[91]]= {id:_0xcea6x10[_0x3b37[37]],name:_0xcea6x10[_0x3b37[80]][_0xcea6x45][_0x3b37[40]],module:_0x3b37[86]}};return}}function callCreation(_0xcea6x13,_0xcea6x32,_0xcea6x11){return function(){var _0xcea6x47= new Date();var _0xcea6x48=[{name:_0x3b37[62],value:createSubjectFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11)},{name:_0x3b37[118],value:_0xcea6x13[_0x3b37[49]][_0x3b37[37]]},{name:_0x3b37[119],value:_0xcea6x13[_0x3b37[49]][_0x3b37[37]]},{name:_0x3b37[120],value:createDescriptionFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11)},{name:_0x3b37[121],value:_0xcea6x47[_0x3b37[126]]()[_0x3b37[125]](0,19)[_0x3b37[124]](_0x3b37[122],_0x3b37[123])},{name:_0x3b37[127],value:_0x3b37[78]},{name:_0x3b37[128],value:_0x3b37[129]},{name:_0x3b37[130],value:_0xcea6x13[_0x3b37[91]][_0x3b37[37]]},{name:_0x3b37[131],value:_0xcea6x13[_0x3b37[91]][_0x3b37[132]]},{name:_0x3b37[133],value:_0xcea6x13[_0x3b37[91]][_0x3b37[62]]}];var _0xcea6x49=createCustomFieldsFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11);if(_0xcea6x49[_0x3b37[79]]> 0){_[_0x3b37[134]](_0xcea6x49,function(_0xcea6x4a){_0xcea6x48[_0x3b37[115]]({name:_0xcea6x4a[_0x3b37[37]],value:_0xcea6x4a[_0x3b37[40]]})})};var _0xcea6x30={method:_0x3b37[110],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[135],name_value_list:_0xcea6x48})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})}}function createSubjectFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11){var _0xcea6x4c=_0x3b37[52];var _0xcea6x4d=[];if(_0xcea6x13[_0x3b37[21]][_0x3b37[136]][_0x3b37[79]]> 0){var _0xcea6x4e=_[_0x3b37[137]](_0xcea6x13[_0x3b37[21]].Subject,[_0x3b37[37]]);_[_0x3b37[134]](_0xcea6x4e,function(_0xcea6x4f){if(_0xcea6x4f[_0x3b37[138]]=== _0x3b37[139]){_0xcea6x4d[_0x3b37[115]](_0xcea6x4f[_0x3b37[140]])}else {if(_0xcea6x4f[_0x3b37[138]]=== _0x3b37[141]&& _0xcea6x4f[_0x3b37[142]]){var _0xcea6x50=getValueFromPropertyName(_0xcea6x32,_0xcea6x4f[_0x3b37[142]],_0xcea6x13);if(_0xcea6x50){_0xcea6x4d[_0x3b37[115]](_0xcea6x50.toString())}}else {if(_0xcea6x4f[_0x3b37[138]]=== _0x3b37[143]&& _0xcea6x4f[_0x3b37[144]]&& _0xcea6x4f[_0x3b37[144]][_0x3b37[62]]){_0xcea6x11[_0xcea6x4f[_0x3b37[144]][_0x3b37[62]]]&& _0xcea6x4d[_0x3b37[115]](_0xcea6x11[_0xcea6x4f[_0x3b37[144]][_0x3b37[62]]].toString())}}}});_0xcea6x4c= _0xcea6x4d[_0x3b37[145]](_0x3b37[123])};return _0xcea6x4c}function createDescriptionFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11){var _0xcea6x52=_0x3b37[52];var _0xcea6x4d=[];if(_0xcea6x13[_0x3b37[21]][_0x3b37[146]][_0x3b37[79]]> 0){var _0xcea6x53=_[_0x3b37[137]](_0xcea6x13[_0x3b37[21]].Description,[_0x3b37[37]]);_[_0x3b37[134]](_0xcea6x53,function(_0xcea6x4f){if(_0xcea6x4f[_0x3b37[138]]=== _0x3b37[139]){_0xcea6x4d[_0x3b37[115]](_0xcea6x4f[_0x3b37[140]])}else {if(_0xcea6x4f[_0x3b37[138]]=== _0x3b37[147]){if(_0xcea6x4f[_0x3b37[148]]=== _0x3b37[139]&& _0xcea6x4f[_0x3b37[149]]){_0xcea6x4d[_0x3b37[115]](util[_0x3b37[45]](_0x3b37[150],_0xcea6x4f[_0x3b37[149]],_0xcea6x4f[_0x3b37[151]]))}else {if(_0xcea6x4f[_0x3b37[148]]=== _0x3b37[141]&& _0xcea6x4f[_0x3b37[142]]&& _0xcea6x4f[_0x3b37[149]]){var _0xcea6x50=getValueFromPropertyName(_0xcea6x32,_0xcea6x4f[_0x3b37[142]],_0xcea6x13);if(_0xcea6x50){_0xcea6x4d[_0x3b37[115]](util[_0x3b37[45]](_0x3b37[150],_0xcea6x4f[_0x3b37[149]],_0xcea6x50.toString()))}}else {if(_0xcea6x4f[_0x3b37[148]]=== _0x3b37[143]&& _0xcea6x4f[_0x3b37[144]]&& _0xcea6x4f[_0x3b37[144]][_0x3b37[62]]&& _0xcea6x4f[_0x3b37[149]]){_0xcea6x11[_0xcea6x4f[_0x3b37[144]][_0x3b37[62]]]&& _0xcea6x4d[_0x3b37[115]](util[_0x3b37[45]](_0x3b37[150],_0xcea6x4f[_0x3b37[149]],_0xcea6x11[_0xcea6x4f[_0x3b37[144]][_0x3b37[62]]]))}}}}}});_0xcea6x52= _0xcea6x4d[_0x3b37[145]](_0x3b37[152])};return _0xcea6x52}function createCustomFieldsFromConfiguration(_0xcea6x13,_0xcea6x32,_0xcea6x11){var _0xcea6x55=[];var _0xcea6x56=[];if(_0xcea6x13[_0x3b37[21]][_0x3b37[153]][_0x3b37[79]]> 0){_0xcea6x55= _0xcea6x13[_0x3b37[21]][_0x3b37[153]];_[_0x3b37[134]](_0xcea6x55,function(_0xcea6x4a){if(_0xcea6x4a[_0x3b37[138]]=== _0x3b37[139]&& _0xcea6x4a[_0x3b37[154]]){_0xcea6x56[_0x3b37[115]]({id:_0xcea6x4a[_0x3b37[154]],value:_0xcea6x4a[_0x3b37[140]]})}else {if(_0xcea6x4a[_0x3b37[138]]=== _0x3b37[141]&& _0xcea6x4a[_0x3b37[142]]&& _0xcea6x4a[_0x3b37[154]]){var _0xcea6x50=getValueFromPropertyName(_0xcea6x32,_0xcea6x4a[_0x3b37[142]],_0xcea6x13);if(_0xcea6x50){_0xcea6x56[_0x3b37[115]]({id:_0xcea6x4a[_0x3b37[154]],value:_0xcea6x50.toString()})}}else {if(_0xcea6x4a[_0x3b37[138]]=== _0x3b37[143]&& _0xcea6x4a[_0x3b37[154]]&& _0xcea6x4a[_0x3b37[144]]&& _0xcea6x4a[_0x3b37[144]][_0x3b37[62]]){_0xcea6x11[_0xcea6x4a[_0x3b37[144]][_0x3b37[62]]]&& _0xcea6x56[_0x3b37[115]]({id:_0xcea6x4a[_0x3b37[154]],value:_0xcea6x11[_0xcea6x4a[_0x3b37[144]][_0x3b37[62]]].toString()})}}}})};return _0xcea6x56}function handleCallAgentAssociation(_0xcea6x13){return function(_0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[37]]){_0xcea6x13[_0x3b37[155]]= {id:_0xcea6x10[_0x3b37[37]]};if(_0xcea6x13[_0x3b37[73]]<= 6){_0xcea6x13[_0x3b37[155]][_0x3b37[156]]= util[_0x3b37[45]](_0x3b37[157],stripTrailingSlash(_0xcea6x13[_0x3b37[21]][_0x3b37[24]][_0x3b37[26]]),_0xcea6x10[_0x3b37[37]])}else {_0xcea6x13[_0x3b37[155]][_0x3b37[156]]= util[_0x3b37[45]](_0x3b37[158],stripTrailingSlash(_0xcea6x13[_0x3b37[21]][_0x3b37[24]][_0x3b37[26]]),_0xcea6x10[_0x3b37[37]])}};var _0xcea6x30={method:_0x3b37[159],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[135],module_id:_0xcea6x13[_0x3b37[155]][_0x3b37[37]],link_field_name:_0x3b37[160],related_ids:[_0xcea6x13[_0x3b37[49]][_0x3b37[37]]]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})}}function handleCallContactAssociation(_0xcea6x13){return function(_0xcea6x10){_0xcea6x10= handleWsResponse(_0xcea6x10);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x10[_0x3b37[161]]>= 1){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[162],_0xcea6x13[_0x3b37[155]][_0x3b37[37]],_0xcea6x13[_0x3b37[49]][_0x3b37[37]]))};var _0xcea6x30={method:_0x3b37[159],input_type:_0x3b37[33],response_type:_0x3b37[33],rest_data:JSON[_0x3b37[34]]({session:_0xcea6x13[_0x3b37[38]],module_name:_0x3b37[135],module_id:_0xcea6x13[_0x3b37[155]][_0x3b37[37]],link_field_name:_[_0x3b37[101]](_0xcea6x13[_0x3b37[91]][_0x3b37[132]]),related_ids:[_0xcea6x13[_0x3b37[91]][_0x3b37[37]]]})};return rp({method:_0x3b37[35],uri:_0xcea6x13[_0x3b37[25]],form:_0xcea6x30})}}function handleReportIntegration(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xc,_0xcea6x12,_0xcea6xf){return function(_0xcea6x5a){_0xcea6x5a= handleWsResponse(_0xcea6x5a);logger[_0x3b37[36]](_0xcea6x10);if(_0xcea6x5a[_0x3b37[161]]>= 1){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[163],_0xcea6x13[_0x3b37[155]][_0x3b37[37]],_0xcea6x13[_0x3b37[91]][_0x3b37[37]]))};delete _0xcea6x10[_0x3b37[37]];delete _0xcea6x10[_0x3b37[164]];delete _0xcea6x10[_0x3b37[165]];_0xcea6x10[_0x3b37[166]]= _0x3b37[167];_0xcea6x10[_0x3b37[168]]= _0xcea6xe;_0xcea6x10[_0x3b37[169]]= _0x3b37[170];_0xcea6x10[_0x3b37[171]]= _0xcea6x13[_0x3b37[155]][_0x3b37[37]];_0xcea6x10[_0x3b37[156]]= _0xcea6x13[_0x3b37[155]][_0x3b37[156]];_0xcea6x10[_0x3b37[172]]= _0xcea6xc;_0xcea6x10[_0x3b37[173]]= _0xcea6xf;_0xcea6x12[_0x3b37[177]](util[_0x3b37[45]](_0x3b37[176],_0xcea6x10[_0x3b37[53]]))[_0x3b37[175]](_0x3b37[174],_0xcea6x10);return ReportIntegration[_0x3b37[178]](_0xcea6x10)}}function handleEnd(_0xcea6x13){return function(_0xcea6x10){logger[_0x3b37[13]](util[_0x3b37[45]](_0x3b37[179],_0xcea6x13[_0x3b37[155]][_0x3b37[37]],_0xcea6x13[_0x3b37[49]][_0x3b37[37]]));_0xcea6x13= undefined;return}}function handleError(_0xcea6x13,_0xcea6xe,_0xcea6x10,_0xcea6xc){return function(_0xcea6x5d){logger[_0x3b37[17]](_0x3b37[180]);logger[_0x3b37[17]](_0x3b37[181],_0xcea6x5d[_0x3b37[182]]);logger[_0x3b37[17]](_0x3b37[183],_0xcea6x5d[_0x3b37[184]]);_0xcea6x13= undefined;delete _0xcea6x10[_0x3b37[37]];delete _0xcea6x10[_0x3b37[164]];delete _0xcea6x10[_0x3b37[165]];_0xcea6x10[_0x3b37[166]]= _0x3b37[167];_0xcea6x10[_0x3b37[168]]= _0xcea6xe;_0xcea6x10[_0x3b37[169]]= _0x3b37[185];_0xcea6x10[_0x3b37[172]]= _0xcea6xc;ReportIntegration[_0x3b37[178]](_0xcea6x10)[_0x3b37[18]](function(_0xcea6x5d){logger[_0x3b37[17]](_0x3b37[186]);return})}}function stripTrailingSlash(_0xcea6x5f){if(_0xcea6x5f[_0x3b37[187]](-1) === _0x3b37[188]){return _0xcea6x5f[_0x3b37[187]](0,_0xcea6x5f[_0x3b37[79]]- 1)};return _0xcea6x5f}function handleWsResponse(_0xcea6x10){return JSON[_0x3b37[189]](_0xcea6x10)}function getMatchObject(_0xcea6x62,_0xcea6x1f,_0xcea6x63,_0xcea6x64){var _0xcea6x65=_[_0x3b37[20]](_0xcea6x62,function(_0xcea6x66){return _0xcea6x66[_0x3b37[42]][_0xcea6x1f][_0xcea6x63]== _0xcea6x64});if(_0xcea6x65){return _0xcea6x65};return _[_0x3b37[190]](_0xcea6x62)}module[_0x3b37[191]]= Sugarcrm