Built motion from commit a32a54f66.|1.0.25
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0xed09=["\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(_0xed09[0]);var util=require(_0xed09[1]);var rp=require(_0xed09[2]);var request=require(_0xed09[3]);var logger=require(_0xed09[5])(_0xed09[4]);var SugarcrmConfiguration=require(_0xed09[7])[_0xed09[6]];var ReportIntegration=require(_0xed09[7])[_0xed09[8]];var VoiceQueue=require(_0xed09[7])[_0xed09[9]];var VoiceExtension=require(_0xed09[7])[_0xed09[10]];var Agent=require(_0xed09[7])[_0xed09[11]];function Sugarcrm(){logger[_0xed09[13]](_0xed09[12])}Sugarcrm[_0xed09[15]][_0xed09[14]]= function(_0xe4c8xc,_0xe4c8xd,_0xe4c8xe,_0xe4c8xf,_0xe4c8x10,_0xe4c8x11,_0xe4c8x12){var _0xe4c8x13={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0xe4c8xc||  !_0xe4c8xd){logger[_0xed09[17]](_0xed09[16]);return};SugarcrmConfiguration[_0xed09[20]]({where:{id:_0xe4c8xd,AccountId:_0xe4c8xc},include:[{all:true,include:[{all:true}]}]})[_0xed09[19]](handleEntityNotFound())[_0xed09[19]](handleConnection(_0xe4c8x13))[_0xed09[19]](handleLogin(_0xe4c8x13))[_0xed09[19]](searchMotionAgent(_0xe4c8xe,_0xe4c8x10))[_0xed09[19]](handleMotionAgent(_0xe4c8x13))[_0xed09[19]](searchQueue(_0xe4c8x10))[_0xed09[19]](handleQueueRecordings(_0xe4c8x13,_0xe4c8x10))[_0xed09[19]](searchRoute(_0xe4c8x10))[_0xed09[19]](handleOutboundRecordings(_0xe4c8x13,_0xe4c8x10))[_0xed09[19]](getServerInfo(_0xe4c8x13))[_0xed09[19]](handleServerInfo(_0xe4c8x13))[_0xed09[19]](searchAgent(_0xe4c8x13))[_0xed09[19]](handleAgent(_0xe4c8x13))[_0xed09[19]](handleAdmin(_0xe4c8x13))[_0xed09[19]](searchEndUserWithDefaultMapping(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](handleEndUserWithDefaultMapping(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](searchEndUser(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](handleEndUser(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](endUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](handleEndUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf))[_0xed09[19]](callCreation(_0xe4c8x13,_0xe4c8x10,_0xe4c8x11))[_0xed09[19]](handleCallAgentAssociation(_0xe4c8x13))[_0xed09[19]](handleCallContactAssociation(_0xe4c8x13))[_0xed09[19]](handleReportIntegration(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xc,_0xe4c8x12,_0xe4c8xf))[_0xed09[19]](handleEnd(_0xe4c8x13))[_0xed09[18]](handleError(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xc))};function handleEntityNotFound(){return function(_0xe4c8x15){if(!_0xe4c8x15){return null};return _0xe4c8x15}}function handleConnection(_0xe4c8x13){return function(_0xe4c8x17){_0xe4c8x13[_0xed09[21]]= _0xe4c8x17;_0xe4c8x13[_0xed09[22]]= _0xe4c8x17[_0xed09[24]][_0xed09[23]];_0xe4c8x13[_0xed09[25]]= stripTrailingSlash(_0xe4c8x17[_0xed09[24]][_0xed09[26]])+ _0xed09[27];var _0xe4c8x18={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0xe4c8x17[_0xed09[24]][_0xed09[28]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0xe4c8x17[_0xed09[24]][_0xed09[29]],encryption:_0xed09[30]},application:_0xed09[31]};var _0xe4c8x10={method:_0xed09[32],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]](_0xe4c8x18)};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x10})}}function handleLogin(_0xe4c8x13){return function(_0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[37]]){_0xe4c8x13[_0xed09[38]]= _0xe4c8x10[_0xed09[37]];_0xe4c8x13[_0xed09[39]]= {id:_0xe4c8x10[_0xed09[42]][_0xed09[41]][_0xed09[40]],name:_0xe4c8x10[_0xed09[42]][_0xed09[43]][_0xed09[40]]};return};throw  new Error(util[_0xed09[45]](_0xed09[44],_0xe4c8x13[_0xed09[21]][_0xed09[24]][_0xed09[37]]))}}function searchMotionAgent(_0xe4c8xe,_0xe4c8x10){return function(){var _0xe4c8x1b=getAgentSearchPropertyFromChannel(_0xe4c8xe);if(_0xe4c8x10[_0xed09[46]](_0xe4c8x1b)){return Agent[_0xed09[50]](_0xed09[49])[_0xed09[48]]({where:{name:getValueFromPropertyName(_0xe4c8x10,_0xe4c8x1b)},attributes:[_0xed09[47]]})};return}}function handleMotionAgent(_0xe4c8x13){return function(_0xe4c8x1d){if(_0xe4c8x1d&& _0xe4c8x1d[_0xed09[47]]){_0xe4c8x13[_0xed09[51]]= _0xe4c8x1d[_0xed09[47]]};return}}function getAgentSearchPropertyFromChannel(_0xe4c8xe){var _0xe4c8x1f=_0xed09[52];if(_0xe4c8xe){switch(_0xe4c8xe){case _0xed09[54]:_0xe4c8x1f= _0xed09[53];break;default:_0xe4c8x1f= _0xed09[53];logger[_0xed09[17]](_0xed09[55],_0xe4c8xe)}};return _0xe4c8x1f}function getValueFromPropertyName(_0xe4c8x10,_0xe4c8x1f,_0xe4c8x13){if(_0xe4c8x1f=== _0xed09[56]){if(_0xe4c8x13&& _0xe4c8x13[_0xed09[57]]&& _0xe4c8x13[_0xed09[22]]){return util[_0xed09[45]](_0xed09[58],stripTrailingSlash(_0xe4c8x13[_0xed09[22]]),_0xe4c8x10[_0xed09[59]])}else {return null}}else {return _[_0xed09[60]](_0xe4c8x10,_0xe4c8x1f)}}function searchQueue(_0xe4c8x10){return function(){if(_0xe4c8x10[_0xed09[61]]){return VoiceQueue[_0xed09[48]]({where:{name:_0xe4c8x10[_0xed09[61]]},attributes:[_0xed09[62],_0xed09[63]]})}else {return}}}function handleQueueRecordings(_0xe4c8x13,_0xe4c8x10){return function(_0xe4c8x23){if(_0xe4c8x10[_0xed09[61]]){if(_0xe4c8x23&& _0xe4c8x23[_0xed09[63]]){logger[_0xed09[13]](_0xed09[64],_0xe4c8x23[_0xed09[62]]);_0xe4c8x13[_0xed09[57]]= true}else {_0xe4c8x13[_0xed09[57]]= false;logger[_0xed09[13]](_0xed09[65])}};return}}function searchRoute(_0xe4c8x10){return function(){if(_0xe4c8x10[_0xed09[66]]){return VoiceExtension[_0xed09[48]]({where:{id:_0xe4c8x10[_0xed09[66]]},attributes:[_0xed09[37],_0xed09[67]]})}else {return}}}function handleOutboundRecordings(_0xe4c8x13,_0xe4c8x10){return function(_0xe4c8x26){if(_0xe4c8x10[_0xed09[66]]){if(_0xe4c8x26&& _0xe4c8x26[_0xed09[67]]){logger[_0xed09[13]](_0xed09[68],_0xe4c8x26[_0xed09[37]]);_0xe4c8x13[_0xed09[57]]= true}else {_0xe4c8x13[_0xed09[57]]= false;logger[_0xed09[13]](_0xed09[69])}};return}}function getServerInfo(_0xe4c8x13){return function(){var _0xe4c8x10={method:_0xed09[70],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x10})}}function handleServerInfo(_0xe4c8x13){return function(_0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);var _0xe4c8x29=_0xe4c8x10[_0xed09[72]][_0xed09[71]](0);if(_0xe4c8x29){_0xe4c8x13[_0xed09[73]]= parseInt(_0xe4c8x29)}else {_0xe4c8x13[_0xed09[73]]= 6};return}}function searchAgent(_0xe4c8x13){return function(){if(_0xe4c8x13[_0xed09[51]]){logger[_0xed09[13]](_0xed09[74],_0xe4c8x13[_0xed09[51]]);var _0xe4c8x10={method:_0xed09[75],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[76],query:util[_0xed09[45]](_0xed09[77],_0xe4c8x13[_0xed09[51]]),order_by:_0xed09[52],offset:_0xed09[78],select_fields:[_0xed09[37],_0xed09[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xed09[78]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x10})}};return}function handleAgent(_0xe4c8x13){return function(_0xe4c8x10){if(_0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[80]][_0xed09[79]]> 0&& _0xe4c8x10[_0xed09[81]]> 0){logger[_0xed09[13]](_0xed09[82],_0xe4c8x13[_0xed09[51]]);var _0xe4c8x2c=getMatchObject(_0xe4c8x10[_0xed09[80]],_0xed09[62],_0xed09[40],_0xe4c8x13[_0xed09[51]]);_0xe4c8x13[_0xed09[49]]= {id:_0xe4c8x2c[_0xed09[42]][_0xed09[37]][_0xed09[40]],name:_0xe4c8x2c[_0xed09[42]][_0xed09[62]][_0xed09[40]]};return _0xe4c8x13[_0xed09[49]]};return};return}}function handleAdmin(_0xe4c8x13){return function(_0xe4c8x10){if(_0xe4c8x10){return};logger[_0xed09[13]](_0xed09[83]);_0xe4c8x13[_0xed09[49]]= _0xe4c8x13[_0xed09[39]];logger[_0xed09[13]](_0xed09[84]);return}}function getEndUserSearchModule(_0xe4c8x13){return _0xe4c8x13[_0xed09[21]][_0xed09[85]]?_0xed09[86]:_0xe4c8x13[_0xed09[21]][_0xed09[87]]}function searchEndUserWithDefaultMapping(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf){return function(){if(!_0xe4c8x13[_0xed09[21]][_0xed09[85]]&& _0xe4c8x13[_0xed09[21]][_0xed09[87]]){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[88],getEndUserSearchModule(_0xe4c8x13),getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))));var _0xe4c8x30={method:_0xed09[75],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:getEndUserSearchModule(_0xe4c8x13),query:getEndUserSearchQuery(_0xe4c8x13,_0xe4c8x10,_0xe4c8xe,_0xe4c8xf),order_by:_0xed09[52],offset:_0xed09[78],select_fields:[_0xed09[37],_0xed09[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xed09[78]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})};logger[_0xed09[36]](util[_0xed09[45]](_0xed09[89]));return}}function handleEndUserWithDefaultMapping(_0xe4c8x13,_0xe4c8xe,_0xe4c8x32,_0xe4c8xf){return function(_0xe4c8x10){if(!_0xe4c8x13[_0xed09[21]][_0xed09[85]]&& _0xe4c8x13[_0xed09[21]][_0xed09[87]] && _0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[80]][_0xed09[79]]> 0&& _0xe4c8x10[_0xed09[81]]> 0){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[90],getEndUserSearchModule(_0xe4c8x13),getValueFromPropertyName(_0xe4c8x32,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))));_0xe4c8x13[_0xed09[91]]= {id:_0xe4c8x10[_0xed09[80]][0][_0xed09[42]][_0xed09[37]][_0xed09[40]],name:_0xe4c8x10[_0xed09[80]][0][_0xed09[42]][_0xed09[62]][_0xed09[40]],module:getEndUserSearchModule(_0xe4c8x13)}}else {logger[_0xed09[13]](util[_0xed09[45]](_0xed09[92],getEndUserSearchModule(_0xe4c8x13),getValueFromPropertyName(_0xe4c8x32,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))))}};return}}function searchEndUser(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf){return function(){if(_0xe4c8x13[_0xed09[21]][_0xed09[85]]||  !_0xe4c8x13[_0xed09[21]][_0xed09[87]]||  !_0xe4c8x13[_0xed09[91]]){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[93],getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))));var _0xe4c8x30={method:_0xed09[75],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[86],query:util[_0xed09[45]](_0xed09[94],getEndUserSearchQueryFromChannel(_0xe4c8xe),getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))),order_by:_0xed09[52],offset:_0xed09[78],select_fields:[_0xed09[37],_0xed09[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xed09[78]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})};logger[_0xed09[36]](util[_0xed09[45]](_0xed09[95]));return}}function getEndUserSearchQuery(_0xe4c8x13,_0xe4c8x10,_0xe4c8xe,_0xe4c8xf){var _0xe4c8x35;var _0xe4c8x36=_[_0xed09[97]](_0xe4c8x13[_0xed09[21]][_0xed09[96]]);if(_[_0xed09[99]](_0xe4c8x36,_0xed09[98])){_0xe4c8x35= util[_0xed09[45]](_0xed09[100],_[_0xed09[101]](_0xe4c8x13[_0xed09[21]][_0xed09[87]])+ _0xed09[102],_0xe4c8x36,getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))}else {_0xe4c8x35= util[_0xed09[45]](_0xed09[100],_[_0xed09[101]](_0xe4c8x13[_0xed09[21]][_0xed09[87]]),_0xe4c8x36,getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))};if(_0xe4c8x13[_0xed09[21]][_0xed09[96]][_0xed09[79]]> 1){for(var _0xe4c8x37=1;_0xe4c8x37< _0xe4c8x13[_0xed09[21]][_0xed09[96]][_0xed09[79]];_0xe4c8x37++){var _0xe4c8x38=_0xe4c8x13[_0xed09[21]][_0xed09[96]][_0xe4c8x37];if(_[_0xed09[99]](_0xe4c8x36,_0xed09[98])){_0xe4c8x35+= util[_0xed09[45]](_0xed09[103],_[_0xed09[101]](_0xe4c8x13[_0xed09[21]][_0xed09[87]])+ _0xed09[102],_0xe4c8x38,getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))}else {_0xe4c8x35+= util[_0xed09[45]](_0xed09[103],_[_0xed09[101]](_0xe4c8x13[_0xed09[21]][_0xed09[87]]),_0xe4c8x38,getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))}}};return _0xe4c8x35}function getEndUserSearchQueryFromChannel(_0xe4c8xe){var _0xe4c8x1f=_0xed09[52];if(_0xe4c8xe){switch(_0xe4c8xe){case _0xed09[54]:_0xe4c8x1f= _0xed09[104];break;default:_0xe4c8x1f= _0xed09[104];logger[_0xed09[17]](_0xed09[55],_0xe4c8xe)}};return _0xe4c8x1f}function getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf){var _0xe4c8x1f=_0xed09[52];if(_0xe4c8xe){switch(_0xe4c8xe){case _0xed09[54]:if(_0xe4c8xf=== _0xed09[105]){_0xe4c8x1f= _0xed09[106]}else {if(_0xe4c8xf=== _0xed09[61]){_0xe4c8x1f= _0xed09[107]}};break;default:_0xe4c8x1f= _0xed09[107];logger[_0xed09[17]](_0xed09[55],_0xe4c8xe)}};return _0xe4c8x1f}function handleEndUser(_0xe4c8x13,_0xe4c8xe,_0xe4c8x32,_0xe4c8xf){return function(_0xe4c8x10){if(_0xe4c8x13[_0xed09[21]][_0xed09[85]]||  !_0xe4c8x13[_0xed09[21]][_0xed09[87]]||  !_0xe4c8x13[_0xed09[91]]){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[80]][_0xed09[79]]> 0&& _0xe4c8x10[_0xed09[81]]> 0){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[108],getValueFromPropertyName(_0xe4c8x32,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))));_0xe4c8x13[_0xed09[91]]= {id:_0xe4c8x10[_0xed09[80]][0][_0xed09[42]][_0xed09[37]][_0xed09[40]],name:_0xe4c8x10[_0xed09[80]][0][_0xed09[42]][_0xed09[62]][_0xed09[40]],module:_0xed09[86]}}};return _0xe4c8x13[_0xed09[91]]}}function endUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x32,_0xe4c8xf){return function(_0xe4c8x10){if(_0xe4c8x10){return};logger[_0xed09[13]](_0xed09[109],getValueFromPropertyName(_0xe4c8x32,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)));var _0xe4c8x30={method:_0xed09[110],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[86],name_value_list:getArrayForEndUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x32,_0xe4c8xf)})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})}}function getEndUserCreatePhone(_0xe4c8x13){return _[_0xed09[97]](_0xe4c8x13[_0xed09[21]][_0xed09[96]])}function getArrayForEndUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xf){var _0xe4c8x3f=[];switch(_0xe4c8xe){case _0xed09[54]:var _0xe4c8x40={name:_0xed09[111]};if(_0xe4c8xf=== _0xed09[61]){if(isValidName(_0xe4c8x10[_0xed09[112]])){_0xe4c8x40[_0xed09[40]]= getValueFromPropertyName(_0xe4c8x10,getEndUserNamePropertyFromChannel(_0xe4c8xe,_0xe4c8xf))}else {_0xe4c8x40[_0xed09[40]]= util[_0xed09[45]](_0xed09[113],getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))}}else {if(_0xe4c8xf=== _0xed09[105]){if(isValidName(_0xe4c8x10[_0xed09[114]])){_0xe4c8x40[_0xed09[40]]= getValueFromPropertyName(_0xe4c8x10,getEndUserNamePropertyFromChannel(_0xe4c8xe,_0xe4c8xf))}else {_0xe4c8x40[_0xed09[40]]= util[_0xed09[45]](_0xed09[113],getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)))}}};_0xe4c8x3f[_0xed09[115]](_0xe4c8x40);_0xe4c8x3f[_0xed09[115]]({name:getEndUserSearchQueryFromChannel(_0xe4c8xe),value:getValueFromPropertyName(_0xe4c8x10,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf))});break;default:logger[_0xed09[17]](_0xed09[55],_0xe4c8xe)};return _0xe4c8x3f}function isValidName(_0xe4c8x42){return _0xe4c8x42&& _0xe4c8x42!== _0xed09[116]}function getEndUserNamePropertyFromChannel(_0xe4c8xe,_0xe4c8xf){var _0xe4c8x1f=_0xed09[52];if(_0xe4c8xe){switch(_0xe4c8xe){case _0xed09[54]:if(_0xe4c8xf=== _0xed09[105]){_0xe4c8x1f= _0xed09[114]}else {if(_0xe4c8xf=== _0xed09[61]){_0xe4c8x1f= _0xed09[112]}};break;default:_0xe4c8x1f= _0xed09[112];logger[_0xed09[17]](_0xed09[55],_0xe4c8xe)}};return _0xe4c8x1f}function handleEndUserCreation(_0xe4c8x13,_0xe4c8xe,_0xe4c8x32,_0xe4c8xf){return function(_0xe4c8x10){if(!_0xe4c8x10){return};_0xe4c8x10= handleWsResponse(_0xe4c8x10);if(_0xe4c8x10[_0xed09[37]]){logger[_0xed09[13]](_0xed09[117],getValueFromPropertyName(_0xe4c8x32,getEndUserSearchPropertyFromChannel(_0xe4c8xe,_0xe4c8xf)));var _0xe4c8x45=getEndUserSearchQueryFromChannel(_0xe4c8xe);_0xe4c8x13[_0xed09[91]]= {id:_0xe4c8x10[_0xed09[37]],name:_0xe4c8x10[_0xed09[80]][_0xe4c8x45][_0xed09[40]],module:_0xed09[86]}};return}}function callCreation(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11){return function(){var _0xe4c8x47= new Date();var _0xe4c8x48=[{name:_0xed09[62],value:createSubjectFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11)},{name:_0xed09[118],value:_0xe4c8x13[_0xed09[49]][_0xed09[37]]},{name:_0xed09[119],value:_0xe4c8x13[_0xed09[49]][_0xed09[37]]},{name:_0xed09[120],value:createDescriptionFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11)},{name:_0xed09[121],value:_0xe4c8x47[_0xed09[126]]()[_0xed09[125]](0,19)[_0xed09[124]](_0xed09[122],_0xed09[123])},{name:_0xed09[127],value:_0xed09[78]},{name:_0xed09[128],value:_0xed09[129]},{name:_0xed09[130],value:_0xe4c8x13[_0xed09[91]][_0xed09[37]]},{name:_0xed09[131],value:_0xe4c8x13[_0xed09[91]][_0xed09[132]]},{name:_0xed09[133],value:_0xe4c8x13[_0xed09[91]][_0xed09[62]]}];var _0xe4c8x49=createCustomFieldsFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11);if(_0xe4c8x49[_0xed09[79]]> 0){_[_0xed09[134]](_0xe4c8x49,function(_0xe4c8x4a){_0xe4c8x48[_0xed09[115]]({name:_0xe4c8x4a[_0xed09[37]],value:_0xe4c8x4a[_0xed09[40]]})})};var _0xe4c8x30={method:_0xed09[110],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[135],name_value_list:_0xe4c8x48})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})}}function createSubjectFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11){var _0xe4c8x4c=_0xed09[52];var _0xe4c8x4d=[];if(_0xe4c8x13[_0xed09[21]][_0xed09[136]][_0xed09[79]]> 0){var _0xe4c8x4e=_[_0xed09[137]](_0xe4c8x13[_0xed09[21]].Subject,[_0xed09[37]]);_[_0xed09[134]](_0xe4c8x4e,function(_0xe4c8x4f){if(_0xe4c8x4f[_0xed09[138]]=== _0xed09[139]){_0xe4c8x4d[_0xed09[115]](_0xe4c8x4f[_0xed09[140]])}else {if(_0xe4c8x4f[_0xed09[138]]=== _0xed09[141]&& _0xe4c8x4f[_0xed09[142]]){var _0xe4c8x50=getValueFromPropertyName(_0xe4c8x32,_0xe4c8x4f[_0xed09[142]],_0xe4c8x13);if(_0xe4c8x50){_0xe4c8x4d[_0xed09[115]](_0xe4c8x50.toString())}}else {if(_0xe4c8x4f[_0xed09[138]]=== _0xed09[143]&& _0xe4c8x4f[_0xed09[144]]&& _0xe4c8x4f[_0xed09[144]][_0xed09[62]]){_0xe4c8x11[_0xe4c8x4f[_0xed09[144]][_0xed09[62]]]&& _0xe4c8x4d[_0xed09[115]](_0xe4c8x11[_0xe4c8x4f[_0xed09[144]][_0xed09[62]]].toString())}}}});_0xe4c8x4c= _0xe4c8x4d[_0xed09[145]](_0xed09[123])};return _0xe4c8x4c}function createDescriptionFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11){var _0xe4c8x52=_0xed09[52];var _0xe4c8x4d=[];if(_0xe4c8x13[_0xed09[21]][_0xed09[146]][_0xed09[79]]> 0){var _0xe4c8x53=_[_0xed09[137]](_0xe4c8x13[_0xed09[21]].Description,[_0xed09[37]]);_[_0xed09[134]](_0xe4c8x53,function(_0xe4c8x4f){if(_0xe4c8x4f[_0xed09[138]]=== _0xed09[139]){_0xe4c8x4d[_0xed09[115]](_0xe4c8x4f[_0xed09[140]])}else {if(_0xe4c8x4f[_0xed09[138]]=== _0xed09[147]){if(_0xe4c8x4f[_0xed09[148]]=== _0xed09[139]&& _0xe4c8x4f[_0xed09[149]]){_0xe4c8x4d[_0xed09[115]](util[_0xed09[45]](_0xed09[150],_0xe4c8x4f[_0xed09[149]],_0xe4c8x4f[_0xed09[151]]))}else {if(_0xe4c8x4f[_0xed09[148]]=== _0xed09[141]&& _0xe4c8x4f[_0xed09[142]]&& _0xe4c8x4f[_0xed09[149]]){var _0xe4c8x50=getValueFromPropertyName(_0xe4c8x32,_0xe4c8x4f[_0xed09[142]],_0xe4c8x13);if(_0xe4c8x50){_0xe4c8x4d[_0xed09[115]](util[_0xed09[45]](_0xed09[150],_0xe4c8x4f[_0xed09[149]],_0xe4c8x50.toString()))}}else {if(_0xe4c8x4f[_0xed09[148]]=== _0xed09[143]&& _0xe4c8x4f[_0xed09[144]]&& _0xe4c8x4f[_0xed09[144]][_0xed09[62]]&& _0xe4c8x4f[_0xed09[149]]){_0xe4c8x11[_0xe4c8x4f[_0xed09[144]][_0xed09[62]]]&& _0xe4c8x4d[_0xed09[115]](util[_0xed09[45]](_0xed09[150],_0xe4c8x4f[_0xed09[149]],_0xe4c8x11[_0xe4c8x4f[_0xed09[144]][_0xed09[62]]]))}}}}}});_0xe4c8x52= _0xe4c8x4d[_0xed09[145]](_0xed09[152])};return _0xe4c8x52}function createCustomFieldsFromConfiguration(_0xe4c8x13,_0xe4c8x32,_0xe4c8x11){var _0xe4c8x55=[];var _0xe4c8x56=[];if(_0xe4c8x13[_0xed09[21]][_0xed09[153]][_0xed09[79]]> 0){_0xe4c8x55= _0xe4c8x13[_0xed09[21]][_0xed09[153]];_[_0xed09[134]](_0xe4c8x55,function(_0xe4c8x4a){if(_0xe4c8x4a[_0xed09[138]]=== _0xed09[139]&& _0xe4c8x4a[_0xed09[154]]){_0xe4c8x56[_0xed09[115]]({id:_0xe4c8x4a[_0xed09[154]],value:_0xe4c8x4a[_0xed09[140]]})}else {if(_0xe4c8x4a[_0xed09[138]]=== _0xed09[141]&& _0xe4c8x4a[_0xed09[142]]&& _0xe4c8x4a[_0xed09[154]]){var _0xe4c8x50=getValueFromPropertyName(_0xe4c8x32,_0xe4c8x4a[_0xed09[142]],_0xe4c8x13);if(_0xe4c8x50){_0xe4c8x56[_0xed09[115]]({id:_0xe4c8x4a[_0xed09[154]],value:_0xe4c8x50.toString()})}}else {if(_0xe4c8x4a[_0xed09[138]]=== _0xed09[143]&& _0xe4c8x4a[_0xed09[154]]&& _0xe4c8x4a[_0xed09[144]]&& _0xe4c8x4a[_0xed09[144]][_0xed09[62]]){_0xe4c8x11[_0xe4c8x4a[_0xed09[144]][_0xed09[62]]]&& _0xe4c8x56[_0xed09[115]]({id:_0xe4c8x4a[_0xed09[154]],value:_0xe4c8x11[_0xe4c8x4a[_0xed09[144]][_0xed09[62]]].toString()})}}}})};return _0xe4c8x56}function handleCallAgentAssociation(_0xe4c8x13){return function(_0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[37]]){_0xe4c8x13[_0xed09[155]]= {id:_0xe4c8x10[_0xed09[37]]};if(_0xe4c8x13[_0xed09[73]]<= 6){_0xe4c8x13[_0xed09[155]][_0xed09[156]]= util[_0xed09[45]](_0xed09[157],stripTrailingSlash(_0xe4c8x13[_0xed09[21]][_0xed09[24]][_0xed09[26]]),_0xe4c8x10[_0xed09[37]])}else {_0xe4c8x13[_0xed09[155]][_0xed09[156]]= util[_0xed09[45]](_0xed09[158],stripTrailingSlash(_0xe4c8x13[_0xed09[21]][_0xed09[24]][_0xed09[26]]),_0xe4c8x10[_0xed09[37]])}};var _0xe4c8x30={method:_0xed09[159],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[135],module_id:_0xe4c8x13[_0xed09[155]][_0xed09[37]],link_field_name:_0xed09[160],related_ids:[_0xe4c8x13[_0xed09[49]][_0xed09[37]]]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})}}function handleCallContactAssociation(_0xe4c8x13){return function(_0xe4c8x10){_0xe4c8x10= handleWsResponse(_0xe4c8x10);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x10[_0xed09[161]]>= 1){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[162],_0xe4c8x13[_0xed09[155]][_0xed09[37]],_0xe4c8x13[_0xed09[49]][_0xed09[37]]))};var _0xe4c8x30={method:_0xed09[159],input_type:_0xed09[33],response_type:_0xed09[33],rest_data:JSON[_0xed09[34]]({session:_0xe4c8x13[_0xed09[38]],module_name:_0xed09[135],module_id:_0xe4c8x13[_0xed09[155]][_0xed09[37]],link_field_name:_[_0xed09[101]](_0xe4c8x13[_0xed09[91]][_0xed09[132]]),related_ids:[_0xe4c8x13[_0xed09[91]][_0xed09[37]]]})};return rp({method:_0xed09[35],uri:_0xe4c8x13[_0xed09[25]],form:_0xe4c8x30})}}function handleReportIntegration(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xc,_0xe4c8x12,_0xe4c8xf){return function(_0xe4c8x5a){_0xe4c8x5a= handleWsResponse(_0xe4c8x5a);logger[_0xed09[36]](_0xe4c8x10);if(_0xe4c8x5a[_0xed09[161]]>= 1){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[163],_0xe4c8x13[_0xed09[155]][_0xed09[37]],_0xe4c8x13[_0xed09[91]][_0xed09[37]]))};delete _0xe4c8x10[_0xed09[37]];delete _0xe4c8x10[_0xed09[164]];delete _0xe4c8x10[_0xed09[165]];_0xe4c8x10[_0xed09[166]]= _0xed09[167];_0xe4c8x10[_0xed09[168]]= _0xe4c8xe;_0xe4c8x10[_0xed09[169]]= _0xed09[170];_0xe4c8x10[_0xed09[171]]= _0xe4c8x13[_0xed09[155]][_0xed09[37]];_0xe4c8x10[_0xed09[156]]= _0xe4c8x13[_0xed09[155]][_0xed09[156]];_0xe4c8x10[_0xed09[172]]= _0xe4c8xc;_0xe4c8x10[_0xed09[173]]= _0xe4c8xf;_0xe4c8x12[_0xed09[177]](util[_0xed09[45]](_0xed09[176],_0xe4c8x10[_0xed09[53]]))[_0xed09[175]](_0xed09[174],_0xe4c8x10);return ReportIntegration[_0xed09[178]](_0xe4c8x10)}}function handleEnd(_0xe4c8x13){return function(_0xe4c8x10){logger[_0xed09[13]](util[_0xed09[45]](_0xed09[179],_0xe4c8x13[_0xed09[155]][_0xed09[37]],_0xe4c8x13[_0xed09[49]][_0xed09[37]]));_0xe4c8x13= undefined;return}}function handleError(_0xe4c8x13,_0xe4c8xe,_0xe4c8x10,_0xe4c8xc){return function(_0xe4c8x5d){logger[_0xed09[17]](_0xed09[180]);logger[_0xed09[17]](_0xed09[181],_0xe4c8x5d[_0xed09[182]]);logger[_0xed09[17]](_0xed09[183],_0xe4c8x5d[_0xed09[184]]);_0xe4c8x13= undefined;delete _0xe4c8x10[_0xed09[37]];delete _0xe4c8x10[_0xed09[164]];delete _0xe4c8x10[_0xed09[165]];_0xe4c8x10[_0xed09[166]]= _0xed09[167];_0xe4c8x10[_0xed09[168]]= _0xe4c8xe;_0xe4c8x10[_0xed09[169]]= _0xed09[185];_0xe4c8x10[_0xed09[172]]= _0xe4c8xc;ReportIntegration[_0xed09[178]](_0xe4c8x10)[_0xed09[18]](function(_0xe4c8x5d){logger[_0xed09[17]](_0xed09[186]);return})}}function stripTrailingSlash(_0xe4c8x5f){if(_0xe4c8x5f[_0xed09[187]](-1) === _0xed09[188]){return _0xe4c8x5f[_0xed09[187]](0,_0xe4c8x5f[_0xed09[79]]- 1)};return _0xe4c8x5f}function handleWsResponse(_0xe4c8x10){return JSON[_0xed09[189]](_0xe4c8x10)}function getMatchObject(_0xe4c8x62,_0xe4c8x1f,_0xe4c8x63,_0xe4c8x64){var _0xe4c8x65=_[_0xed09[20]](_0xe4c8x62,function(_0xe4c8x66){return _0xe4c8x66[_0xed09[42]][_0xe4c8x1f][_0xe4c8x63]== _0xe4c8x64});if(_0xe4c8x65){return _0xe4c8x65};return _[_0xed09[190]](_0xe4c8x62)}module[_0xed09[191]]= Sugarcrm