c3524534ef2ce30c23116cefa51509986043436b
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0xc6ac=["\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(_0xc6ac[0]);var util=require(_0xc6ac[1]);var rp=require(_0xc6ac[2]);var request=require(_0xc6ac[3]);var logger=require(_0xc6ac[5])(_0xc6ac[4]);var SugarcrmConfiguration=require(_0xc6ac[7])[_0xc6ac[6]];var ReportIntegration=require(_0xc6ac[7])[_0xc6ac[8]];var VoiceQueue=require(_0xc6ac[7])[_0xc6ac[9]];var VoiceExtension=require(_0xc6ac[7])[_0xc6ac[10]];var Agent=require(_0xc6ac[7])[_0xc6ac[11]];function Sugarcrm(){logger[_0xc6ac[13]](_0xc6ac[12])}Sugarcrm[_0xc6ac[15]][_0xc6ac[14]]= function(_0xc5acxc,_0xc5acxd,_0xc5acxe,_0xc5acxf,_0xc5acx10,_0xc5acx11,_0xc5acx12){var _0xc5acx13={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0xc5acxc||  !_0xc5acxd){logger[_0xc6ac[17]](_0xc6ac[16]);return};SugarcrmConfiguration[_0xc6ac[20]]({where:{id:_0xc5acxd,AccountId:_0xc5acxc},include:[{all:true,include:[{all:true}]}]})[_0xc6ac[19]](handleEntityNotFound())[_0xc6ac[19]](handleConnection(_0xc5acx13))[_0xc6ac[19]](handleLogin(_0xc5acx13))[_0xc6ac[19]](searchMotionAgent(_0xc5acxe,_0xc5acx10))[_0xc6ac[19]](handleMotionAgent(_0xc5acx13))[_0xc6ac[19]](searchQueue(_0xc5acx10))[_0xc6ac[19]](handleQueueRecordings(_0xc5acx13,_0xc5acx10))[_0xc6ac[19]](searchRoute(_0xc5acx10))[_0xc6ac[19]](handleOutboundRecordings(_0xc5acx13,_0xc5acx10))[_0xc6ac[19]](getServerInfo(_0xc5acx13))[_0xc6ac[19]](handleServerInfo(_0xc5acx13))[_0xc6ac[19]](searchAgent(_0xc5acx13))[_0xc6ac[19]](handleAgent(_0xc5acx13))[_0xc6ac[19]](handleAdmin(_0xc5acx13))[_0xc6ac[19]](searchEndUserWithDefaultMapping(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](handleEndUserWithDefaultMapping(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](searchEndUser(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](handleEndUser(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](endUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](handleEndUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf))[_0xc6ac[19]](callCreation(_0xc5acx13,_0xc5acx10,_0xc5acx11))[_0xc6ac[19]](handleCallAgentAssociation(_0xc5acx13))[_0xc6ac[19]](handleCallContactAssociation(_0xc5acx13))[_0xc6ac[19]](handleReportIntegration(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxc,_0xc5acx12,_0xc5acxf))[_0xc6ac[19]](handleEnd(_0xc5acx13))[_0xc6ac[18]](handleError(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxc))};function handleEntityNotFound(){return function(_0xc5acx15){if(!_0xc5acx15){return null};return _0xc5acx15}}function handleConnection(_0xc5acx13){return function(_0xc5acx17){_0xc5acx13[_0xc6ac[21]]= _0xc5acx17;_0xc5acx13[_0xc6ac[22]]= _0xc5acx17[_0xc6ac[24]][_0xc6ac[23]];_0xc5acx13[_0xc6ac[25]]= stripTrailingSlash(_0xc5acx17[_0xc6ac[24]][_0xc6ac[26]])+ _0xc6ac[27];var _0xc5acx18={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0xc5acx17[_0xc6ac[24]][_0xc6ac[28]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0xc5acx17[_0xc6ac[24]][_0xc6ac[29]],encryption:_0xc6ac[30]},application:_0xc6ac[31]};var _0xc5acx10={method:_0xc6ac[32],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]](_0xc5acx18)};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx10})}}function handleLogin(_0xc5acx13){return function(_0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[37]]){_0xc5acx13[_0xc6ac[38]]= _0xc5acx10[_0xc6ac[37]];_0xc5acx13[_0xc6ac[39]]= {id:_0xc5acx10[_0xc6ac[42]][_0xc6ac[41]][_0xc6ac[40]],name:_0xc5acx10[_0xc6ac[42]][_0xc6ac[43]][_0xc6ac[40]]};return};throw  new Error(util[_0xc6ac[45]](_0xc6ac[44],_0xc5acx13[_0xc6ac[21]][_0xc6ac[24]][_0xc6ac[37]]))}}function searchMotionAgent(_0xc5acxe,_0xc5acx10){return function(){var _0xc5acx1b=getAgentSearchPropertyFromChannel(_0xc5acxe);if(_0xc5acx10[_0xc6ac[46]](_0xc5acx1b)){return Agent[_0xc6ac[50]](_0xc6ac[49])[_0xc6ac[48]]({where:{name:getValueFromPropertyName(_0xc5acx10,_0xc5acx1b)},attributes:[_0xc6ac[47]]})};return}}function handleMotionAgent(_0xc5acx13){return function(_0xc5acx1d){if(_0xc5acx1d&& _0xc5acx1d[_0xc6ac[47]]){_0xc5acx13[_0xc6ac[51]]= _0xc5acx1d[_0xc6ac[47]]};return}}function getAgentSearchPropertyFromChannel(_0xc5acxe){var _0xc5acx1f=_0xc6ac[52];if(_0xc5acxe){switch(_0xc5acxe){case _0xc6ac[54]:_0xc5acx1f= _0xc6ac[53];break;default:_0xc5acx1f= _0xc6ac[53];logger[_0xc6ac[17]](_0xc6ac[55],_0xc5acxe)}};return _0xc5acx1f}function getValueFromPropertyName(_0xc5acx10,_0xc5acx1f,_0xc5acx13){if(_0xc5acx1f=== _0xc6ac[56]){if(_0xc5acx13&& _0xc5acx13[_0xc6ac[57]]&& _0xc5acx13[_0xc6ac[22]]){return util[_0xc6ac[45]](_0xc6ac[58],stripTrailingSlash(_0xc5acx13[_0xc6ac[22]]),_0xc5acx10[_0xc6ac[59]])}else {return null}}else {return _[_0xc6ac[60]](_0xc5acx10,_0xc5acx1f)}}function searchQueue(_0xc5acx10){return function(){if(_0xc5acx10[_0xc6ac[61]]){return VoiceQueue[_0xc6ac[48]]({where:{name:_0xc5acx10[_0xc6ac[61]]},attributes:[_0xc6ac[62],_0xc6ac[63]]})}else {return}}}function handleQueueRecordings(_0xc5acx13,_0xc5acx10){return function(_0xc5acx23){if(_0xc5acx10[_0xc6ac[61]]){if(_0xc5acx23&& _0xc5acx23[_0xc6ac[63]]){logger[_0xc6ac[13]](_0xc6ac[64],_0xc5acx23[_0xc6ac[62]]);_0xc5acx13[_0xc6ac[57]]= true}else {_0xc5acx13[_0xc6ac[57]]= false;logger[_0xc6ac[13]](_0xc6ac[65])}};return}}function searchRoute(_0xc5acx10){return function(){if(_0xc5acx10[_0xc6ac[66]]){return VoiceExtension[_0xc6ac[48]]({where:{id:_0xc5acx10[_0xc6ac[66]]},attributes:[_0xc6ac[37],_0xc6ac[67]]})}else {return}}}function handleOutboundRecordings(_0xc5acx13,_0xc5acx10){return function(_0xc5acx26){if(_0xc5acx10[_0xc6ac[66]]){if(_0xc5acx26&& _0xc5acx26[_0xc6ac[67]]){logger[_0xc6ac[13]](_0xc6ac[68],_0xc5acx26[_0xc6ac[37]]);_0xc5acx13[_0xc6ac[57]]= true}else {_0xc5acx13[_0xc6ac[57]]= false;logger[_0xc6ac[13]](_0xc6ac[69])}};return}}function getServerInfo(_0xc5acx13){return function(){var _0xc5acx10={method:_0xc6ac[70],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx10})}}function handleServerInfo(_0xc5acx13){return function(_0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);var _0xc5acx29=_0xc5acx10[_0xc6ac[72]][_0xc6ac[71]](0);if(_0xc5acx29){_0xc5acx13[_0xc6ac[73]]= parseInt(_0xc5acx29)}else {_0xc5acx13[_0xc6ac[73]]= 6};return}}function searchAgent(_0xc5acx13){return function(){if(_0xc5acx13[_0xc6ac[51]]){logger[_0xc6ac[13]](_0xc6ac[74],_0xc5acx13[_0xc6ac[51]]);var _0xc5acx10={method:_0xc6ac[75],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[76],query:util[_0xc6ac[45]](_0xc6ac[77],_0xc5acx13[_0xc6ac[51]]),order_by:_0xc6ac[52],offset:_0xc6ac[78],select_fields:[_0xc6ac[37],_0xc6ac[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xc6ac[78]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx10})}};return}function handleAgent(_0xc5acx13){return function(_0xc5acx10){if(_0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[80]][_0xc6ac[79]]> 0&& _0xc5acx10[_0xc6ac[81]]> 0){logger[_0xc6ac[13]](_0xc6ac[82],_0xc5acx13[_0xc6ac[51]]);var _0xc5acx2c=getMatchObject(_0xc5acx10[_0xc6ac[80]],_0xc6ac[62],_0xc6ac[40],_0xc5acx13[_0xc6ac[51]]);_0xc5acx13[_0xc6ac[49]]= {id:_0xc5acx2c[_0xc6ac[42]][_0xc6ac[37]][_0xc6ac[40]],name:_0xc5acx2c[_0xc6ac[42]][_0xc6ac[62]][_0xc6ac[40]]};return _0xc5acx13[_0xc6ac[49]]};return};return}}function handleAdmin(_0xc5acx13){return function(_0xc5acx10){if(_0xc5acx10){return};logger[_0xc6ac[13]](_0xc6ac[83]);_0xc5acx13[_0xc6ac[49]]= _0xc5acx13[_0xc6ac[39]];logger[_0xc6ac[13]](_0xc6ac[84]);return}}function getEndUserSearchModule(_0xc5acx13){return _0xc5acx13[_0xc6ac[21]][_0xc6ac[85]]?_0xc6ac[86]:_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]}function searchEndUserWithDefaultMapping(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf){return function(){if(!_0xc5acx13[_0xc6ac[21]][_0xc6ac[85]]&& _0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[88],getEndUserSearchModule(_0xc5acx13),getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))));var _0xc5acx30={method:_0xc6ac[75],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:getEndUserSearchModule(_0xc5acx13),query:getEndUserSearchQuery(_0xc5acx13,_0xc5acx10,_0xc5acxe,_0xc5acxf),order_by:_0xc6ac[52],offset:_0xc6ac[78],select_fields:[_0xc6ac[37],_0xc6ac[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xc6ac[78]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})};logger[_0xc6ac[36]](util[_0xc6ac[45]](_0xc6ac[89]));return}}function handleEndUserWithDefaultMapping(_0xc5acx13,_0xc5acxe,_0xc5acx32,_0xc5acxf){return function(_0xc5acx10){if(!_0xc5acx13[_0xc6ac[21]][_0xc6ac[85]]&& _0xc5acx13[_0xc6ac[21]][_0xc6ac[87]] && _0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[80]][_0xc6ac[79]]> 0&& _0xc5acx10[_0xc6ac[81]]> 0){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[90],getEndUserSearchModule(_0xc5acx13),getValueFromPropertyName(_0xc5acx32,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))));_0xc5acx13[_0xc6ac[91]]= {id:_0xc5acx10[_0xc6ac[80]][0][_0xc6ac[42]][_0xc6ac[37]][_0xc6ac[40]],name:_0xc5acx10[_0xc6ac[80]][0][_0xc6ac[42]][_0xc6ac[62]][_0xc6ac[40]],module:getEndUserSearchModule(_0xc5acx13)}}else {logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[92],getEndUserSearchModule(_0xc5acx13),getValueFromPropertyName(_0xc5acx32,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))))}};return}}function searchEndUser(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf){return function(){if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[85]]||  !_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]||  !_0xc5acx13[_0xc6ac[91]]){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[93],getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))));var _0xc5acx30={method:_0xc6ac[75],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[86],query:util[_0xc6ac[45]](_0xc6ac[94],getEndUserSearchQueryFromChannel(_0xc5acxe),getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))),order_by:_0xc6ac[52],offset:_0xc6ac[78],select_fields:[_0xc6ac[37],_0xc6ac[62]],link_name_to_fields_array:[],max_results:-1,deleted:_0xc6ac[78]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})};logger[_0xc6ac[36]](util[_0xc6ac[45]](_0xc6ac[95]));return}}function getEndUserSearchQuery(_0xc5acx13,_0xc5acx10,_0xc5acxe,_0xc5acxf){var _0xc5acx35;var _0xc5acx36=_[_0xc6ac[97]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[96]]);if(_[_0xc6ac[99]](_0xc5acx36,_0xc6ac[98])){_0xc5acx35= util[_0xc6ac[45]](_0xc6ac[100],_[_0xc6ac[101]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]])+ _0xc6ac[102],_0xc5acx36,getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))}else {_0xc5acx35= util[_0xc6ac[45]](_0xc6ac[100],_[_0xc6ac[101]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]),_0xc5acx36,getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))};if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[96]][_0xc6ac[79]]> 1){for(var _0xc5acx37=1;_0xc5acx37< _0xc5acx13[_0xc6ac[21]][_0xc6ac[96]][_0xc6ac[79]];_0xc5acx37++){var _0xc5acx38=_0xc5acx13[_0xc6ac[21]][_0xc6ac[96]][_0xc5acx37];if(_[_0xc6ac[99]](_0xc5acx36,_0xc6ac[98])){_0xc5acx35+= util[_0xc6ac[45]](_0xc6ac[103],_[_0xc6ac[101]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]])+ _0xc6ac[102],_0xc5acx38,getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))}else {_0xc5acx35+= util[_0xc6ac[45]](_0xc6ac[103],_[_0xc6ac[101]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]),_0xc5acx38,getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))}}};return _0xc5acx35}function getEndUserSearchQueryFromChannel(_0xc5acxe){var _0xc5acx1f=_0xc6ac[52];if(_0xc5acxe){switch(_0xc5acxe){case _0xc6ac[54]:_0xc5acx1f= _0xc6ac[104];break;default:_0xc5acx1f= _0xc6ac[104];logger[_0xc6ac[17]](_0xc6ac[55],_0xc5acxe)}};return _0xc5acx1f}function getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf){var _0xc5acx1f=_0xc6ac[52];if(_0xc5acxe){switch(_0xc5acxe){case _0xc6ac[54]:if(_0xc5acxf=== _0xc6ac[105]){_0xc5acx1f= _0xc6ac[106]}else {if(_0xc5acxf=== _0xc6ac[61]){_0xc5acx1f= _0xc6ac[107]}};break;default:_0xc5acx1f= _0xc6ac[107];logger[_0xc6ac[17]](_0xc6ac[55],_0xc5acxe)}};return _0xc5acx1f}function handleEndUser(_0xc5acx13,_0xc5acxe,_0xc5acx32,_0xc5acxf){return function(_0xc5acx10){if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[85]]||  !_0xc5acx13[_0xc6ac[21]][_0xc6ac[87]]||  !_0xc5acx13[_0xc6ac[91]]){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[80]][_0xc6ac[79]]> 0&& _0xc5acx10[_0xc6ac[81]]> 0){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[108],getValueFromPropertyName(_0xc5acx32,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))));_0xc5acx13[_0xc6ac[91]]= {id:_0xc5acx10[_0xc6ac[80]][0][_0xc6ac[42]][_0xc6ac[37]][_0xc6ac[40]],name:_0xc5acx10[_0xc6ac[80]][0][_0xc6ac[42]][_0xc6ac[62]][_0xc6ac[40]],module:_0xc6ac[86]}}};return _0xc5acx13[_0xc6ac[91]]}}function endUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx32,_0xc5acxf){return function(_0xc5acx10){if(_0xc5acx10){return};logger[_0xc6ac[13]](_0xc6ac[109],getValueFromPropertyName(_0xc5acx32,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)));var _0xc5acx30={method:_0xc6ac[110],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[86],name_value_list:getArrayForEndUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx32,_0xc5acxf)})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})}}function getEndUserCreatePhone(_0xc5acx13){return _[_0xc6ac[97]](_0xc5acx13[_0xc6ac[21]][_0xc6ac[96]])}function getArrayForEndUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxf){var _0xc5acx3f=[];switch(_0xc5acxe){case _0xc6ac[54]:var _0xc5acx40={name:_0xc6ac[111]};if(_0xc5acxf=== _0xc6ac[61]){if(isValidName(_0xc5acx10[_0xc6ac[112]])){_0xc5acx40[_0xc6ac[40]]= getValueFromPropertyName(_0xc5acx10,getEndUserNamePropertyFromChannel(_0xc5acxe,_0xc5acxf))}else {_0xc5acx40[_0xc6ac[40]]= util[_0xc6ac[45]](_0xc6ac[113],getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))}}else {if(_0xc5acxf=== _0xc6ac[105]){if(isValidName(_0xc5acx10[_0xc6ac[114]])){_0xc5acx40[_0xc6ac[40]]= getValueFromPropertyName(_0xc5acx10,getEndUserNamePropertyFromChannel(_0xc5acxe,_0xc5acxf))}else {_0xc5acx40[_0xc6ac[40]]= util[_0xc6ac[45]](_0xc6ac[113],getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)))}}};_0xc5acx3f[_0xc6ac[115]](_0xc5acx40);_0xc5acx3f[_0xc6ac[115]]({name:getEndUserSearchQueryFromChannel(_0xc5acxe),value:getValueFromPropertyName(_0xc5acx10,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf))});break;default:logger[_0xc6ac[17]](_0xc6ac[55],_0xc5acxe)};return _0xc5acx3f}function isValidName(_0xc5acx42){return _0xc5acx42&& _0xc5acx42!== _0xc6ac[116]}function getEndUserNamePropertyFromChannel(_0xc5acxe,_0xc5acxf){var _0xc5acx1f=_0xc6ac[52];if(_0xc5acxe){switch(_0xc5acxe){case _0xc6ac[54]:if(_0xc5acxf=== _0xc6ac[105]){_0xc5acx1f= _0xc6ac[114]}else {if(_0xc5acxf=== _0xc6ac[61]){_0xc5acx1f= _0xc6ac[112]}};break;default:_0xc5acx1f= _0xc6ac[112];logger[_0xc6ac[17]](_0xc6ac[55],_0xc5acxe)}};return _0xc5acx1f}function handleEndUserCreation(_0xc5acx13,_0xc5acxe,_0xc5acx32,_0xc5acxf){return function(_0xc5acx10){if(!_0xc5acx10){return};_0xc5acx10= handleWsResponse(_0xc5acx10);if(_0xc5acx10[_0xc6ac[37]]){logger[_0xc6ac[13]](_0xc6ac[117],getValueFromPropertyName(_0xc5acx32,getEndUserSearchPropertyFromChannel(_0xc5acxe,_0xc5acxf)));var _0xc5acx45=getEndUserSearchQueryFromChannel(_0xc5acxe);_0xc5acx13[_0xc6ac[91]]= {id:_0xc5acx10[_0xc6ac[37]],name:_0xc5acx10[_0xc6ac[80]][_0xc5acx45][_0xc6ac[40]],module:_0xc6ac[86]}};return}}function callCreation(_0xc5acx13,_0xc5acx32,_0xc5acx11){return function(){var _0xc5acx47= new Date();var _0xc5acx48=[{name:_0xc6ac[62],value:createSubjectFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11)},{name:_0xc6ac[118],value:_0xc5acx13[_0xc6ac[49]][_0xc6ac[37]]},{name:_0xc6ac[119],value:_0xc5acx13[_0xc6ac[49]][_0xc6ac[37]]},{name:_0xc6ac[120],value:createDescriptionFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11)},{name:_0xc6ac[121],value:_0xc5acx47[_0xc6ac[126]]()[_0xc6ac[125]](0,19)[_0xc6ac[124]](_0xc6ac[122],_0xc6ac[123])},{name:_0xc6ac[127],value:_0xc6ac[78]},{name:_0xc6ac[128],value:_0xc6ac[129]},{name:_0xc6ac[130],value:_0xc5acx13[_0xc6ac[91]][_0xc6ac[37]]},{name:_0xc6ac[131],value:_0xc5acx13[_0xc6ac[91]][_0xc6ac[132]]},{name:_0xc6ac[133],value:_0xc5acx13[_0xc6ac[91]][_0xc6ac[62]]}];var _0xc5acx49=createCustomFieldsFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11);if(_0xc5acx49[_0xc6ac[79]]> 0){_[_0xc6ac[134]](_0xc5acx49,function(_0xc5acx4a){_0xc5acx48[_0xc6ac[115]]({name:_0xc5acx4a[_0xc6ac[37]],value:_0xc5acx4a[_0xc6ac[40]]})})};var _0xc5acx30={method:_0xc6ac[110],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[135],name_value_list:_0xc5acx48})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})}}function createSubjectFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11){var _0xc5acx4c=_0xc6ac[52];var _0xc5acx4d=[];if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[136]][_0xc6ac[79]]> 0){var _0xc5acx4e=_[_0xc6ac[137]](_0xc5acx13[_0xc6ac[21]].Subject,[_0xc6ac[37]]);_[_0xc6ac[134]](_0xc5acx4e,function(_0xc5acx4f){if(_0xc5acx4f[_0xc6ac[138]]=== _0xc6ac[139]){_0xc5acx4d[_0xc6ac[115]](_0xc5acx4f[_0xc6ac[140]])}else {if(_0xc5acx4f[_0xc6ac[138]]=== _0xc6ac[141]&& _0xc5acx4f[_0xc6ac[142]]){var _0xc5acx50=getValueFromPropertyName(_0xc5acx32,_0xc5acx4f[_0xc6ac[142]],_0xc5acx13);if(_0xc5acx50){_0xc5acx4d[_0xc6ac[115]](_0xc5acx50.toString())}}else {if(_0xc5acx4f[_0xc6ac[138]]=== _0xc6ac[143]&& _0xc5acx4f[_0xc6ac[144]]&& _0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]){_0xc5acx11[_0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]]&& _0xc5acx4d[_0xc6ac[115]](_0xc5acx11[_0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]].toString())}}}});_0xc5acx4c= _0xc5acx4d[_0xc6ac[145]](_0xc6ac[123])};return _0xc5acx4c}function createDescriptionFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11){var _0xc5acx52=_0xc6ac[52];var _0xc5acx4d=[];if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[146]][_0xc6ac[79]]> 0){var _0xc5acx53=_[_0xc6ac[137]](_0xc5acx13[_0xc6ac[21]].Description,[_0xc6ac[37]]);_[_0xc6ac[134]](_0xc5acx53,function(_0xc5acx4f){if(_0xc5acx4f[_0xc6ac[138]]=== _0xc6ac[139]){_0xc5acx4d[_0xc6ac[115]](_0xc5acx4f[_0xc6ac[140]])}else {if(_0xc5acx4f[_0xc6ac[138]]=== _0xc6ac[147]){if(_0xc5acx4f[_0xc6ac[148]]=== _0xc6ac[139]&& _0xc5acx4f[_0xc6ac[149]]){_0xc5acx4d[_0xc6ac[115]](util[_0xc6ac[45]](_0xc6ac[150],_0xc5acx4f[_0xc6ac[149]],_0xc5acx4f[_0xc6ac[151]]))}else {if(_0xc5acx4f[_0xc6ac[148]]=== _0xc6ac[141]&& _0xc5acx4f[_0xc6ac[142]]&& _0xc5acx4f[_0xc6ac[149]]){var _0xc5acx50=getValueFromPropertyName(_0xc5acx32,_0xc5acx4f[_0xc6ac[142]],_0xc5acx13);if(_0xc5acx50){_0xc5acx4d[_0xc6ac[115]](util[_0xc6ac[45]](_0xc6ac[150],_0xc5acx4f[_0xc6ac[149]],_0xc5acx50.toString()))}}else {if(_0xc5acx4f[_0xc6ac[148]]=== _0xc6ac[143]&& _0xc5acx4f[_0xc6ac[144]]&& _0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]&& _0xc5acx4f[_0xc6ac[149]]){_0xc5acx11[_0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]]&& _0xc5acx4d[_0xc6ac[115]](util[_0xc6ac[45]](_0xc6ac[150],_0xc5acx4f[_0xc6ac[149]],_0xc5acx11[_0xc5acx4f[_0xc6ac[144]][_0xc6ac[62]]]))}}}}}});_0xc5acx52= _0xc5acx4d[_0xc6ac[145]](_0xc6ac[152])};return _0xc5acx52}function createCustomFieldsFromConfiguration(_0xc5acx13,_0xc5acx32,_0xc5acx11){var _0xc5acx55=[];var _0xc5acx56=[];if(_0xc5acx13[_0xc6ac[21]][_0xc6ac[153]][_0xc6ac[79]]> 0){_0xc5acx55= _0xc5acx13[_0xc6ac[21]][_0xc6ac[153]];_[_0xc6ac[134]](_0xc5acx55,function(_0xc5acx4a){if(_0xc5acx4a[_0xc6ac[138]]=== _0xc6ac[139]&& _0xc5acx4a[_0xc6ac[154]]){_0xc5acx56[_0xc6ac[115]]({id:_0xc5acx4a[_0xc6ac[154]],value:_0xc5acx4a[_0xc6ac[140]]})}else {if(_0xc5acx4a[_0xc6ac[138]]=== _0xc6ac[141]&& _0xc5acx4a[_0xc6ac[142]]&& _0xc5acx4a[_0xc6ac[154]]){var _0xc5acx50=getValueFromPropertyName(_0xc5acx32,_0xc5acx4a[_0xc6ac[142]],_0xc5acx13);if(_0xc5acx50){_0xc5acx56[_0xc6ac[115]]({id:_0xc5acx4a[_0xc6ac[154]],value:_0xc5acx50.toString()})}}else {if(_0xc5acx4a[_0xc6ac[138]]=== _0xc6ac[143]&& _0xc5acx4a[_0xc6ac[154]]&& _0xc5acx4a[_0xc6ac[144]]&& _0xc5acx4a[_0xc6ac[144]][_0xc6ac[62]]){_0xc5acx11[_0xc5acx4a[_0xc6ac[144]][_0xc6ac[62]]]&& _0xc5acx56[_0xc6ac[115]]({id:_0xc5acx4a[_0xc6ac[154]],value:_0xc5acx11[_0xc5acx4a[_0xc6ac[144]][_0xc6ac[62]]].toString()})}}}})};return _0xc5acx56}function handleCallAgentAssociation(_0xc5acx13){return function(_0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[37]]){_0xc5acx13[_0xc6ac[155]]= {id:_0xc5acx10[_0xc6ac[37]]};if(_0xc5acx13[_0xc6ac[73]]<= 6){_0xc5acx13[_0xc6ac[155]][_0xc6ac[156]]= util[_0xc6ac[45]](_0xc6ac[157],stripTrailingSlash(_0xc5acx13[_0xc6ac[21]][_0xc6ac[24]][_0xc6ac[26]]),_0xc5acx10[_0xc6ac[37]])}else {_0xc5acx13[_0xc6ac[155]][_0xc6ac[156]]= util[_0xc6ac[45]](_0xc6ac[158],stripTrailingSlash(_0xc5acx13[_0xc6ac[21]][_0xc6ac[24]][_0xc6ac[26]]),_0xc5acx10[_0xc6ac[37]])}};var _0xc5acx30={method:_0xc6ac[159],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[135],module_id:_0xc5acx13[_0xc6ac[155]][_0xc6ac[37]],link_field_name:_0xc6ac[160],related_ids:[_0xc5acx13[_0xc6ac[49]][_0xc6ac[37]]]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})}}function handleCallContactAssociation(_0xc5acx13){return function(_0xc5acx10){_0xc5acx10= handleWsResponse(_0xc5acx10);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx10[_0xc6ac[161]]>= 1){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[162],_0xc5acx13[_0xc6ac[155]][_0xc6ac[37]],_0xc5acx13[_0xc6ac[49]][_0xc6ac[37]]))};var _0xc5acx30={method:_0xc6ac[159],input_type:_0xc6ac[33],response_type:_0xc6ac[33],rest_data:JSON[_0xc6ac[34]]({session:_0xc5acx13[_0xc6ac[38]],module_name:_0xc6ac[135],module_id:_0xc5acx13[_0xc6ac[155]][_0xc6ac[37]],link_field_name:_[_0xc6ac[101]](_0xc5acx13[_0xc6ac[91]][_0xc6ac[132]]),related_ids:[_0xc5acx13[_0xc6ac[91]][_0xc6ac[37]]]})};return rp({method:_0xc6ac[35],uri:_0xc5acx13[_0xc6ac[25]],form:_0xc5acx30})}}function handleReportIntegration(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxc,_0xc5acx12,_0xc5acxf){return function(_0xc5acx5a){_0xc5acx5a= handleWsResponse(_0xc5acx5a);logger[_0xc6ac[36]](_0xc5acx10);if(_0xc5acx5a[_0xc6ac[161]]>= 1){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[163],_0xc5acx13[_0xc6ac[155]][_0xc6ac[37]],_0xc5acx13[_0xc6ac[91]][_0xc6ac[37]]))};delete _0xc5acx10[_0xc6ac[37]];delete _0xc5acx10[_0xc6ac[164]];delete _0xc5acx10[_0xc6ac[165]];_0xc5acx10[_0xc6ac[166]]= _0xc6ac[167];_0xc5acx10[_0xc6ac[168]]= _0xc5acxe;_0xc5acx10[_0xc6ac[169]]= _0xc6ac[170];_0xc5acx10[_0xc6ac[171]]= _0xc5acx13[_0xc6ac[155]][_0xc6ac[37]];_0xc5acx10[_0xc6ac[156]]= _0xc5acx13[_0xc6ac[155]][_0xc6ac[156]];_0xc5acx10[_0xc6ac[172]]= _0xc5acxc;_0xc5acx10[_0xc6ac[173]]= _0xc5acxf;_0xc5acx12[_0xc6ac[177]](util[_0xc6ac[45]](_0xc6ac[176],_0xc5acx10[_0xc6ac[53]]))[_0xc6ac[175]](_0xc6ac[174],_0xc5acx10);return ReportIntegration[_0xc6ac[178]](_0xc5acx10)}}function handleEnd(_0xc5acx13){return function(_0xc5acx10){logger[_0xc6ac[13]](util[_0xc6ac[45]](_0xc6ac[179],_0xc5acx13[_0xc6ac[155]][_0xc6ac[37]],_0xc5acx13[_0xc6ac[49]][_0xc6ac[37]]));_0xc5acx13= undefined;return}}function handleError(_0xc5acx13,_0xc5acxe,_0xc5acx10,_0xc5acxc){return function(_0xc5acx5d){logger[_0xc6ac[17]](_0xc6ac[180]);logger[_0xc6ac[17]](_0xc6ac[181],_0xc5acx5d[_0xc6ac[182]]);logger[_0xc6ac[17]](_0xc6ac[183],_0xc5acx5d[_0xc6ac[184]]);_0xc5acx13= undefined;delete _0xc5acx10[_0xc6ac[37]];delete _0xc5acx10[_0xc6ac[164]];delete _0xc5acx10[_0xc6ac[165]];_0xc5acx10[_0xc6ac[166]]= _0xc6ac[167];_0xc5acx10[_0xc6ac[168]]= _0xc5acxe;_0xc5acx10[_0xc6ac[169]]= _0xc6ac[185];_0xc5acx10[_0xc6ac[172]]= _0xc5acxc;ReportIntegration[_0xc6ac[178]](_0xc5acx10)[_0xc6ac[18]](function(_0xc5acx5d){logger[_0xc6ac[17]](_0xc6ac[186]);return})}}function stripTrailingSlash(_0xc5acx5f){if(_0xc5acx5f[_0xc6ac[187]](-1) === _0xc6ac[188]){return _0xc5acx5f[_0xc6ac[187]](0,_0xc5acx5f[_0xc6ac[79]]- 1)};return _0xc5acx5f}function handleWsResponse(_0xc5acx10){return JSON[_0xc6ac[189]](_0xc5acx10)}function getMatchObject(_0xc5acx62,_0xc5acx1f,_0xc5acx63,_0xc5acx64){var _0xc5acx65=_[_0xc6ac[20]](_0xc5acx62,function(_0xc5acx66){return _0xc5acx66[_0xc6ac[42]][_0xc5acx1f][_0xc5acx63]== _0xc5acx64});if(_0xc5acx65){return _0xc5acx65};return _[_0xc6ac[190]](_0xc5acx62)}module[_0xc6ac[191]]= Sugarcrm