Metermaid Patch Required or Not?

I was going to implement the Metermaid patch for monitoring Parking Lot Status on my Snom 320 and 360 Handsets but reading the below article :-

asterisk.org/node/97 dated 27 June 2006 - 10:57am

It states that :-

"Yesterday I committed what started as “metermaids” to svn trunk. This code started with a question on the IRC one evening:

  • "Why can’t I have blinking lamps for a parking lot?"
    Well, now you can. Metermaids is now part of svn trunk - the ability to watch a parking lot, to have a blinking lamp as soon as someone is parked on a parkinglot in Asterisk. Metermaids is implemented using a new architecture called “devicestate providers”. With those, we can add status for various non-channel related objects in Asterisk, to provide status updates in AMI (manager interface) and through SIPi subscriptions. Currently, there’s an implementation for parkinglots and MeetMe conferences. "

However I cant find any documentation as to how to set it up.

I am running Asterisk 1.2.15

Thanks in advance

Yes, Olle committed it to SVN trunk, not the 1.2 branch. I assume (even though I personally have not tried it) that it is in 1.4.

It is not, however, in 1.2. I patched my 1.2 to include it. I’m not running the latest 1.2, though. I haven’t had a chance to really start testing 1.4. Just remember, though, 1.4 is a .0 release, 1.4.0, and should be treated as such. A lot of people have made the mistake of upgrading perfectly good production systems to 1.4 and are now experiencing all sorts of disasters. I wonder how many of those will continue to have their jobs.

Still haven’t figured out if it’s in 1.4 or not. If it is, I can’t seem to figure it out.

Sense it went into trunk back in June then yes it should be in 1.4.0 and 1.4.1. It will NOT be in 1.2.X. If for some reason it’s not in the 1.4 releases, then it was removed before the releases were made. But I doubt thats the case.

Yeah, I’m thinking it’s more the guy trying to figure it out :smile:

I admit I have not put much time into it, though. Anytime I have worked on it, there have been other variables involved as well which could very well be causing things not to work as expected.

Found it. You actually have to read :smile:

The format has changed significantly, but it’s documented towards the end of the extension.conf sample file.

Works fine. I had thought devstate got merged as well, but it didn’t. There is a patch on the wiki that will get devstate working.

For those wondering, Devstate works well for a night mode light.

interesting … can you post how you’re using it ?

I have the following in extensions.conf

exten => 799,hint,DS/mmgc exten => 799,1,Macro(open-close,mmgc,open,closed) exten => 799,n,Playback(beep) exten => 799,n,Hangup
I define a button, for instance, on a Polycom or a Grandstream to speeddial 799 along with a hint. Ext 799 calls a macro the first item is, of course, the macro name, the second is the company (we have multiple companies), the third is a voice prompt for the open message (played so the user knows he/she is opening the business) and the last is the closed message.

The macro included in extensions.conf:

[macro-open-close] exten => s,1,Set(nightmode=${DB(nightmode/${ARG1})}) exten => s,n,NoOp(ARG1 ${ARG1} ARG2 ${ARG2} ARG3 ${ARG3}) exten => s,n,Set(OpenFile=${ARG2}) exten => s,n,Set(CloseFile=${ARG3}) exten => s,n,NoOp(Close file ${CloseFile}. Open file ${OpenFile}.) exten => s,n,GotoIf(${nightmode}=1?s,Open:s,Close) exten => s,n(Open),Set(DB(nightmode/${ARG1})=0) exten => s,n,Devstate(${ARG1},0) exten => s,n,Playback(${OpenFile}) exten => s,n,Goto(Return) exten => s,n(Close),Set(DB(nightmode/${ARG1})=1) exten => s,n,Devstate(${ARG1},2) exten => s,n,Playback(${CloseFile}) exten => s,n(Return),NoOp

I have since learned that instead of creating my own database entries, DevState creates database entries. For example, in this setup when the company is closed, there is a database entry for DEVSTATE/mmgc of 2. I haven’t modified the macro to use that.

It’s a pretty simple setup, when the company is closed, the DevState is set to in use, which causes the light to come on. When open, the light is off. My IVR checks the database to see if the company is open or closed.

As it is, I can remotely open or close the company via ssh into Asterisk and manually changing the database. But, it doesn’t show on the phone. If I were to use the database entry for DevState, I believe that would update the status on the phones. I think this would be the better way to go. In my 1.4 series deployment, I’ll probably make that change. I have to change my original macro anyway. My original macro uses commands that were depracated and now no longer available. This macro was updated to work on 1.4.

very nice. a couple of my clients have different “modes” for day, night, lunch, training etc, and at present they use part of a receptionist panel to show this kind of status with speeddials on the phone to change. i think i might just have to upgrade to using this and have both … thanks.

so i am basically stumped here. All I want to do is have presence lights working on the phones!. I am using AASTRA 9133i’s. I amd currently using 1.4.1 i ran the original metermaid patch but it does not compile with it patched. What are my other alternatives to have presence on the phones!..

Presence I know works on the 1.2 code base. I imagine it should work pretty much the same way on 1.4. The mermaid patch is for parking lots+presence.

This thread’s a little old, but to answer some of the questions (since I had to figure this out myself)…

The metermaid patch available at this URL does work on more recent versions of Asterisk. However, at some point after 1.2.11, there was a typo corrected, and the patch references the old incorrect spelling. If you use more recent version of Asterisk, just open the patch file, and replace the word “transfering” with “transferring” on line 13.

bugs.digium.com/view.php?id=5779

Before resulting to this, I downloaded this version of Asterisk which I hoped would already include this patch, but it doesn’t appear to… or at least, if it does, I can’t find any evidence of it, and it doesn’t work. The hints show as “Unavailable” in CLI.
svn checkout svn.digium.com/svn/asterisk/branches/1.2 asterisk-trunk

Maybe there’s some other method to download a 1.2 branch of asterisk which includes this patch?

Anyway… Asterisk 1.2.18 compiles fine with the patch after the typo-fix, and my system is up and running again with working Parking Lot Status. :smile:

  • Jason