My changes to the agi-bin/directory file keep getting over written

Anybody know how to stop this and/or know what the process is that does it so I can adjust it and not have to repeat the process every day…

(yes I was asking this in this message: http://www.freepbx.org/forum/freepbx/installation/making-a-unified-phone-directory-with-more-then-one-system)

as you observe, modifying stock FreePBX AGI scripts will get overwritten (by design). Make it readonly to user asterisk to keep it from getting overwritten. Then remember that any time a new module update occurs where the original AGI script came from, you will want to determine if it contained any changes that may be of interest.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

here’s another option that I just put into svn trunk and will be moving to the 2.3 branch and getting it in shortly once I review it with another developer. It allows a retrieve_conf_post_custom script to be run. This would allow you to apply a patch, replace a script or what ever else you might desire to do and runs once everything else has been run in retireve_conf.

The change is here: r5031

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

Is there a good place to hook into where when somebody saves a new greeting a seperate script can be called?
Also looking for the proper place to hook in for voicemail.conf file changes…

I currently have a pair rsync routine runs on two seperate systems to keep one systems voicemail.conf and greet.* files in sync with the other system but it would be so much nicer to have a script that only runs when needed.

If I get this running cleanly I’ll be posting the patches so that it can get integrated.

The issue is that voicemail users can modify their greetings any time they want and you would likely end up with more overhead than just an rsync running periodically because you would have to check something every time a mailbox were accessed. As far as voicemail.conf file changes, they can be made from several places. There are a set of routines that are called to access the voicemail.conf file. But then ARI does its own thing. And of course Asterisk does its own thing. So again - you are probably better off just doing it periodically. There was a writeup done, nicotine I think it was, and I could not find it. I had helped him setup an environment where the voicemail files at each branch just included the ones at the other branch and the contexts were just varied at each branch. Then I think he just modified the directory parameter in the IVR to include ‘general’ which is already defined but not exposed in the directory script so that you could dial by name to anyone. Then he included the dundi contexts as well so you could get to people through the IVR. And by rsyning the voicemail directories with different contexts, he ends up with an inherent backup system plus the company directory has everyone’s voice recording which ever branch they were at. He was suppose to have put it up on the dev wiki but I did not see it there. Maybe it was put on Aussie voip and actually has found its way into our site. Not sure. Anyhow, there was some good stuff in what he had done.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

in our office of 43 extensions, mostly developers. They expect things to happen with in seconds if not minutes. So scheduleing a rsync to run once every 5 minutes while easy to do is a bigt waste of time 99.998% of the time. All I was looking to do was run the rsync any time a “greet” was recorded and saved (greet.* is the recorded name).

I don’t actually need to rsync all the greetings audio files but just the files called greet.WAV and greet.wav. These files are the ones that are created when you record your name. The files for a normal greeting are called unavail., busy., etc.

Even those are only changed once ina blue moon once recorded. They might flip/flop between a recorded message when they leave the office for a few days for vacation but they stay the same.

So getting a hook that is called when a VM phone extension recording is saved will cut down on a lot of wasted commands running that don’t need to be run.

I think what you are talking about is at http://www.freepbx.org/trac/wiki/DundiClusterHack which my other message was refering to. I’m having a problem with the dialplan talking to the right system (dundi lookup commands work, jsut query what looks like the wrong system in the dial plan).

rsync should not be a lot of overhead if there is nothing to rsync. However, if you are looking for a hook then you might want to modify app_voicemail.c and create something that would trigger an rsync or equivalent because that is what knows that messages are changing. Or write a script that checks every minute if any of the greeting files have been modified and triggers the rsync. Just some ideas - maybe there is something else somewhere that I am not aware that would already provide this information.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx