Use BLF keys to call REST functions

ip-communications

#1

We have several GXP2160s, 30s and their related newer from the series, most have an owner and therefore share an extension number. The phones with the most BLF keys programmed doesn’t have more than 8, maybe 7; the thing is, there are a lot of unused BLF keys that could be put to better use.

In the network, there’s also a RESTful automation system and I know the phones already can send some sort of HTTP-ish request to the Grandstream…umm…door locks? The SIP deadbolts Grandstream makes. I remember too that these phones have the ability to run simple XML apps, so I know all the pieces are there to send a REST call which is nothing more than an HTTP request; I’m not a developer though. So instead I went looking to directly program an address to a BLF key but in a sea of selectable options executable by a key there seems to be none that cold request a web address.

I went into the UCM to try programming the keys remotely but I didn’t find a suitable option for the keys, I didn’t went out of my way using the UCM though because ZeroConfig is very hit and miss anyway and between reprovisions there’s a lot of wasted time–if the NOTIFY goes through that is–most of the time the phone just ignores it. On the phones’ web GUI though, there I did spent a kit of time testing and choosing other options for the BLF keys thinking maybe there were mislabeled, I updated the phones to the latest firmware and then again to the latest beta and I still don’t know how to send the REST call.

The closest I got is the section that does this but on status of the phone, not on a key press. “Action URL” is the section. The automation server does send status of the device, for instance, a door open or closed, it can be queried or gotten grouped on an RSS feed, which I think is more or less again what the phones already to with status broadcast groups, configurable at the UCM, this should be easily mapable to BLF keys–I just need a push in the right direction, although with all the time I’ve been looking and gotten nowhere a push in the exact direction fits better.

Thanks!


#2

Hi,

i am not sure, if I understand your question right…
If you need a hint, how to send a HTTP-Request to a Server (that might be an REST-Call or whatever you want…) you have to go to (in the phone gui) settings/Programmable Keys / Virtual Multi-Purpose Keys.
There you click on “Edit VPK” of the corresponding key and a window pops up.

Enter:
Mode -> XML-Application
Accounts -> your active account (mostly Account 1)
Description -> what you want as label on beneath your Button
Value -> the full http-request

then click “Save” and then click “Save VPK”

Now you see your label (description) next to the button on the phone. If you hit the button, the url will be called. If the http-request returnes a well-formed XML-document, the phone will display it. If not, nothing will happen “visually” on the phone, but your http-request will be executed anyways.

There is a demo around in the docs with a survey-example, that shows pretty much of what is possible.

regards,
Yves aka Jens