scaip/scaip
2026-09-11 10:44:40 +00:00

1 line
53 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"Id":120,"Name":null,"Description":null,"FirmwareVersion":null,"InProgress":false,"MessageTypes":[{"Id":7591,"Code":"BPRS","Name":null,"MessageCode":null,"NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":1,"Template":"DISABLED<mrq><ref>1234</ref><ver><<version>></ver><sco><<sco>></sco><cha><<cha>></cha><mty>ME</mty><hbo><<hbo>></hbo><cid><<imei>></cid><dty><<dty>></dty><did><<imei>></did><dco><<dco>></dco><dte>PANICBUTTON</dte><crd><<crd>></crd><stc><<stc>></stc><stt><<stt>></stt><pri><<pri>></pri><lco><<lco>></lco><lva><<lva>></lva><lge><geo><<geo>></geo><tim><<tim>></tim><gga><<gga>></gga></lge><lte><<lte>></lte><ico><<ico>></ico><ite><<ite>></ite><ame><<ame>></ame></mrq>","HasTemplateGlobal":false,"ResponseTemplate":null,"TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^DISABLED<mrq><ref>1234</ref><ver>[^<]*</ver><sco>[^<<]*</sco><cha>[^<<]*</cha><mty>ME</mty><hbo>[^<<]*</hbo><cid>[^<<]*</cid><dty>[^<<]*</dty><did>[^<<]*</did><dco>[^<<]*</dco><dte>PANICBUTTON</dte><crd>[^<<]*</crd><stc>[^<<]*</stc><stt>[^<<]*</stt><pri>[^<<]*</pri><lco>[^<<]*</lco><lva>[^<<]*</lva><lge><geo>[^<<]*</geo><tim>[^<<]*</tim><gga>[^<<]*</gga></lge><lte>[^<<]*</lte><ico>[^<<]*</ico><ite>[^<<]*</ite><ame>[^<<]*</ame></mrq>","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[],"Tags":[]},{"Id":8061,"Code":"COMM","Name":null,"MessageCode":null,"NeedAck":true,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":0,"Template":"","HasTemplateGlobal":true,"ResponseTemplate":"<mrs><<imei>></mrs>","TemplateGlobal":"<<data>>","LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"","RegExGlobal":"^[^ ]*","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":1,"NewValue":"{\"Id\":8061,\"Code\":\"COMM\",\"Name\":null,\"MessageCode\":\"COMM\",\"NeedAck\":true,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":0,\"Template\":\"\",\"HasTemplateGlobal\":true,\"ResponseTemplate\":\"<mrs><<imei>></mrs>\",\"TemplateGlobal\":\"<mrq><<data>></mrq>\",\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"\",\"RegExGlobal\":\"^<mrq>[^<]*</mrq>\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1780931248},{"Type":1,"NewValue":"{\"Id\":8061,\"Code\":\"COMM\",\"Name\":null,\"MessageCode\":\"COMM\",\"NeedAck\":true,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":0,\"Template\":\"\",\"HasTemplateGlobal\":true,\"ResponseTemplate\":\"<mrs><<imei>></mrs>\",\"TemplateGlobal\":\"<mrq><<data>>\",\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"\",\"RegExGlobal\":\"^<mrq>[^>]*\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1780931624}],"Tags":[]},{"Id":8062,"Code":"ALSOS","Name":null,"MessageCode":null,"NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":1,"Template":"SCAIP-ALSOS;<<imei>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-ALSOS;[^;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":1,"NewValue":"{\"Id\":8062,\"Code\":null,\"Name\":null,\"MessageCode\":null,\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":1,\"Template\":\"SCAIP-ALSOS;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-ALSOS;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123286},{"Type":1,"NewValue":"{\"Id\":8062,\"Code\":\"ALSOS\",\"Name\":null,\"MessageCode\":\"ALSOS\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":1,\"Template\":\"SCAIP-ALSOS;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-ALSOS;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123414}],"Tags":[]},{"Id":2210,"Code":"ALSOS","Name":null,"MessageCode":null,"NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":1,"Template":"DISABLED<mrq><ref><<reference>></ref><ver><<version>></ver><sco><<system-config>></sco><cha><<call-handling>></cha><mty>ME</mty><hbo><<heartbeat-options>></hbo><cid><<cid>></cid><dty><<device-type>></dty><did><<device-id>></did><dco><<device-component>></dco><dte><<device-text>></dte><crd><<caller-id>></crd><stc>0010</stc><stt><<status-text>></stt><pri><<priority>></pri><lco><<location-code>></lco><lva><<location-value>></lva><lge><geo><<wgs-pos>></geo><tim><<time-stamp>></tim><gga><<gga-pos>></gga></lge><lte><<location-text>></lte><ico><<info-code>></ico><ite><<info-text>></ite><ame><<additional-message>></ame></mrq>","HasTemplateGlobal":false,"ResponseTemplate":null,"TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^DISABLED<mrq><ref>[^<]*</ref><ver>[^<<]*</ver><sco>[^<<]*</sco><cha>[^<<]*</cha><mty>ME</mty><hbo>[^<<]*</hbo><cid>[^<<]*</cid><dty>[^<<]*</dty><did>[^<<]*</did><dco>[^<<]*</dco><dte>[^<<]*</dte><crd>[^<<]*</crd><stc>0010</stc><stt>[^<<]*</stt><pri>[^<<]*</pri><lco>[^<<]*</lco><lva>[^<<]*</lva><lge><geo>[^<<]*</geo><tim>[^<<]*</tim><gga>[^<<]*</gga></lge><lte>[^<<]*</lte><ico>[^<<]*</ico><ite>[^<<]*</ite><ame>[^<<]*</ame></mrq>","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[],"Tags":[]},{"Id":7586,"Code":"ALSOS","Name":null,"MessageCode":null,"NeedAck":true,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":1,"Template":"DISABLED<mrq><ref><<reference>></ref><mty><<mty>></mty><cha><<channel>></cha><mreq><<mreq>></mreq><cid><<clientID>></cid><dty><<dty>></dty><did><<imei>></did><dte><<dte>></dte><crd><<crd>></crd><stc><<stc>></stc></mrq>","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":"","LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":"","ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^DISABLED<mrq><ref>[^<]*</ref><mty>[^<<]*</mty><cha>[^<<]*</cha><mreq>[^<<]*</mreq><cid>[^<<]*</cid><dty>[^<<]*</dty><did>[^<<]*</did><dte>[^<<]*</dte><crd>[^<<]*</crd><stc>[^<<]*</stc></mrq>","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[],"Tags":[]},{"Id":8436,"Code":"ALSM","Name":null,"MessageCode":"ALSM","NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":1,"Template":"SCAIP-ALSM;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":"","LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-ALSM;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":0,"NewValue":"{\"Id\":8436,\"Code\":\"ALSM\",\"Name\":null,\"MessageCode\":\"ALSM\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":1,\"Template\":\"SCAIP-ALSM;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":\"\",\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-ALSM;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123439}],"Tags":[]},{"Id":8437,"Code":"BATL","Name":null,"MessageCode":"BATL","NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":2,"Template":"SCAIP-BATL;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-BATL;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":0,"NewValue":"{\"Id\":8437,\"Code\":\"BATL\",\"Name\":null,\"MessageCode\":\"BATL\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":2,\"Template\":\"SCAIP-BATL;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-BATL;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123462}],"Tags":[]},{"Id":8438,"Code":"PWRF","Name":null,"MessageCode":"PWRF","NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":2,"Template":"SCAIP-PWRF;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-PWRF;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":0,"NewValue":"{\"Id\":8438,\"Code\":\"PWRF\",\"Name\":null,\"MessageCode\":\"PWRF\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":2,\"Template\":\"SCAIP-PWRF;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-PWRF;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123464}],"Tags":[]},{"Id":8439,"Code":"PWRN","Name":null,"MessageCode":"PWRN","NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":0,"Template":"SCAIP-PWRN;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-PWRN;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":0,"NewValue":"{\"Id\":8439,\"Code\":\"PWRN\",\"Name\":null,\"MessageCode\":\"PWRN\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":0,\"Template\":\"SCAIP-PWRN;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-PWRN;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123466}],"Tags":[]},{"Id":8440,"Code":"TEST","Name":null,"MessageCode":"TEST","NeedAck":false,"IsAck":false,"IsFailAck":false,"IsAckHexString":false,"NoOperation":false,"Type":0,"Template":"SCAIP-TEST;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;","HasTemplateGlobal":false,"ResponseTemplate":"<<reference>> OK","TemplateGlobal":null,"LongConnection":false,"HexString":false,"AckFirst":false,"ScaipH":false,"DoNotSendCommands":false,"ProtocolsLibraryMethod":null,"ProtocolsLibraryMethodArgs":null,"Command":null,"CacheImei":false,"RegEx":"^SCAIP-TEST;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;","RegExGlobal":"","IsDeviceUpdate":false,"ProtocolActionObjects":[{"Type":0,"NewValue":"{\"Id\":8440,\"Code\":\"TEST\",\"Name\":null,\"MessageCode\":\"TEST\",\"NeedAck\":false,\"IsAck\":false,\"IsFailAck\":false,\"IsAckHexString\":false,\"NoOperation\":false,\"Type\":0,\"Template\":\"SCAIP-TEST;<<imei>>;<<event_time>>;<<device_id>>;<<device_type>>;<<controller_id>>;<<location_code>>;<<location_value>>;<<status_code>>;\",\"HasTemplateGlobal\":false,\"ResponseTemplate\":\"<<reference>> OK\",\"TemplateGlobal\":null,\"LongConnection\":false,\"HexString\":false,\"AckFirst\":false,\"ScaipH\":false,\"DoNotSendCommands\":false,\"ProtocolsLibraryMethod\":null,\"ProtocolsLibraryMethodArgs\":null,\"Command\":null,\"CacheImei\":false,\"RegEx\":\"^SCAIP-TEST;[^;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;[^;;]*;\",\"RegExGlobal\":\"\",\"IsDeviceUpdate\":false,\"ProtocolActionObjects\":[],\"Tags\":[]}","Timestamp":1789123469}],"Tags":[]}],"Commands":[],"Operations":[{"Id":90,"Name":"scaip","Operation":"// write your code here..\n// old code\n// var moment = require('moment');\n// // OPERATIONS START\n// var nowTime, event_time, location_time, send_time, location_accuracy, speed, fix_state, zone_id;\n// //Define defaults (in case variables not set) \n// nowTime = event_time = location_time = send_time = moment.utc().unix();\n// //if fix_state doesn't exist, set it to 0\n// msg.push({\n// 'code': 'event_time',\n// 'value': event_time\n// });\nfunction isLocalTesting() {\n return typeof require === \"undefined\";\n}\n\nfunction execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, localTesting) {\n var net = null;\n var moment = null;\n if (!isLocalTesting()) {\n net = require('net');\n moment = require('moment');\n }\n var codeValues = [];\n var tasks = [];\n var configsToAck = [];\n var configsToUpdate = [];\n var configsToSend = [];\n AddValue(codeValues, \"event_time\", Math.round(Date.now() / 1000));\n if (oystaTemplate == 'True') {}\n if (globalTemplate == \"True\") {\n const xml = raw;\n // AddValue(codeValues, \"reference\", getTagValue(xml, \"ref\"));\n // AddValue(codeValues, \"version\", getTagValue(xml, \"ver\"));\n // AddValue(codeValues, \"system_config\", getTagValue(xml, \"sco\"));\n // AddValue(codeValues, \"call-handling\", getTagValue(xml, \"cha\"));\n // AddValue(codeValues, \"heartbeat-options\", getTagValue(xml, \"hbo\"));\n // AddValue(codeValues, \"cid\", getTagValue(xml, \"cid\"));\n // AddValue(codeValues, \"device-type\", getTagValue(xml, \"dty\"));\n AddValue(codeValues, \"imei\", getTagValue(xml, \"did\"));\n // AddValue(codeValues, \"device-component\", getTagValue(xml, \"dco\"));\n // AddValue(codeValues, \"caller-id\", getTagValue(xml, \"cid\"));\n // AddValue(codeValues, \"status-text\", getTagValue(xml, \"stt\"));\n // AddValue(codeValues, \"priority\", getTagValue(xml, \"pri\"));\n // AddValue(codeValues, \"location-code\", getTagValue(xml, \"lco\"));\n // AddValue(codeValues, \"location-value\", getTagValue(xml, \"lva\"));\n // AddValue(codeValues, \"wgs-pos\", getTagValue(xml, \"geo\"));\n // AddValue(codeValues, \"time-stamp\", getTagValue(xml, \"tim\"));\n // AddValue(codeValues, \"gga-pos\", getTagValue(xml, \"gga\"));\n // AddValue(codeValues, \"location-text\", getTagValue(xml, \"lte\"));\n // AddValue(codeValues, \"info-code\", getTagValue(xml, \"ico\"));\n // AddValue(codeValues, \"info-text\", getTagValue(xml, \"ite\"));\n // AddValue(codeValues, \"additional-message\", getTagValue(xml, \"ame\"));\n // AddValue(codeValues, \"mty\", \"ME\");\n const statusCodeString = getTagValue(xml, \"stc\");\n const statusCode = parseInt(statusCodeString, 10);\n if (statusCode === 10) {\n let imei = getTagValue(xml, \"did\");\n let new_message = \"SCAIP-ALSOS;\" + imei + \";\";\n sendMessageToLocalhost(new_message);\n AddValue(codeValues, \"toSend\", new_message);\n }\n }\n var dataToReceiver = {\n 'values': codeValues\n };\n if (tasks.length > 0) {\n dataToReceiver.tasks = tasks\n };\n // only send data if we have some\n // if (codeValues !== undefined || codeValues.length !== 0) {\n console.log(dataToReceiver);\n // }\n return {\n 'output': dataToReceiver\n }\n}\n\nfunction getTagValue(xml, tagName) {\n const startTag = '<' + tagName + '>';\n const endTag = '</' + tagName + '>';\n let tagValue = '';\n if (xml.includes(startTag)) {\n tagValue = xml.substring(xml.lastIndexOf(startTag) + startTag.length, xml.lastIndexOf(endTag));\n }\n return tagValue;\n}\n\nfunction createConnection(port, server) {\n c = net.createConnection(port, server);\n c.on('error', function(error) {\n c = createConnection(port, server);\n });\n return c;\n}\n\nfunction sendMessageToLocalhost(str) {\n if (isLocalTesting()) {\n console.log(\"Sending message to server: \" + str);\n } else {\n var server = '127.0.0.1';\n // acceptance\n var c = createConnection(5678, server);\n // protocol-dev\n //var c = createConnection(5878, server);\n c.write(`${str}`);\n c.end();\n }\n}\n\nfunction AddValue(msgArray, p1, p2) {\n var cvpair = {\n code: p1,\n value: p2\n };\n msgArray.push(cvpair);\n}\nif (!isLocalTesting()) {\n let return_values = execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, false)\n // map output to global var\n dataToReceiver = return_values.output;\n}","Type":0,"ProtocolActionObjects":[{"Type":1,"NewValue":"{\"Id\":90,\"Name\":\"scaip\",\"Operation\":\"// write your code here..\\n// old code\\n// var moment = require('moment');\\n// // OPERATIONS START\\n// var nowTime, event_time, location_time, send_time, location_accuracy, speed, fix_state, zone_id;\\n// //Define defaults (in case variables not set) \\n// nowTime = event_time = location_time = send_time = moment.utc().unix();\\n// //if fix_state doesn't exist, set it to 0\\n// msg.push({\\n// 'code': 'event_time',\\n// 'value': event_time\\n// });\\nfunction isLocalTesting() {\\n return typeof require === \\\"undefined\\\";\\n}\\n\\nfunction execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, localTesting) {\\n var net = null;\\n var moment = null;\\n if (!isLocalTesting()) {\\n net = require('net');\\n moment = require('moment');\\n }\\n var codeValues = [];\\n var tasks = [];\\n var configsToAck = [];\\n var configsToUpdate = [];\\n var configsToSend = [];\\n AddValue(codeValues, \\\"event_time\\\", Math.round(Date.now() / 1000));\\n if (oystaTemplate == 'True') {}\\n if (globalTemplate == \\\"True\\\") {\\n const xml = raw;\\n // AddValue(codeValues, \\\"reference\\\", getTagValue(xml, \\\"ref\\\"));\\n // AddValue(codeValues, \\\"version\\\", getTagValue(xml, \\\"ver\\\"));\\n // AddValue(codeValues, \\\"system_config\\\", getTagValue(xml, \\\"sco\\\"));\\n // AddValue(codeValues, \\\"call-handling\\\", getTagValue(xml, \\\"cha\\\"));\\n // AddValue(codeValues, \\\"heartbeat-options\\\", getTagValue(xml, \\\"hbo\\\"));\\n // AddValue(codeValues, \\\"cid\\\", getTagValue(xml, \\\"cid\\\"));\\n // AddValue(codeValues, \\\"device-type\\\", getTagValue(xml, \\\"dty\\\"));\\n AddValue(codeValues, \\\"imei\\\", getTagValue(xml, \\\"crd\\\").replace(\\\"tel:+\\\", \\\"\\\"));\\n // AddValue(codeValues, \\\"device-component\\\", getTagValue(xml, \\\"dco\\\"));\\n // AddValue(codeValues, \\\"caller-id\\\", getTagValue(xml, \\\"cid\\\"));\\n // AddValue(codeValues, \\\"status-text\\\", getTagValue(xml, \\\"stt\\\"));\\n // AddValue(codeValues, \\\"priority\\\", getTagValue(xml, \\\"pri\\\"));\\n // AddValue(codeValues, \\\"location-code\\\", getTagValue(xml, \\\"lco\\\"));\\n // AddValue(codeValues, \\\"location-value\\\", getTagValue(xml, \\\"lva\\\"));\\n // AddValue(codeValues, \\\"wgs-pos\\\", getTagValue(xml, \\\"geo\\\"));\\n // AddValue(codeValues, \\\"time-stamp\\\", getTagValue(xml, \\\"tim\\\"));\\n // AddValue(codeValues, \\\"gga-pos\\\", getTagValue(xml, \\\"gga\\\"));\\n // AddValue(codeValues, \\\"location-text\\\", getTagValue(xml, \\\"lte\\\"));\\n // AddValue(codeValues, \\\"info-code\\\", getTagValue(xml, \\\"ico\\\"));\\n // AddValue(codeValues, \\\"info-text\\\", getTagValue(xml, \\\"ite\\\"));\\n // AddValue(codeValues, \\\"additional-message\\\", getTagValue(xml, \\\"ame\\\"));\\n // AddValue(codeValues, \\\"mty\\\", \\\"ME\\\");\\n const statusCodeString = getTagValue(xml, \\\"stc\\\");\\n const statusCode = parseInt(statusCodeString, 10);\\n if (statusCode === 10) {\\n let imei = getTagValue(xml, \\\"crd\\\").replace(\\\"tel:+\\\", \\\"\\\");\\n let new_message = \\\"SCAIP-ALSOS;\\\" + imei + \\\";\\\";\\n sendMessageToLocalhost(new_message);\\n AddValue(codeValues, \\\"toSend\\\", new_message);\\n }\\n }\\n var dataToReceiver = {\\n 'values': codeValues\\n };\\n if (tasks.length > 0) {\\n dataToReceiver.tasks = tasks\\n };\\n // only send data if we have some\\n // if (codeValues !== undefined || codeValues.length !== 0) {\\n console.log(dataToReceiver);\\n // }\\n return {\\n 'output': dataToReceiver\\n }\\n}\\n\\nfunction getTagValue(xml, tagName) {\\n const startTag = '<' + tagName + '>';\\n const endTag = '</' + tagName + '>';\\n let tagValue = '';\\n if (xml.includes(startTag)) {\\n tagValue = xml.substring(xml.lastIndexOf(startTag) + startTag.length, xml.lastIndexOf(endTag));\\n }\\n return tagValue;\\n}\\n\\nfunction createConnection(port, server) {\\n c = net.createConnection(port, server);\\n c.on('error', function(error) {\\n c = createConnection(port, server);\\n });\\n return c;\\n}\\n\\nfunction sendMessageToLocalhost(str) {\\n if (isLocalTesting()) {\\n console.log(\\\"Sending message to server: \\\" + str);\\n } else {\\n var server = '127.0.0.1';\\n // acceptance\\n var c = createConnection(5678, server);\\n // protocol-dev\\n //var c = createConnection(5878, server);\\n c.write(`${str}`);\\n c.end();\\n }\\n}\\n\\nfunction AddValue(msgArray, p1, p2) {\\n var cvpair = {\\n code: p1,\\n value: p2\\n };\\n msgArray.push(cvpair);\\n}\\nif (!isLocalTesting()) {\\n let return_values = execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, false)\\n // map output to global var\\n dataToReceiver = return_values.output;\\n}\",\"Type\":0,\"ProtocolActionObjects\":[]}","Timestamp":1787139159},{"Type":1,"NewValue":"{\"Id\":90,\"Name\":\"scaip\",\"Operation\":\"// write your code here..\\n// old code\\n// var moment = require('moment');\\n// // OPERATIONS START\\n// var nowTime, event_time, location_time, send_time, location_accuracy, speed, fix_state, zone_id;\\n// //Define defaults (in case variables not set) \\n// nowTime = event_time = location_time = send_time = moment.utc().unix();\\n// //if fix_state doesn't exist, set it to 0\\n// msg.push({\\n// 'code': 'event_time',\\n// 'value': event_time\\n// });\\nfunction isLocalTesting() {\\n return typeof require === \\\"undefined\\\";\\n}\\n\\nfunction execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, localTesting) {\\n var net = null;\\n var moment = null;\\n if (!isLocalTesting()) {\\n net = require('net');\\n moment = require('moment');\\n }\\n var codeValues = [];\\n var tasks = [];\\n var configsToAck = [];\\n var configsToUpdate = [];\\n var configsToSend = [];\\n AddValue(codeValues, \\\"event_time\\\", Math.round(Date.now() / 1000));\\n if (oystaTemplate == 'True') {}\\n if (globalTemplate == \\\"True\\\") {\\n const xml = raw;\\n const imei = getTagValue(xml, \\\"crd\\\").replace(\\\"tel:+\\\", \\\"\\\");\\n // AddValue(codeValues, \\\"reference\\\", getTagValue(xml, \\\"ref\\\"));\\n // AddValue(codeValues, \\\"version\\\", getTagValue(xml, \\\"ver\\\"));\\n // AddValue(codeValues, \\\"system_config\\\", getTagValue(xml, \\\"sco\\\"));\\n // AddValue(codeValues, \\\"call-handling\\\", getTagValue(xml, \\\"cha\\\"));\\n // AddValue(codeValues, \\\"heartbeat-options\\\", getTagValue(xml, \\\"hbo\\\"));\\n // AddValue(codeValues, \\\"cid\\\", getTagValue(xml, \\\"cid\\\"));\\n // AddValue(codeValues, \\\"device-type\\\", getTagValue(xml, \\\"dty\\\"));\\n AddValue(codeValues, \\\"imei\\\", imei);\\n // AddValue(codeValues, \\\"device-component\\\", getTagValue(xml, \\\"dco\\\"));\\n // AddValue(codeValues, \\\"caller-id\\\", getTagValue(xml, \\\"cid\\\"));\\n // AddValue(codeValues, \\\"status-text\\\", getTagValue(xml, \\\"stt\\\"));\\n // AddValue(codeValues, \\\"priority\\\", getTagValue(xml, \\\"pri\\\"));\\n // AddValue(codeValues, \\\"location-code\\\", getTagValue(xml, \\\"lco\\\"));\\n // AddValue(codeValues, \\\"location-value\\\", getTagValue(xml, \\\"lva\\\"));\\n // AddValue(codeValues, \\\"wgs-pos\\\", getTagValue(xml, \\\"geo\\\"));\\n // AddValue(codeValues, \\\"time-stamp\\\", getTagValue(xml, \\\"tim\\\"));\\n // AddValue(codeValues, \\\"gga-pos\\\", getTagValue(xml, \\\"gga\\\"));\\n // AddValue(codeValues, \\\"location-text\\\", getTagValue(xml, \\\"lte\\\"));\\n // AddValue(codeValues, \\\"info-code\\\", getTagValue(xml, \\\"ico\\\"));\\n // AddValue(codeValues, \\\"info-text\\\", getTagValue(xml, \\\"ite\\\"));\\n // AddValue(codeValues, \\\"additional-message\\\", getTagValue(xml, \\\"ame\\\"));\\n // AddValue(codeValues, \\\"mty\\\", \\\"ME\\\");\\n const statusCodeString = getTagValue(xml, \\\"stc\\\");\\n const statusCode = parseInt(statusCodeString, 10);\\n if (statusCode === 10) {\\n let new_message = \\\"SCAIP-ALSOS;\\\" + imei + \\\";\\\";\\n sendMessageToLocalhost(new_message);\\n AddValue(codeValues, \\\"toSend\\\", new_message);\\n }\\n }\\n var dataToReceiver = {\\n 'values': codeValues\\n };\\n if (tasks.length > 0) {\\n dataToReceiver.tasks = tasks\\n };\\n // only send data if we have some\\n // if (codeValues !== undefined || codeValues.length !== 0) {\\n console.log(dataToReceiver);\\n // }\\n return {\\n 'output': dataToReceiver\\n }\\n}\\n\\nfunction getTagValue(xml, tagName) {\\n const startTag = '<' + tagName + '>';\\n const endTag = '</' + tagName + '>';\\n let tagValue = '';\\n if (xml.includes(startTag)) {\\n tagValue = xml.substring(xml.lastIndexOf(startTag) + startTag.length, xml.lastIndexOf(endTag));\\n }\\n return tagValue;\\n}\\n\\nfunction createConnection(port, server) {\\n c = net.createConnection(port, server);\\n c.on('error', function(error) {\\n c = createConnection(port, server);\\n });\\n return c;\\n}\\n\\nfunction sendMessageToLocalhost(str) {\\n if (isLocalTesting()) {\\n console.log(\\\"Sending message to server: \\\" + str);\\n } else {\\n var server = '127.0.0.1';\\n // acceptance\\n var c = createConnection(5678, server);\\n // protocol-dev\\n //var c = createConnection(5878, server);\\n c.write(`${str}`);\\n c.end();\\n }\\n}\\n\\nfunction AddValue(msgArray, p1, p2) {\\n var cvpair = {\\n code: p1,\\n value: p2\\n };\\n msgArray.push(cvpair);\\n}\\nif (!isLocalTesting()) {\\n let return_values = execute_ops(msg, params, rawFromBytes, raw, oystaTemplate, globalTemplate, arrays, commandsToExecute, serverParams, messageTypeCode, messageTypeLocalCode, messageTypeName, configs, configIds, commandsWaiting, false)\\n // map output to global var\\n dataToReceiver = return_values.output;\\n}\",\"Type\":0,\"ProtocolActionObjects\":[]}","Timestamp":1787139375},{"Type":1,"NewValue":"{\"Id\":90,\"Name\":\"scaip\",\"Operation\":\"// SCAIP (SCAIP 1.3 over SIP MESSAGE) operation script for protocol Scaip v0.5.\\n//\\n// Inbound stage (globalTemplate == \\\"True\\\", message type COMM, template \\\"<mrq><<data>>\\\"):\\n// every tag of the incoming <mrq> is exposed as a code/value pair and the message is\\n// re-formed into an Oysta message that is written back to the receiver on localhost:\\n//\\n// SCAIP-<message code>;<imei>;<event_time>;<did>;<dty>;<cid>;<lco>;<lva>;<stc>;\\n//\\n// The message code is resolved from the SCAIP status code (stc), refined by the\\n// reporting device type (dty), so a smoke detector alarm becomes ALSM instead of the\\n// generic ALSOS emergency.\\n//\\n// Oysta stage (globalTemplate == \\\"False\\\"): the re-formed message is parsed by the Oysta\\n// template of the matching message type (ALSOS, ALSM, ...) and the parsed parameters are\\n// enriched with human readable names for the notification templates.\\n\\n// SCAIP status code (stc) -> Oysta message code. Only codes that have a message type on the\\n// Scaip protocol are mapped, anything else falls back to the generic emergency so no message\\n// is ever lost. See Scaip_status_codes.md for the codes that were reviewed but not enabled.\\nvar STATUS_CODES = {\\n \\\"0010\\\": \\\"ALSOS\\\", // manual alarm / emergency\\n \\\"0016\\\": \\\"BATL\\\", // low battery\\n \\\"0085\\\": \\\"PWRF\\\", // mains power failure\\n \\\"0086\\\": \\\"PWRN\\\", // mains power restored\\n \\\"0102\\\": \\\"TEST\\\" // test transmission\\n};\\n\\n// Alarms are reported with the generic manual alarm status code, the reporting device type\\n// (dty) is what tells us which kind of alarm it actually is.\\nvar ALARM_CODES_BY_DEVICE_TYPE = {\\n \\\"0023\\\": \\\"ALSM\\\" // smoke detector\\n};\\n\\nvar DEVICE_TYPES = {\\n \\\"0002\\\": \\\"Local unit and controller\\\",\\n \\\"0003\\\": \\\"Personal trigger\\\",\\n \\\"0004\\\": \\\"Fixed trigger\\\",\\n \\\"0005\\\": \\\"Fall detector\\\",\\n \\\"0007\\\": \\\"Panic alarm button\\\",\\n \\\"0023\\\": \\\"Smoke detector\\\",\\n \\\"0026\\\": \\\"Carbon monoxide detector\\\",\\n \\\"0033\\\": \\\"Flood detector\\\",\\n \\\"0041\\\": \\\"Power supply\\\"\\n};\\n\\n// Tags of the inbound <mrq> that are exposed as code/value pairs for logging and templates.\\nvar TAGS = [\\\"ref\\\", \\\"ver\\\", \\\"sco\\\", \\\"cha\\\", \\\"hbo\\\", \\\"cid\\\", \\\"dty\\\", \\\"did\\\", \\\"dco\\\", \\\"dte\\\", \\\"crd\\\",\\n \\\"stc\\\", \\\"stt\\\", \\\"pri\\\", \\\"lco\\\", \\\"lva\\\", \\\"geo\\\", \\\"tim\\\", \\\"gga\\\", \\\"lte\\\", \\\"ico\\\", \\\"ite\\\", \\\"ame\\\"];\\n\\nvar UNKNOWN = \\\"unknown\\\";\\nvar LOCALHOST = \\\"127.0.0.1\\\";\\nvar LOCALHOST_PORT = 5678;\\n\\nfunction execute_ops(msg,\\n params,\\n rawFromBytes,\\n raw,\\n oystaTemplate,\\n globalTemplate,\\n arrays,\\n commandsToExecute,\\n serverParams,\\n messageTypeCode,\\n messageTypeLocalCode,\\n messageTypeName,\\n configs,\\n configIds,\\n commandsWaiting,\\n localTesting) {\\n\\n // net and moment are provided by the receiver, locally only the tests run this script\\n var testing = localTesting || typeof net === \\\"undefined\\\";\\n var codeValues = [];\\n var tasks = [];\\n\\n if (globalTemplate == \\\"True\\\") {\\n var event_time = typeof moment === \\\"undefined\\\" ? Math.round(Date.now() / 1000) : moment.utc().unix();\\n AddValue(codeValues, \\\"event_time\\\", event_time);\\n\\n var imei = getTagValue(raw, \\\"crd\\\").replace(\\\"tel:+\\\", \\\"\\\").replace(\\\"gsm:\\\", \\\"\\\");\\n AddValue(codeValues, \\\"imei\\\", imei);\\n\\n // keep every tag of the inbound message available\\n for (var i = 0; i < TAGS.length; i++) {\\n var tagValue = getTagValue(raw, TAGS[i]);\\n if (tagValue !== \\\"\\\")\\n AddValue(codeValues, TAGS[i], tagValue);\\n }\\n\\n var statusCode = getTagValue(raw, \\\"stc\\\");\\n var deviceType = getTagValue(raw, \\\"dty\\\");\\n var messageCode = getMessageCode(statusCode, deviceType);\\n AddValue(codeValues, \\\"message_code\\\", messageCode);\\n\\n var new_message = \\\"SCAIP-\\\" + messageCode + \\\";\\\" +\\n imei + \\\";\\\" +\\n event_time + \\\";\\\" +\\n orUnknown(getTagValue(raw, \\\"did\\\")) + \\\";\\\" +\\n orUnknown(deviceType) + \\\";\\\" +\\n orUnknown(getTagValue(raw, \\\"cid\\\")) + \\\";\\\" +\\n orUnknown(getTagValue(raw, \\\"lco\\\")) + \\\";\\\" +\\n orUnknown(getTagValue(raw, \\\"lva\\\")) + \\\";\\\" +\\n orUnknown(statusCode) + \\\";\\\";\\n\\n sendMessageToLocalhost(new_message, testing);\\n AddValue(codeValues, \\\"toSend\\\", new_message);\\n } else {\\n AddValue(codeValues, \\\"device_type_name\\\", DEVICE_TYPES[params.device_type] || UNKNOWN);\\n }\\n\\n var dataToReceiver = {\\n 'values': codeValues\\n };\\n if (tasks.length > 0) {\\n dataToReceiver.tasks = tasks\\n };\\n return dataToReceiver;\\n}\\n\\nfunction getMessageCode(statusCode, deviceType) {\\n var messageCode = STATUS_CODES[statusCode];\\n if (messageCode === \\\"ALSOS\\\" && ALARM_CODES_BY_DEVICE_TYPE[deviceType])\\n return ALARM_CODES_BY_DEVICE_TYPE[deviceType];\\n // an unmapped status code is still reported, as a generic emergency\\n return messageCode || \\\"ALSOS\\\";\\n}\\n\\nfunction orUnknown(value) {\\n return value === undefined || value === null || value === \\\"\\\" ? UNKNOWN : value;\\n}\\n\\nfunction getTagValue(xml, tagName) {\\n var startTag = '<' + tagName + '>';\\n var endTag = '</' + tagName + '>';\\n var tagValue = '';\\n if (xml && xml.includes(startTag) && xml.includes(endTag))\\n tagValue = xml.substring(xml.lastIndexOf(startTag) + startTag.length, xml.lastIndexOf(endTag));\\n return tagValue.trim();\\n}\\n\\nfunction createConnection(port, server) {\\n c = net.createConnection(port, server);\\n c.on('error', function(error) {\\n c = createConnection(port, server);\\n });\\n return c;\\n}\\n\\nfunction sendMessageToLocalhost(str, testing) {\\n if (!testing) {\\n var c = createConnection(LOCALHOST_PORT, LOCALHOST);\\n c.write(`${str}`);\\n c.end();\\n }\\n}\\n\\nfunction AddValue(msgArray, p1, p2) {\\n var cvpair = {\\n code: p1,\\n value: p2\\n };\\n msgArray.push(cvpair);\\n}\\n\\n// params is not defined locally -> export as module\\nif (typeof(params) === 'undefined') {\\n module.exports = {\\n execute_ops\\n }\\n} else { // on server use local defined vars\\n let return_values = execute_ops(msg,\\n params,\\n rawFromBytes,\\n raw,\\n oystaTemplate,\\n globalTemplate,\\n arrays,\\n commandsToExecute,\\n serverParams,\\n messageTypeCode,\\n messageTypeLocalCode,\\n messageTypeName,\\n configs,\\n configIds,\\n commandsWaiting,\\n false)\\n\\n // the receiver prints msg as JSON when it is not empty\\n msg = return_values.values;\\n}\\n\",\"Type\":0,\"ProtocolActionObjects\":[]}","Timestamp":1789123480}]}],"Groups":[],"GroupParams":[],"ProtocolChanges":[{"Version":"0.2","UserName":"Sean-Admin","Resource":"MessageType","Name":"COMM","Message":"(Update) (COMM) limit treaffic to scaip xml","Timestamp":1780931248},{"Version":"0.2","UserName":"Sean-Admin","Resource":"Protocol","Name":null,"Message":"limiting traffic to scaip payload\n","Timestamp":1780931416},{"Version":"0.3","UserName":"Sean-Admin","Resource":"MessageType","Name":"COMM","Message":"(Update) (COMM) remove end tag","Timestamp":1780931624},{"Version":"0.3","UserName":"Sean-Admin","Resource":"Protocol","Name":null,"Message":"no end tag","Timestamp":1780931638},{"Version":"0.4","UserName":"Sean-Admin","Resource":"Operation","Name":"scaip","Message":"(Update) (scaip) create imei on crd value","Timestamp":1787139159},{"Version":"0.4","UserName":"Sean-Admin","Resource":"Operation","Name":"scaip","Message":"(Update) (scaip) a bit nicer","Timestamp":1787139375},{"Version":"0.4","UserName":"Sean-Admin","Resource":"Protocol","Name":null,"Message":"Fix vibby usecase by using <crd> as imei (tel number)","Timestamp":1787139558},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":null,"Message":"(Update) () ","Timestamp":1789123286},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"ALSOS","Message":"(Update) (ALSOS) ","Timestamp":1789123414},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"ALSM","Message":"(Create) (ALSM) ","Timestamp":1789123439},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"BATL","Message":"(Create) (BATL) ","Timestamp":1789123462},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"PWRF","Message":"(Create) (PWRF) ","Timestamp":1789123464},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"PWRN","Message":"(Create) (PWRN) ","Timestamp":1789123466},{"Version":"0.5","UserName":"Test-Admin","Resource":"MessageType","Name":"TEST","Message":"(Create) (TEST) ","Timestamp":1789123469},{"Version":"0.5","UserName":"Test-Admin","Resource":"Operation","Name":"scaip","Message":"(Update) (scaip) ","Timestamp":1789123480}],"ProtocolActionObjects":[],"Tags":[],"MessageCodes":[{"Name":"Alarm - Movement","Description":"At alert on movement ( not fall)","Code":"ALMOV","CanLiveInsights":false},{"Name":"Alarm-Welfare Check","Description":"Welfare check alarm","Code":"ALW","CanLiveInsights":false},{"Name":"Cycle","Description":"Regular, cyclic, events from a device","Code":"CYC","CanLiveInsights":false},{"Name":"Location - other","Description":"Location - other","Code":"LOCN","CanLiveInsights":false},{"Name":"Acknowledge","Description":"Acknowledgment of a command sent to the device","Code":"ACK","CanLiveInsights":false},{"Name":"Battery Charging - On","Description":"Battery Charging - On","Code":"BATCN","CanLiveInsights":false},{"Name":"Check / keep alive / Heartbeat","Description":"Keep alive / heartbeat signal to maintain a connection ","Code":"CHK","CanLiveInsights":false},{"Name":"Alarm - Amber Alert","Description":"Alarm - Amber Alert","Code":"ALA","CanLiveInsights":false},{"Name":"Alarm – Fall","Description":"Alarm – Fall","Code":"ALF","CanLiveInsights":false},{"Name":"Alarm – Non movement","Description":"Alarm – Non movement","Code":"ALNM","CanLiveInsights":false},{"Name":"Alarm - Smoke","Description":"Alarm - Smoke","Code":"ALSM","CanLiveInsights":false},{"Name":"Alarm - Speed","Description":"Alarm - Speed","Code":"ALSP","CanLiveInsights":false},{"Name":"Alarm – Emergency Cancelled","Description":"Alarm – Emergency Cancelled by the user","Code":"ALSOS-C","CanLiveInsights":false},{"Name":"Battery Charging - off","Description":"Battery Charging - off","Code":"BATCF","CanLiveInsights":false},{"Name":"Battery empty","Description":"Battery empty","Code":"BATE","CanLiveInsights":false},{"Name":"Battery full","Description":"Battery full","Code":"BATF","CanLiveInsights":false},{"Name":"Battery low","Description":"Battery low","Code":"BATL","CanLiveInsights":false},{"Name":"Button Press","Description":"Button Press","Code":"BPRS","CanLiveInsights":false},{"Name":"Ebeacon zone in","Description":"Ebeacon zone in","Code":"EBZI","CanLiveInsights":false},{"Name":"Ebeacon zone out","Description":"Ebeacon zone out","Code":"EBZO","CanLiveInsights":false},{"Name":"Location check in","Description":"Location check in","Code":"LCI","CanLiveInsights":false},{"Name":"Location check out","Description":"Location check out","Code":"LCO","CanLiveInsights":false},{"Name":"Reminder not ok","Description":"Reminder not ok","Code":"MRME","CanLiveInsights":false},{"Name":"No Activity","Description":"No Activity","Code":"NACT","CanLiveInsights":false},{"Name":"Power Off","Description":"Power Off","Code":"PWRF","CanLiveInsights":false},{"Name":"Power On","Description":"Power On","Code":"PWRN","CanLiveInsights":false},{"Name":"Vehicle - Driving hours excess","Description":"Vehicle - Driving hours excess","Code":"VDE","CanLiveInsights":false},{"Name":"Vehicle – Fuel cap","Description":"Vehicle – Fuel cap","Code":"VFC","CanLiveInsights":false},{"Name":"Vehicle - Fuel level","Description":"Vehicle - Fuel level","Code":"VFL","CanLiveInsights":false},{"Name":"Vehicle – Harsh braking","Description":"Vehicle – Harsh braking","Code":"VHB","CanLiveInsights":false},{"Name":"Vehicle – Ignition off","Description":"Vehicle – Ignition off","Code":"VIGF","CanLiveInsights":false},{"Name":"Vehicle – Driver not authorized","Description":"Vehicle – Driver not authorized","Code":"VNA","CanLiveInsights":false},{"Name":"Vehicle – Night driving","Description":"Vehicle – Night driving","Code":"VND","CanLiveInsights":false},{"Name":"Vehicle – Ignition on","Description":"Vehicle – Ignition on","Code":"VIGN","CanLiveInsights":false},{"Name":"Vehicle – Seat belt","Description":"Vehicle – Seat belt","Code":"VSB","CanLiveInsights":false},{"Name":"Zone in","Description":"Zone in","Code":"ZNI","CanLiveInsights":false},{"Name":"Zone out","Description":"Zone out","Code":"ZNO","CanLiveInsights":false},{"Name":"Device Status","Description":"Device Status","Code":"STATUS","CanLiveInsights":false},{"Name":"Real time location ","Description":"Real time location ","Code":"RTL","CanLiveInsights":false},{"Name":"Encoded communication","Description":"Encoded communication","Code":"ENC","CanLiveInsights":false},{"Name":"Proximity","Description":"Proximity alert ","Code":"PROX","CanLiveInsights":false},{"Name":"Dummy - do NOT use ","Description":"Dummy template - should not be used","Code":"DUMMY","CanLiveInsights":false},{"Name":"Battery High","Description":"Battery High","Code":"BATH","CanLiveInsights":false},{"Name":"Location - Set Available","Description":"Location - Set Available","Code":"LSA","CanLiveInsights":false},{"Name":"Location - Set Busy","Description":"Location - Set Busy","Code":"LSB","CanLiveInsights":false},{"Name":"Device information","Description":"General Device Information from the device","Code":"INFO","CanLiveInsights":false},{"Name":"Alarm - Tamper","Description":"Alarm - Device Tamper","Code":"ALTAM","CanLiveInsights":false},{"Name":"Communication ","Description":"General communication, initialisation etc.","Code":"COMM","CanLiveInsights":false},{"Name":"Humidity","Description":"Relative humidity","Code":"RH","CanLiveInsights":false},{"Name":"Temperature","Description":"Temperature","Code":"TEMP","CanLiveInsights":false},{"Name":"Alarm - Temperature","Description":"Alarm - Temperature","Code":"ALTEMP","CanLiveInsights":false},{"Name":"Alarm - Humidity","Description":"Alarm - Relative Humidity","Code":"ALRH","CanLiveInsights":false},{"Name":"Proximity End","Description":"Proximity End","Code":"PROX-E","CanLiveInsights":false},{"Name":"Alarm - PIR","Description":"Alarm - PIR","Code":"ALPIR","CanLiveInsights":false},{"Name":"PIR - Movements","Description":"Number of PIR movements detected in reporting period","Code":"PIRM","CanLiveInsights":false},{"Name":"Battery Report","Description":"Battery Voltage Report","Code":"BATR","CanLiveInsights":false},{"Name":"Alarm - Sim Swap","Description":"Alarm - Sim Swap","Code":"ALSS","CanLiveInsights":false},{"Name":"Mileage","Description":"Mileage","Code":"MIL","CanLiveInsights":false},{"Name":"Intrusion","Description":"Intrusion","Code":"INT","CanLiveInsights":false},{"Name":"No Fix Report","Description":"No fix report","Code":"NFR","CanLiveInsights":false},{"Name":"Switched Off Report","Description":"Switched off report","Code":"SOR","CanLiveInsights":false},{"Name":"End - Shift","Description":"End - Shift","Code":"ENDSH","CanLiveInsights":false},{"Name":"Sleep Mode","Description":"Device comes to sleep mode","Code":"SPM","CanLiveInsights":false},{"Name":"Wake Up Device","Description":"Device Wake Up from SleepMode","Code":"WUD","CanLiveInsights":false},{"Name":"Door Closed","Description":"Door Closed","Code":"DRCL","CanLiveInsights":false},{"Name":"Door Open","Description":"Door Open","Code":"DRO","CanLiveInsights":false},{"Name":"Alarm Door Closed","Description":"Alarm Door Closed","Code":"ALDC","CanLiveInsights":false},{"Name":"Alarm Door Open","Description":"Alarm Door Open","Code":"ALDO","CanLiveInsights":false},{"Name":"Alarm - Amber Alert - Snooze","Description":"Amber Alert Alarm - snoozed by user","Code":"ALA-S","CanLiveInsights":false},{"Name":"Amber Alert - On","Description":"Amber Alert Alarm created by User","Code":"ALA-O","CanLiveInsights":false},{"Name":"Reminder OK","Description":"Reminder OK","Code":"MRMK","CanLiveInsights":false},{"Name":"Message - text","Description":"Message- text","Code":"MSG","CanLiveInsights":false},{"Name":"Start - Shift","Description":"Start- Shift","Code":"STSH","CanLiveInsights":false},{"Name":"Beacon","Description":"Beacon","Code":"BT","CanLiveInsights":false},{"Name":"Alarm - Amber Alert - Cancel","Description":"Amber alert alarm, cancelled by user","Code":"ALA-C","CanLiveInsights":false},{"Name":"Alarm-Impact","Description":"Alarm-Impact","Code":"ALI","CanLiveInsights":false},{"Name":"Reminder Snooze ","Description":"Reminder - snooze","Code":"MRM-S","CanLiveInsights":false},{"Name":"Blood Pressure","Description":"Blood Pressure","Code":"HBP","CanLiveInsights":false},{"Name":"Heart Rate","Description":"Heart Rate","Code":"HRT","CanLiveInsights":false},{"Name":"SELFTEST","Description":"Used for Testing Purposes","Code":"TEST","CanLiveInsights":false},{"Name":"Alarm - Fall Cancelled","Description":"Alarm - Fall Cancelled","Code":"ALF-C","CanLiveInsights":false},{"Name":"Alarm – Non Movement Cancelled","Description":"Alarm – Non movement Cancelled by the user","Code":"ALNM-C","CanLiveInsights":false},{"Name":"Insight","Description":"Insight","Code":"INSIGHT","CanLiveInsights":false},{"Name":"Quantity Drunk","Description":"Quantity of liquid drunk ","Code":"QDRNK","CanLiveInsights":false},{"Name":"Bed - in","Description":"Bed or seat sensor ","Code":"BEDIN","CanLiveInsights":false},{"Name":"Bed - Out","Description":"Bed / seat sensor","Code":"BEDOUT","CanLiveInsights":false},{"Name":"Leak sensor","Description":"Leak detected ","Code":"LEAK","CanLiveInsights":false},{"Name":"Light - Lux","Description":"Light levels - LUX ","Code":"LUX","CanLiveInsights":false},{"Name":"Exited","Description":"Exited","Code":"EXIT","CanLiveInsights":false},{"Name":"Entered","Description":"Entered","Code":"ENTER","CanLiveInsights":false},{"Name":"Answered Door","Description":"Answered Door","Code":"ANSWDR","CanLiveInsights":false},{"Name":"Alarm – Emergency","Description":"Alarm – Emergency","Code":"ALSOS","CanLiveInsights":true},{"Name":"Alarm – Gas","Description":"Alarm – Gas ( carbon monixide, carbon dioxide, propane, butane ) ","Code":"ALG","CanLiveInsights":false},{"Name":"Leak Off","Description":"Leak detection has stopped alerting","Code":"LEAK-OFF","CanLiveInsights":false},{"Name":"Question-Answer","Description":"Question - Answer response","Code":"Q-A","CanLiveInsights":false},{"Name":"Visitor Arrived","Description":"Visitor Arrived","Code":"VISARR","CanLiveInsights":true},{"Name":"Visitor Departed","Description":"Visitor Departed","Code":"VISDEP","CanLiveInsights":true},{"Name":"Docked","Description":"Device placed in docking station","Code":"DOCK-IN","CanLiveInsights":false},{"Name":"Undocked","Description":"Device removed from docking station","Code":"DOCK-OUT","CanLiveInsights":false},{"Name":"Gas concentrarion","Description":"Gas concentrarion (ppm)","Code":"GAS","CanLiveInsights":false},{"Name":"Distance ","Description":"Distance measurement, could be level, proximity etc ","Code":"DIST","CanLiveInsights":false},{"Name":"Alarm Distance","Description":"Alarm on distance measurement, could be level, proximity etc ","Code":"ALDIST","CanLiveInsights":false},{"Name":"Welfare OK","Description":"Welfare check has returned OK","Code":"WELFOK","CanLiveInsights":false},{"Name":"Steps","Description":"Step counter","Code":"STEPS","CanLiveInsights":true},{"Name":"Connection","Description":"Connection","Code":"CON","CanLiveInsights":false},{"Name":"Disconnection","Description":"Disconnect","Code":"DISCON","CanLiveInsights":false},{"Name":"Position By Button","Description":"Position By Button","Code":"PBB","CanLiveInsights":false},{"Name":"Alarm Welfare","Description":"Alert welfare not confirmed","Code":"ALA-W","CanLiveInsights":false},{"Name":"Welfare Timer Starts","Description":"Welfare Check in","Code":"WTS","CanLiveInsights":false},{"Name":"Welfare Stops","Description":"Welfare Check out","Code":"WSTP","CanLiveInsights":false},{"Name":"Alarm Ended","Description":"Alarm finished","Code":"ALA-F","CanLiveInsights":false},{"Name":"BRTH - Breath Rate","Description":"Rate of Breathing per minute","Code":"BRTH","CanLiveInsights":false},{"Name":"Sleep State","Description":"Sleep state ","Code":"SLPSTATE","CanLiveInsights":false},{"Name":"Alarm - Tilt","Description":"Alarm - Tilt Alert","Code":"ALTLT","CanLiveInsights":false},{"Name":"Alert – Fall Suspected","Description":"Alert – Fall Suspected","Code":"ALFS","CanLiveInsights":false},{"Name":"testMCImportExport","Description":"A test message code to verify it imports correctly into Acceptance! Modify Description.","Code":"testMCImportExport","CanLiveInsights":false},{"Name":"gaurav_code_name","Description":"gaurav_code_desc","Code":"gaurav_code","CanLiveInsights":false},{"Name":"SPO2","Description":"blood oxygen saturation","Code":"SPO2","CanLiveInsights":false},{"Name":"Command","Description":"Send a command to a protocol","Code":"CMD","CanLiveInsights":false},{"Name":"OTA - Battery Low","Description":"OTA procedure interrupted due to battery low","Code":"OBTL","CanLiveInsights":false}]}