[asterisk-users] Commit dialplan & other config. in memory to disk?

Steve Edwards asterisk.org at sedwards.com
Thu Apr 6 12:41:42 CDT 2017


On Thu, 6 Apr 2017, Nathan Anderson wrote:

> In the future, if I were to ever run into a similar situation, is there 
> any way to request or instruct Asterisk to write the current dialplan 
> that is in memory and other important config files (e.g., users.conf) to 
> disk in a *different* location than where it originally read them from 
> when it started up?  I could have saved myself a crap-ton of work if 
> this were possible...

On Thu, 6 Apr 2017, John Novack wrote:

> I run a cron job every early morning to do just that as well as the 
> MySql data files so if need be I can recreate a machine and have call 
> records and whatever not more than a day stale.

Ditto.

Each host emails all of it's configuration files and database dumps in a 
tarball every day. This has saved mine and my client's bacon on more than 
1 occasion.

It also comes in handy when a client says 'I liked it better the way it 
was last Monday' or when a client says 'why am I being charged for x hours 
work last Tuesday.' I can restore the tarballs and a quick diff shows 
everything I did -- down to the time-stamped commands in my .bash_history.

Back to your specific problem...

No. There is no easy way to recover configurations from a running 
Asterisk. The misleadingly named 'dialplan save' will not save you. It 
will trash any file in it's way with a useless rendition of your dialplan. 
It will show your globals and your application calls, but without any of 
the parameters.

Seriously, was this some disgruntled developer's middle finger as they 
stormed out of the office?

I've found myself in your position, not by hardware failure, but by a 
fat-fingered 'rm' and had the better part of a days work at stake.

I used the 'script' shell command and the Asterisk 'dialplan show' command 
and then ran that through a PHP script that recovered enough.

You're welcome to the script at:

 	http://www.sedwards.com/recover-show-dialplan.php

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
             https://www.linkedin.com/in/steve-edwards-4244281



More information about the asterisk-users mailing list