16 jan 2008 kl. 00.03 skrev Tilghman Lesher: > On Tuesday 15 January 2008 16:03:16 Andrea Spadaccini wrote: >> Russell wrote: >>> Andrea wrote: >>>> I have a small question: other than a phone (ie. SIP/something), >>>> what >>>> else can I use as "app"? Can I handle the change via some custom >>>> code? >>> >>> There are a number of things that can provide "device state" in >>> Asterisk. >>> That includes "real" devices such as SIP endpoints, or any other >>> channel >>> driver. However, it also includes things like monitoring the state >>> of a >>> space in parking, or the usage of a MeetMe conference. I have also >>> written a small dialplan function which lets you create custom >>> device >>> states. A lot of people use this for things like having a light >>> on the >>> phone that reflects whether the agent is logged in or not. >>> >>> More information: >>> >>> http://asterisk.org/node/48325 >>> http://asterisk.org/node/48360 >> >> Thanks a lot for the info, I already read the first article, and >> it's great >> to know that DEVSTATE can be used in 1.4. >> >> But my question was different, my poor english doesn't help me. :( >> >> In your article I read >> "For example, when someone subscribes to the state of extension >> 1234, Asterisk knows to give them the state of the SIP phone SIP/ >> myphone. >> >> exten => 1234,hint,SIP/myphone" >> >> Suppose that I want to write to a database the state of all my >> extensions, >> in order to display it in a web page. >> >> How could I do it using the hint mechanism? > > Just create a module that subscribes to every single device and when > the state > changes, your callback will get an event with the device name that > changed. > You could then update your database with an SQL query (or whatever > else you > like).
The manager interface is our preferred connection to Asterisk from third-party modules. The AMI will report all device state changes, so you can create an app that updates your database based on this information. /Olle _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
