How-To use digium.setLedState for BLF

Community based support for the Digium Phone Application Programming Interface (API).

Moderators: jwitt, sruffell, malcolmd, Moderator

How-To use digium.setLedState for BLF

Postby dpoling » Mon Sep 09, 2013 11:14 am

I am trying to get the msg LED to flash using the
Code: Select all
digium.setLedState(parameters);
listed in the API and I'm having trouble with the parameters I think. Can you give an example?
Last edited by dpoling on Mon Nov 04, 2013 10:01 am, edited 1 time in total.
dpoling
Newsterisk
 
Posts: 4
Joined: Mon Sep 09, 2013 11:05 am

Re: How-To use digium.setLedState for BLT

Postby sruffell » Mon Sep 09, 2013 11:37 am

I think something like the following will do the trick for you:

Code: Select all
digium.setLedState({
    name: "msg",
     state: "slow",
     color: "red",
}) ;
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: How-To use digium.setLedState for BLF

Postby dpoling » Tue Sep 10, 2013 8:39 am

I'm still not getting a msg LED to turn on. I think it is a foreground issue as my debug shows false...
Code: Select all
util.debug(digium.app.inForeground);

is there a way to force the app into the foreground other than digium.foreground(); ?
Last edited by dpoling on Mon Nov 04, 2013 10:02 am, edited 1 time in total.
dpoling
Newsterisk
 
Posts: 4
Joined: Mon Sep 09, 2013 11:05 am

Re: How-To use digium.setLedState for BLT

Postby sruffell » Tue Sep 10, 2013 8:54 am

Yes, that is true. There is no way to force the LED state while your app is not in the foreground.

What are you trying to do specifically? Perhaps you could describe an additional application you would like me to post to https://github.com/digium/digium-phone-apps that will demonstrate what you're trying to accomplish?
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: How-To use digium.setLedState for BLF

Postby dpoling » Tue Sep 10, 2013 11:33 am

I am trying send a message to the phone screen and flash the msg or blf LED, then the user can select from a menu to take action on it. The message needs to stay on the screen and flash msg or blf without timing out. The message can be updated from the server before a timeout.
Last edited by dpoling on Mon Nov 04, 2013 10:03 am, edited 1 time in total.
dpoling
Newsterisk
 
Posts: 4
Joined: Mon Sep 09, 2013 11:05 am

Re: How-To use digium.setLedState for BLF

Postby dpoling » Fri Sep 20, 2013 10:05 am

I don't know if this is the best way to do this but I did come up with the following...

Code: Select all
var app_foreground = function() {
    util.debug("digium.app.inForeground?: "+digium.app.inForeground); // shows true
    digium.setLedState({
    name: "msg",
    state: "fast",
    color: "amber",
    }) ;
};

digium.event.observe({
    'eventName'     : 'digium.app.foreground',
    'callback'      : app_foreground

});


This does fast blink the MSG LED Amber, I will keep looking into this and if anybody out there has a better way, you can post here.
dpoling
Newsterisk
 
Posts: 4
Joined: Mon Sep 09, 2013 11:05 am


Return to Digium Phone API

Who is online

Users browsing this forum: No registered users and 1 guest