{ "name": "n8n-sip-pbx-demo-part-2-step-2-trunk-to-extension-and-internal-outbound", "nodes": [ { "parameters": { "triggerOn": "trunk", "ref": "external", "trunkConnectionMode": "dynamic", "trunkStaticUsername": "trunk", "trunkStaticPassword": "Passw0rd", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbxTrigger", "typeVersion": 1, "position": [ -3520, 3072 ], "id": "99ad2fa2-7736-4bbe-9d1f-176d5f5a9461", "name": "external" }, { "parameters": { "resource": "call", "operation": "call.answer", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -3312, 3072 ], "id": "61c158a4-8585-47af-aeee-982e59c04704", "name": "incoming_answer" }, { "parameters": { "resource": "media", "operation": "media.playAudio", "sourceType": "http", "playbackHttpUrl": "https://translate.google.com/translate_tts?client=tw-ob&tl=en&q=Enter%20the%20extension%20number%20if%20you%20know%20it", "interruptOn": [ "dtmf" ], "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -3104, 3072 ], "id": "8417397a-6591-462f-a6df-db49139e59fa", "name": "play_extension" }, { "parameters": { "resource": "call", "operation": "call.wait", "timeoutSeconds": 5, "waitDtmfFallbackEnabled": true, "waitDtmfMultiDigitFallbackEnabled": true, "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2896, 3056 ], "id": "329420f2-847d-43a1-927a-75fc83688cf8", "name": "input_extension" }, { "parameters": { "operation": "dial.make", "callMode": "extension", "extensionNumbers": "={{ $json.digits }}", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2688, 2960 ], "id": "c66e0117-41f3-48f1-8b8f-4c799de48149", "name": "dial_extension" }, { "parameters": { "operation": "dial.wait", "legId": "={{ $('external').item.json.legId }}", "waitEventOutputs": [ "ringing", "progress" ] }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2480, 2672 ], "id": "88f377b1-155f-4773-a8cc-88f1e46acf9b", "name": "wait_extension" }, { "parameters": { "resource": "media", "operation": "media.playTone", "repeatInfinite": true, "options": { "legId": "={{ $('external').item.json.legId }}", "mediaExecutionMode": "background" } }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2272, 2496 ], "id": "f060fb7f-132b-4022-9c79-a13032dedb3f", "name": "ringing_extension" }, { "parameters": { "resource": "call", "operation": "call.bridge", "legAId": "={{ $json.legId }}", "legBId": "={{ $('external').item.json.legId }}", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2272, 2656 ], "id": "6644377d-5e42-4844-bd76-3891ccfe7b16", "name": "bridge_extension" }, { "parameters": { "resource": "media", "operation": "media.playAudio", "sourceType": "http", "playbackHttpUrl": "https://translate.google.com/translate_tts?client=tw-ob&tl=en&q=Extension%20number%20is%20unavailable", "options": { "legId": "={{ $('external').item.json.legId }}", "stopOtherMedia": true } }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2272, 2976 ], "id": "a5ac1d23-f2b2-46f8-bdea-1d2780604837", "name": "play_ext_unv" }, { "parameters": { "operation": "dial.break", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2272, 2816 ], "id": "c0451f9b-60cc-4215-b754-fbfe8f0f3e3d", "name": "break_extension" }, { "parameters": { "triggerOn": "extensions", "ref": "internal", "staticCredentials": { "item": [ { "username": "user1", "password": "Passw0rd", "extension": "101" }, { "username": "user2", "password": "Passw0rd", "extension": "102" }, { "username": "user3", "password": "Passw0rd", "extension": "103" } ] }, "extensionsEnableCallRecording": false, "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbxTrigger", "typeVersion": 1, "position": [ -3520, 3440 ], "id": "34c0d499-5535-4661-aff3-3e4fa9fd8dbb", "name": "internal" }, { "parameters": { "rules": { "values": [ { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "leftValue": "={{ $json.calledNumber }}", "rightValue": "9", "operator": { "type": "string", "operation": "startsWith" }, "id": "2ac76834-3cac-42e4-bc75-c22c53eaee9b" } ], "combinator": "and" }, "renameOutput": true, "outputKey": "External" } ] }, "options": { "fallbackOutput": "extra" } }, "type": "n8n-nodes-base.switch", "typeVersion": 3.4, "position": [ -3312, 3360 ], "id": "2f354859-8935-4c03-876e-180ec3375807", "name": "outgoing_type" }, { "parameters": { "operation": "dial.make", "callMode": "trunk", "ref": "external", "destination": "={{ $json.calledNumber.slice(1) }}", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -3104, 3280 ], "id": "085ed721-f908-4989-a931-00cc0c6260f4", "name": "dial_external" }, { "parameters": { "operation": "dial.make", "callMode": "extension", "extensionNumbers": "={{ $json.calledNumber }}", "options": { "extensionOnlyFreeEndpoints": false } }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -3104, 3440 ], "id": "8b8b4f08-fea2-42f9-b24b-76368c304f8d", "name": "dial_internal" }, { "parameters": { "resource": "call", "operation": "call.bridge", "legAId": "={{ $json.legId }}", "legBId": "={{ $('internal').item.json.legId }}", "options": {} }, "type": "n8n-nodes-sip-pbx.sipPbx", "typeVersion": 1, "position": [ -2896, 3360 ], "id": "f480574c-c5cb-4b4c-9925-71b058d865ef", "name": "bridge_outgoing" } ], "pinData": {}, "connections": { "external": { "main": [ [ { "node": "incoming_answer", "type": "main", "index": 0 } ] ] }, "dial_external": { "main": [ [ { "node": "bridge_outgoing", "type": "main", "index": 0 } ] ] }, "dial_internal": { "main": [ [ { "node": "bridge_outgoing", "type": "main", "index": 0 } ] ] }, "outgoing_type": { "main": [ [ { "node": "dial_external", "type": "main", "index": 0 } ], [ { "node": "dial_internal", "type": "main", "index": 0 } ] ] }, "incoming_answer": { "main": [ [ { "node": "play_extension", "type": "main", "index": 0 } ] ] }, "play_extension": { "main": [ [ { "node": "input_extension", "type": "main", "index": 0 } ], [ { "node": "input_extension", "type": "main", "index": 0 } ] ] }, "dial_extension": { "main": [ [ { "node": "wait_extension", "type": "main", "index": 0 } ], [ { "node": "play_ext_unv", "type": "main", "index": 0 } ] ] }, "internal": { "main": [ [ { "node": "outgoing_type", "type": "main", "index": 0 } ], [] ] }, "input_extension": { "main": [ [ { "node": "dial_extension", "type": "main", "index": 0 } ], [ { "node": "play_extension", "type": "main", "index": 0 } ], [] ] }, "wait_extension": { "main": [ [ { "node": "ringing_extension", "type": "main", "index": 0 } ], [ { "node": "bridge_extension", "type": "main", "index": 0 } ], [ { "node": "bridge_extension", "type": "main", "index": 0 } ], [ { "node": "break_extension", "type": "main", "index": 0 } ], [ { "node": "play_ext_unv", "type": "main", "index": 0 }, { "node": "break_extension", "type": "main", "index": 0 } ], [ { "node": "play_ext_unv", "type": "main", "index": 0 } ] ] }, "ringing_extension": { "main": [ [ { "node": "wait_extension", "type": "main", "index": 0 } ] ] }, "play_ext_unv": { "main": [ [], [ { "node": "play_extension", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1", "binaryMode": "separate", "timeSavedMode": "fixed", "saveDataSuccessExecution": "all", "callerPolicy": "workflowsFromSameOwner", "availableInMCP": false }, "meta": { "templateCredsSetupCompleted": true }, "tags": [] }