Http and 3cx

Status
Not open for further replies.

Fabione

Customer
Joined
Feb 25, 2017
Messages
17
Reaction score
1
Hello, I'm new of 3CX and I have a question.

I have a 3cx pbx and a Door station of Lilin with a relay that open a door.

It is SIP and the audio/video work good.

The Lilin door station haven't a dtmf code to open relay but have only a string http to open relay like this:

Code:
http://192.168.0.200/setio?relay1=1 and http://192.168.0.200/setio?relay1=0 to stop the opening.

Is possible to program 3CX to assign a code (for ex: *123) to launch that string ?

Thanks in advantage and sorry for my bad english.
 
Hi @Fabione,

You can create a VAD application to invoke that HTTP request. Then you call the extension of the VAD app and maybe the app can ask you to enter a DTMF to open or close the door.

It would be similar to what we show here:
https://www.3cx.com/blog/docs/accessing-web-service-vad/

But using a Web Interaction component instead of the Web Services Interaction component.

Please note that the VAD is available for v14 only now. The Service Pack 6 of v15 will include the VAD for v15.

Kind regards.
Ernesto.
 
2n9et8g.jpg Morning Ernesto, I just installed the VAD for V15.5 and it works good.

I make a new very basilar project that has two http request:

Code:
http://192.168.0.200/setio?relay1=1
http://192.168.0.200/setio?relay1=0

It work with a queue exstension but I need to add a delay (4 or 5 seconds) after the first http request, any suggestion ?



Thank you very much.
 
Last edited by a moderator:
It work with a queue exstension but I need to add a delay (4 or 5 seconds) after the first http request, any suggestion ?

Hi @Fabione,

In order to add a delay, you can use a "Launch External Script" component, and use the following C# code for it:
Code:
using System;
using System.Threading;

namespace DelayNamespace
{
  public class Delay
  {
    public void DelayExecution(int milliseconds)
    {
      Thread.Sleep(milliseconds);
    }
  }
}

Then you can invoke that code configuring the Launch External Code component as follows:
upload_2017-6-12_9-31-40.png

Kind regards.
 
Thank You Ernesto, I tested it and It works but not everytime, sometime I call the extension and the second http request do not start ...
 
  • Like
Reactions: Fabione
I open the log and I found a banal error on http requests, now everythings is working good !!

Thank you so much for the rapid and resolutive help !!!! :):):)
 
Last edited:
  • Like
Reactions: edossantos
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,890
Members
165,470
Latest member
Robert Lee