FreePBX call URL API


(Juan) #1

Hi, Is there a way that I can program a BLF entry to dial an URL? ex. when pressing the second line key on my Digium d40 phone go to http://192.168.14.21/state.xml?relay65State=2 this is basically telling my door system to release the magnet and open the door.

We have this option on our Digium SwitchVox and I’m trying to implement the same Feature on FreePBX.


(Dave Burgess) #2

I’d think that’s a specific enough question that you could open a commercial ticket. My suspicion is Yes, but I don’t know enough about programming Digium phones to say for sure, or how.


(Juan) #3

Thank Dave, If I can only could execute this command from a phone “curl http://192.168.14.21/state.xml?relay16State=2” that’s all I need.


(Dave Burgess) #4

If it was me, and I didn’t want a phone specific solution, I’d probably set up a context that called that through a system call and then connect the context,s,1 step to a custom destination/extension/whatever and hook it to an extension. After that, set the BLF to dial the extension and it works for any phone anywhere in your network.


(Juan) #5

@cynjut thanks, I found the below code on the forum and added to the Extension_custom.conf and is working perfectly.

exten => 7101,1,answer()
exten => 7101,n,Set(result=${CURL(http://192.168.14.21/state.xml?relay02State=2)})
exten => 7101,n,NoOp(Results: ${result})
exten => 7101,n,Hangup()

Then just add a Sped Dial on EPM for the line key 2 to dial 7101 ext.


(system) closed #6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.