# Introduce node-red plugin (part 1)

**URL:** <https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145>\
**Category:** Development: API/Events\
**Created:** [January 21, 2020, 3:19am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145 "2020-01-21T03:19:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [January 21, 2020, 3:19am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/1 "2020-01-21T03:19:41Z")

</div>

**Node Red introduction**

Sometimes we hear about a lot of software that seems by far super interesting, we go to a tweet, an article, we look at the website and we say that we would like to play with it because it seems to have a really interesting potential. I have a number of this software in mind, but I decided to dig it out during the holiday season. This software is called node RED. Developed by IBM Emerging Technology for a few years under Apache 2 license, this software is very popular, has an ecosystem and a very interesting programmable opening. This is a project in the OpenJS foundation.

It is defined as “Low-code programming for event-driven applications”.

I invite you to browse the website [http://www.nodered.org](http://www.nodered.org) to learn more.

Also the language elements here: [https://nodered.org/docs/user-guide/concepts](https://nodered.org/docs/user-guide/concepts)

 ![](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/f859003e21149389d0ad65ebc75c62ce8d4b2dfb.png)

To install it is rather simple especially if you have docker. Personally I made a directory on my disk to have persistent storage (ex. Nodered-data) and I run the following command:

`docker run -it -p 1880:1880 -v <directory/nodered-data>:/data --name mynodered nodered/node-red`

Once my Node-Red is launched, I just need to go to the web page on port 1880.

To install node-red see the doc page here: [https://nodered.org/docs/getting-started/](https://nodered.org/docs/getting-started/)

**Wazo Platform and Node Red**

Very quickly if you do not know wazo-platform, I invite you to read our website [https://wazo-platform.org/](https://wazo-platform.org/) to discover us, but a quick introduction to give you an idea.

Wazo Platform’s mission is to provide a native programmable cloud telecommunications platform. It is open source and distributed under the free GPLv3 license. Its purpose is clearly to remove complex plumbing from the telecommunications platform and allow innovation in this area.

To install wazo-platform I refer you to our dedicated page [https://wazo-platform.org/install](https://wazo-platform.org/install). The use case covered by this article is on the subject of unified communication, so I invite you to follow the documentation on this subject.

Once your wazo platform is in place, you can have fun with Wazo Platform and Node Red.

**Wazo platform configuration**

The prerequisites are quite simple, you need an account that has the rights to play with the APIs, a SIP trunk to call the platform, or simply a phone connected directly to it and having declared a programmable application on the platform.

**Node Red side**

Your node-red has been installed, you just have to go into module management, look for wazo and install the plugin. Once the plugin is installed you will find a number of nodes available to create what seems interesting to you.

**Use case**

We are going to talk about some use cases, but obviously you will be able to play with node-red and Wazo Platform by discovering a lot.

I suggest you discover these:

- Simple call and hang up
- IVR with home automation integration
- SIP trunk monitoring

Module to install:

- node-red-contrib-wazo-platform
- node-red-dashboard

**Basic configuration**

First you have to connect your flow to the wazo websocket to receive the events. Just add a “wss in” node. Then go to the configuration by clicking on the node and add the server then make a token request by putting your Wazo API identifiers. The identifiers are not stored, the application only keeps the refreshToken. Once the websocket is configured we will be able to start a first case.

**Received call and hangup**

In this first case we will call our telephone number. By default if you have not done anything in your node-red or developed anything, it will not happen much except to have received an event to notify you that you have an incoming call.

In the case of wazo platform, an incoming call is signaled by a message with the name _application\_call\_entered_. We will therefore filter on this event then launch a progress, which is the ringing train, wait 5 seconds and finally hang up the call. This obviously doesn’t do much, but it does get you started with your Red node.

Do not forget to press Deploy each time you modify it in your node-red to apply your modifications.

 ![](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/b8956852e11b3a0a6aec35daf05b074cf22087f8.jpeg)

**IVR**

It’s pretty simple to create an IVR with a sound and pick up DTMFs to redirect the call. In the example below, just add a DTMF node, choose the key and connect the destination. In my case 9 hangs up the call, 1 calls a phone number, but 2 and 3 simply manage my light to turn it on or off.

 ![](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/24ec8ab255379a05bfa4ce3044a15c4e524b6757.png)

**SIP Trunk**

The wazo platform module also offers the ability to connect a trunk node to supervise it (register or not) and to know the number of calls in progress. We can then make graphs to monitor the number of calls, but we could also put a notification to say that the trunk is no longer recording.

 ![](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/22cd5b14a3712dccb17c9601e6345caa35b9efa6.png)

The above example generates graphs and gauges on the node-red-dashboard in real time without having to make a line of code. To access it, simply connect to the interface http://my\_server:1880/ui and you will see your graphs in real time. This dashboard is quite powerful and you can do a lot of configuration and customization, but also write your own graphic elements.

 ![](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/7b619dbf8ef7e0e604dc8d2f8982ba99d12bc05c.png)

---

<div class="post-metadata">

**Author:** ![hayku](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hayku/32/15_2.png) [@hayku](https://wazo-platform.discourse.group/u/hayku)\
**Post date:** [January 22, 2020, 11:31pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/2 "2020-01-22T23:31:31Z")

</div>

Awesome, actually it’s what I was looking for. A simple and visual way in order to use the wazo’s APIs. 😲

---

<div class="post-metadata">

**Author:** ![Nicolas56](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/nicolas56/32/17_2.png) [@Nicolas56](https://wazo-platform.discourse.group/u/Nicolas56)\
**Post date:** [August 14, 2020, 11:48pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/3 "2020-08-14T23:48:37Z")

</div>

> [@quintana](#):
>
> SIP Trunk

can you explain to me how did this part do please?

I can see the calls at time T on the trunck but not have the number of calls or a graph.

Thank you.

---

<div class="post-metadata">

**Author:** ![mnoumanafzal875](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/mnoumanafzal875/32/905_2.png) [@mnoumanafzal875](https://wazo-platform.discourse.group/u/mnoumanafzal875)\
**Post date:** [August 12, 2024, 4:34am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/4 "2024-08-12T04:34:53Z")

</div>

> [@quintana](#):
>
> The prerequisites are quite simple, you need an account that has the rights to play with the APIs, a SIP trunk to call the platform, or simply a phone connected directly to it and having declared a programmable application on the platform

hello, I am new to Wazo and exploring. I find red node and wazo interconnection very interesting and helpful in creating programmable applications.  
i as trying this guide  
but I am confused. I have set up sip trunk and my outbound and inbound calls are working…  
i want to send my inbound call to the rednode flow I deployed. what configuration should be in the trunk incoming route as currently its going to an extension

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [August 12, 2024, 2:15pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/5 "2024-08-12T14:15:43Z")

</div>

Hello, depends on your use case and what you want to achieve. For example, if you want to handle on of your incoming call in node-red, you need to create a voice application and route your incoming directly to this application. In node-red you’ll receive an event to notify you there is a new call with the information. After that you need to create your own logic with the different node. There is also possibility to create a subroutine and add dialplan with http request to node-red, there is an example for blacklist system in this forum.

Sylvain

---

<div class="post-metadata">

**Author:** ![mnoumanafzal875](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/mnoumanafzal875/32/905_2.png) [@mnoumanafzal875](https://wazo-platform.discourse.group/u/mnoumanafzal875)\
**Post date:** [August 13, 2024, 4:02am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/6 "2024-08-13T04:02:44Z")

</div>

> [@How to use Wazo programmable application](https://wazo-platform.discourse.group/t/how-to-use-wazo-programmable-application/834):
>
> Hello, People ask on Mattermost how to use programmable application with Wazo. So first, the concept for using application on Wazo is very simple. The goal for developpers is to receiving a call from a sip trunk, from a sip phone or webrtc phone and realize a program about what you want. Example IVR, routing etc … By default an application do nothing, except to receive a message to indicate when a call is entered in the application. So how to use it? First step you need to create your applica…

i was looking for this thank you very much

---

<div class="post-metadata">

**Author:** ![mnoumanafzal875](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/mnoumanafzal875/32/905_2.png) [@mnoumanafzal875](https://wazo-platform.discourse.group/u/mnoumanafzal875)\
**Post date:** [August 13, 2024, 4:09am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/7 "2024-08-13T04:09:46Z")

</div>

i have another Question  
what is the purpose of a web socket node in the node application  
I made the following without websocket and it’s working now. can you please guide?

 ![image](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/f6311f2c20d817d863be82d91d5ce89885f5c68b.png)

---

<div class="post-metadata">

**Author:** ![mnoumanafzal875](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/mnoumanafzal875/32/905_2.png) [@mnoumanafzal875](https://wazo-platform.discourse.group/u/mnoumanafzal875)\
**Post date:** [August 13, 2024, 6:15am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/8 "2024-08-13T06:15:47Z")

</div>

please help me in 2 other things as well  
how can I give the path of some file located in /usr/share/asterisk/sounds/en to the playback node  
2nd when I add DTMF node it doesn’t give me option to chose the key

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [August 14, 2024, 1:25pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/9 "2024-08-14T13:25:15Z")

</div>

You don’t need to use the complete path, just the name of the file in the asterisk sound path.

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [August 14, 2024, 1:26pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/10 "2024-08-14T13:26:01Z")

</div>

For DTMF you need to send it by a payload. Check the doc of the node.

---

<div class="post-metadata">

**Author:** ![mnoumanafzal875](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/mnoumanafzal875/32/905_2.png) [@mnoumanafzal875](https://wazo-platform.discourse.group/u/mnoumanafzal875)\
**Post date:** [August 16, 2024, 2:52am UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/11 "2024-08-16T02:52:49Z")

</div>

hi!  
thanks for your response.  
I dont need to send the DTMF form node application to the channel I need to do some action based on the DTMF that the person has entered  
so lets suppose the person presses 1 then I will may be playback something  
while doing an API request something like that

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [August 16, 2024, 12:54pm UTC](https://wazo-platform.discourse.group/t/introduce-node-red-plugin-part-1/145/12 "2024-08-16T12:54:47Z")

</div>

You need to use the websocket event to get the DTMF. There is one event for DTMF in application or one event for the general call.
