Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Send Rest command from Asterisk PBX to ISY, possible?

Featured Replies

Posted

Hi,

 

I have this idea but I don’t know where to start. From Asterisk PBX, is there a way to send a Rest command to change an ISY variable content?

 

What I am thinking is that by using an IVR, one can press an option and specific variable in ISY will be changed thus triggering a program to execute.

 

Is this a good starting point?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Applications+REST+API

 

 

Thoughts? Thanks.

I do this with an earlier version of Asterisk, by incorporating calling curl into my dialplan IVR menus. Works well. I think the URL you mention is the other way around, having Asterisk provide a REST api for things like call placement, queue management etc.

  • Author

Hi,

 

Maybe the URL is not the right one.

 

Do you still have the curl program that you've have incorporated into your dial plan you may be able to share?

 

I am planning to have a "secret" option within the IVR. However, since I know the option, after keying in the option, sub-IVR can give options like 1- turning garage on ; 2- Kitchen lights, 3-etc....

 

Thanks.

  • Author

Based on the suggestion of MWareman, I tried using "curl" Asterisk:

 

exten => 11688,n,curl(https://login:password@test.dyndns.biz:1234/rest/vars/set/2/88/1)

 

 

Example (POST-Method):
exten => _X.,2,curl(http://www.somehost.com/may_be_a_dir/file_to_call.php,postdata_var1=1&postdata_var2=something)
exten => _X.,3,Wait(5)
exten => _X.,4,NoOp(CURL-RESPONSE: ${CURL})

 

However, just trying ISY rest on a browser did not work.

https://login:password@test.dyndns.biz:1234/rest/vars/set/2/88/1

 

I could not remember where I read about authentication. Need some assistance please. BTW, I am running the rest command from a remote site.

 

 

Thanks.

You may be running into a couple of things.

 

First - SSL trust. Is it a trusted cert. If not - you'll need -k to ignore that - but it's not *that* secure to do that.

Second - with curl you don't put the username and password on the URL. You specify the -u parameter.

 

Try it from the shell on your Asterisk system first:

 

curl -k -s -u user:pass https://test.dyndns.biz:1234/rest/vars/set/2/88/1

 

If this works, I included it in my dialplan like this:

 

exten => s,n,system(curl -k -s -u user:pass https://test.dyndns.biz:1234/rest/vars/set/2/88/1)

 

I'm not using the curl Asterisk command. Not sure why (it way a while ago!)

 

Michael.

  • Author

This is awesome! Thank you very much.

 

Turning ON and and OFF lights now through my phone system. There's so much to explore now! :D:D:D

Glad I could help!

 

Michael.

  • 1 month later...

Hi,

 

I started playing around recently a bit with the PBX in a Flash version of Asterisk. The non-GUI version of Asterisk is above my pay-grade. Is there any way to implement the above mentioned way of sending REST commands in the PBX in a Flash system? Thanks in advance.

Edited by hbsh01

I've only ever compiled my own Asterisk, and worked from the CLI, so I'm afraid I don't know what capabilities 'PBX In a Flash' has. Sorry.

Thanks anyway.

 

The PBX in a Flash is a graphical UI for Asterisk. But It is still possible to manually edit the 'extensions.conf' file. If my understanding is correct, that's where the above cURL command needs to be written. I will try to see if I can figure something out.

 

Sent from my SPH-D710 using Tapatalk

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.