UNPKG

@apidaze/node-red-contrib-apidaze

Version:
1,043 lines 25.2 kB
[ { "id": "90e2864e.2a7a88", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "1e233faa.bf1ab", "type": "tab", "label": "Sample data for the call flow", "disabled": false, "info": "" }, { "id": "9c6526f3.469b58", "type": "config", "name": "Main account #1" }, { "id": "8f39db96.dbcec8", "type": "webhook", "z": "90e2864e.2a7a88", "account": "9c6526f3.469b58", "path": "/calls", "x": 140, "y": 600, "wires": [ [ "3ece3544.58c26a", "b15e16bf.a2b9b8", "8aace956.f6d9a8", "57697280.0f4bec", "b58bfd4.14b77", "dedf8f93.3205c", "50eabb0f.286994" ] ] }, { "id": "103c6903.3d4eb7", "type": "debug", "z": "90e2864e.2a7a88", "name": "new call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1140, "y": 140, "wires": [] }, { "id": "3ece3544.58c26a", "type": "call-processor", "z": "90e2864e.2a7a88", "x": 820, "y": 300, "wires": [ [ "103c6903.3d4eb7", "c4ba2fc8.485e6" ], [ "e9fd0d8e.34906", "dfe78f33.7a656", "e5944610.1f8b38" ], [ "70967a1.6d60284" ] ] }, { "id": "e9fd0d8e.34906", "type": "debug", "z": "90e2864e.2a7a88", "name": "ongoing call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1210, "y": 300, "wires": [] }, { "id": "70967a1.6d60284", "type": "debug", "z": "90e2864e.2a7a88", "name": "hung-up call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1150, "y": 500, "wires": [] }, { "id": "b15e16bf.a2b9b8", "type": "debug", "z": "90e2864e.2a7a88", "name": "webhook debug", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 360, "y": 200, "wires": [] }, { "id": "5fe111d4.0c968", "type": "template", "z": "90e2864e.2a7a88", "name": "simple IVR dialplan", "field": "payload", "fieldType": "msg", "format": "text", "syntax": "plain", "template": "<document>\n <work>\n <answer />\n <wait>2</wait>\n <speak input-timeout=\"10000\">\n 1 to echo, 2 to hang up\n <bind action=\"https://apidaze.ngrok.io/calls\">1</bind>\n <bind action=\"https://apidaze.ngrok.io/calls\">2</bind>\n </speak>\n </work>\n</document>", "output": "str", "x": 1370, "y": 100, "wires": [ [ "7e0d2b21.e6a8d4" ] ] }, { "id": "7e0d2b21.e6a8d4", "type": "http response", "z": "90e2864e.2a7a88", "name": "", "statusCode": "200", "headers": { "Content-Type": "text/xml" }, "x": 1520, "y": 100, "wires": [] }, { "id": "8aace956.f6d9a8", "type": "cdr-processor", "z": "90e2864e.2a7a88", "x": 820, "y": 40, "wires": [ [ "f5407c03.ce478" ] ] }, { "id": "f5407c03.ce478", "type": "debug", "z": "90e2864e.2a7a88", "name": "CDR log", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1140, "y": 40, "wires": [] }, { "id": "9dbf85c5.089f28", "type": "template", "z": "90e2864e.2a7a88", "name": "echo dialplan", "field": "payload", "fieldType": "msg", "format": "text", "syntax": "plain", "template": "<document>\n <work>\n <ringback/>\n <wait>2</wait>\n <answer/>\n <echo>500</echo>\n <hangup/>\n </work>\n</document>", "output": "str", "x": 1750, "y": 380, "wires": [ [ "99e9d448.6fccb8" ] ] }, { "id": "dfe78f33.7a656", "type": "switch", "z": "90e2864e.2a7a88", "name": "", "property": "payload.call.dialed_digits", "propertyType": "msg", "rules": [ { "t": "eq", "v": "1", "vt": "str" }, { "t": "eq", "v": "2", "vt": "str" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 1130, "y": 400, "wires": [ [ "9ac7d1c5.46244" ], [ "751e8a23.268184" ] ] }, { "id": "99e9d448.6fccb8", "type": "http response", "z": "90e2864e.2a7a88", "name": "", "statusCode": "200", "headers": { "Content-Type": "text/xml" }, "x": 1880, "y": 380, "wires": [] }, { "id": "f6402960.a66248", "type": "template", "z": "90e2864e.2a7a88", "name": "hang-up dialplan", "field": "payload", "fieldType": "msg", "format": "text", "syntax": "plain", "template": "<document>\n <work>\n <hangup/>\n </work>\n</document>", "output": "str", "x": 1770, "y": 440, "wires": [ [ "9e9a35e2.c96408" ] ] }, { "id": "9e9a35e2.c96408", "type": "http response", "z": "90e2864e.2a7a88", "name": "", "statusCode": "200", "headers": { "Content-Type": "text/xml" }, "x": 1920, "y": 440, "wires": [] }, { "id": "57697280.0f4bec", "type": "recording-processor", "z": "90e2864e.2a7a88", "x": 840, "y": 600, "wires": [ [ "b5a1b4f8.ef8d58" ] ] }, { "id": "b5a1b4f8.ef8d58", "type": "debug", "z": "90e2864e.2a7a88", "name": "recording log", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1170, "y": 600, "wires": [] }, { "id": "b58bfd4.14b77", "type": "transcription-processor", "z": "90e2864e.2a7a88", "x": 850, "y": 700, "wires": [ [ "1c0f4946.d02ad7" ] ] }, { "id": "1c0f4946.d02ad7", "type": "debug", "z": "90e2864e.2a7a88", "name": "transcription log", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1180, "y": 700, "wires": [] }, { "id": "dedf8f93.3205c", "type": "rtc-processor", "z": "90e2864e.2a7a88", "x": 820, "y": 1000, "wires": [ [ "e89b85.6f8f7478", "4e835aad.319aa4" ], [ "a20c52e5.dda13", "a37caa86.61d148" ], [ "89201dab.35b1d" ] ] }, { "id": "e89b85.6f8f7478", "type": "debug", "z": "90e2864e.2a7a88", "name": "new RTC call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1170, "y": 800, "wires": [] }, { "id": "2ec0e5e2.c07cea", "type": "template", "z": "90e2864e.2a7a88", "name": "valid answering dialplan", "field": "payload", "fieldType": "msg", "format": "text", "syntax": "mustache", "template": "<document>\n<work>\n <answer />\n</work>\n</document>", "output": "str", "x": 1610, "y": 880, "wires": [ [ "fe7309a0.b84ea8" ] ] }, { "id": "fe7309a0.b84ea8", "type": "http response", "z": "90e2864e.2a7a88", "name": "", "statusCode": "200", "headers": { "Content-Type": "text/xml" }, "x": 1780, "y": 880, "wires": [] }, { "id": "a20c52e5.dda13", "type": "debug", "z": "90e2864e.2a7a88", "name": "ongoing RTC call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1190, "y": 960, "wires": [] }, { "id": "89201dab.35b1d", "type": "debug", "z": "90e2864e.2a7a88", "name": "hang-up RTC call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1190, "y": 1120, "wires": [] }, { "id": "e5ce199d.deb8a8", "type": "template", "z": "90e2864e.2a7a88", "name": "conference dialplan", "field": "payload", "fieldType": "msg", "format": "text", "syntax": "mustache", "template": "<document>\n<work>\n <answer />\n <wait>1</wait>\n <speak>Welcome, you are joining the conference.</speak>\n <conference>test_conf</conference>\n</work>\n</document>", "output": "str", "x": 1590, "y": 1020, "wires": [ [ "24b0c491.993d0c" ] ] }, { "id": "24b0c491.993d0c", "type": "http response", "z": "90e2864e.2a7a88", "name": "", "statusCode": "200", "headers": { "Content-Type": "text/xml" }, "x": 1740, "y": 1020, "wires": [] }, { "id": "f366be64.3ca0f", "type": "debug", "z": "90e2864e.2a7a88", "name": "log message text", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload.message.text", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1190, "y": 1220, "wires": [] }, { "id": "50eabb0f.286994", "type": "message-processor", "z": "90e2864e.2a7a88", "callUuid": "", "matches": [], "x": 830, "y": 1260, "wires": [ [ "f366be64.3ca0f", "bd7c043e.2324f8", "c75fec1a.5adcb" ] ] }, { "id": "bd7c043e.2324f8", "type": "debug", "z": "90e2864e.2a7a88", "name": "log associated call", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload.call", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1190, "y": 1300, "wires": [] }, { "id": "e5944610.1f8b38", "type": "dtmf-handler", "z": "90e2864e.2a7a88", "operation": "regex", "dialedDigits": "/1/", "x": 1560, "y": 240, "wires": [ [ "be4f21cd.90503", "ab967c54.4199" ], [ "9236e994.491028" ], [ "58787ee8.aac8d" ] ] }, { "id": "be4f21cd.90503", "type": "debug", "z": "90e2864e.2a7a88", "name": "DTMF match", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1870, "y": 180, "wires": [] }, { "id": "9236e994.491028", "type": "debug", "z": "90e2864e.2a7a88", "name": "DTMF fail", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1860, "y": 240, "wires": [] }, { "id": "58787ee8.aac8d", "type": "debug", "z": "90e2864e.2a7a88", "name": "No DTMF", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1860, "y": 300, "wires": [] }, { "id": "c75fec1a.5adcb", "type": "api-request", "z": "90e2864e.2a7a88", "account": "9c6526f3.469b58", "operation": "sms", "data": { "to": "491234567890", "from": "14123123123", "message": "\"A redirected message from \" & payload.message.caller_id_number & \": \" & payload.message.text" }, "continue": false, "proxy": "", "timeout": "", "x": 1170, "y": 1400, "wires": [ [ "8d8208b.75e8af8" ] ] }, { "id": "8d8208b.75e8af8", "type": "debug", "z": "90e2864e.2a7a88", "name": "", "active": true, "tosidebar": true, "console": true, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "auto", "x": 1430, "y": 1400, "wires": [] }, { "id": "ab967c54.4199", "type": "set-data", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [], "properties": [ { "key": "flow", "value": "echo" } ] } ], "x": 2180, "y": 220, "wires": [ [ "f45a7b91.c91918" ] ] }, { "id": "f45a7b91.c91918", "type": "debug", "z": "90e2864e.2a7a88", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 2370, "y": 220, "wires": [] }, { "id": "56887313.0a5f4c", "type": "http response", "z": "1e233faa.bf1ab", "name": "Respond successfully", "statusCode": "200", "headers": { "Content-Type": "application/json" }, "x": 680, "y": 360, "wires": [] }, { "id": "16447494.2f9deb", "type": "http in", "z": "1e233faa.bf1ab", "name": "GET /data", "url": "/data", "method": "get", "upload": false, "swaggerDoc": "", "x": 110, "y": 360, "wires": [ [ "c6e1d30c.9508" ] ] }, { "id": "c6e1d30c.9508", "type": "template", "z": "1e233faa.bf1ab", "name": "Sample data", "field": "payload", "fieldType": "msg", "format": "json", "syntax": "plain", "template": "{\n \"addressBook\": {\n \"14123123123\": {\n \"mobileDestination\": \"491234567890\",\n \"firstName\": \"Ali\",\n \"prefix\": \"Mr.\",\n \"lastName\": \"BARIN\"\n },\n \"default\": {\n \"mobileDestination\": \"491234567890\",\n \"firstName\": \"Ali\",\n \"prefix\": \"Mr.\",\n \"lastName\": \"BARIN\"\n }\n }\n}", "output": "json", "x": 390, "y": 360, "wires": [ [ "56887313.0a5f4c" ] ] }, { "id": "693e43ad.0afdac", "type": "data-provider", "z": "90e2864e.2a7a88", "x": 780, "y": 1680, "wires": [] }, { "id": "79d81921.b59ac8", "type": "http request", "z": "90e2864e.2a7a88", "name": "Fetch customer data", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://apidaze.ngrok.io/data", "tls": "", "persist": false, "proxy": "", "authType": "", "x": 560, "y": 1680, "wires": [ [ "693e43ad.0afdac" ] ] }, { "id": "b7494d4f.a6f6", "type": "inject", "z": "90e2864e.2a7a88", "name": "Auto-trigger after 0.1 second on deployments", "props": [], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "x": 250, "y": 1680, "wires": [ [ "79d81921.b59ac8" ] ] }, { "id": "97f5feb3.31a57", "type": "comment", "z": "90e2864e.2a7a88", "name": "Retrieving data to keep in the context for flow executions", "info": "Reference: https://cookbook.nodered.org/basic/trigger-on-start", "x": 270, "y": 1620, "wires": [] }, { "id": "c4ba2fc8.485e6", "type": "set-xml", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [ { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<answer />", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<record on-answered=\"true\" aleg=\"true\" bleg=\"true\" name=\"a_new_record\" recording-file-url=\"$url;?type=recording\" action=\"$url;?type=recording\" />", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<wait>2</wait>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": " <speak input-timeout=\"10000\"> 1 to echo, 2 to hang up <bind action=\"$url;\">1</bind> <bind action=\"$url;\">2</bind> </speak>", "xmlValueType": "str" } ], "properties": [] } ], "x": 1170, "y": 200, "wires": [ [ "a0e947e7.ac94c8" ] ] }, { "id": "a0e947e7.ac94c8", "type": "xml-response", "z": "90e2864e.2a7a88", "x": 1320, "y": 200, "wires": [] }, { "id": "751e8a23.268184", "type": "set-xml", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [ { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<hangup/>", "xmlValueType": "str" } ], "properties": [] } ], "x": 1400, "y": 440, "wires": [ [ "da911b1.afc40e8" ] ] }, { "id": "da911b1.afc40e8", "type": "xml-response", "z": "90e2864e.2a7a88", "x": 1550, "y": 440, "wires": [] }, { "id": "9ac7d1c5.46244", "type": "set-xml", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [ { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<ringback/>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<wait>2</wait>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<answer/>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<echo>500</echo>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<hangup/>", "xmlValueType": "str" } ], "properties": [] } ], "x": 1400, "y": 380, "wires": [ [ "8204882b.520308" ] ] }, { "id": "8204882b.520308", "type": "xml-response", "z": "90e2864e.2a7a88", "x": 1550, "y": 380, "wires": [] }, { "id": "4e835aad.319aa4", "type": "set-xml", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [ { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<answer />", "xmlValueType": "str" } ], "properties": [] } ], "x": 1160, "y": 880, "wires": [ [ "aefd26c5.4626f8" ] ] }, { "id": "aefd26c5.4626f8", "type": "xml-response", "z": "90e2864e.2a7a88", "x": 1310, "y": 880, "wires": [] }, { "id": "a37caa86.61d148", "type": "set-xml", "z": "90e2864e.2a7a88", "matches": [ { "conditions": [ { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<answer />", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<wait>1</wait>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<speak>Welcome, you are joining the conference.</speak>", "xmlValueType": "str" }, { "property": "always_match", "propertyValueExp": "", "operation": "equal", "value": "", "xml": "<conference>test_conference</conference>", "xmlValueType": "str" } ], "properties": [] } ], "x": 1160, "y": 1020, "wires": [ [ "d9df41a8.e3b6c" ] ] }, { "id": "d9df41a8.e3b6c", "type": "xml-response", "z": "90e2864e.2a7a88", "x": 1310, "y": 1020, "wires": [] } ]