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

2017-04-07 Thread Victor Villarreal
Hi Nathan,

Personally, I create a git repo on /etc/asterisk/ folder.

With this approach, you not only can backup current dilplan on another
location (another private server, or private repo on Bitbucket account).
You can follow all the change history you made.

Simply install git, then go to /etc/asterisk/ an issue the following
commands:

#> git init
#> git add.
#> git commit -a 'First commit'

Cheers...

El 7 abr. 2017 10:48, "Steve Edwards"  escribió:

> On Thu, 6 Apr 2017, Steve Edwards wrote:
>
> You're welcome to the script at:
>>
>> http://www.sedwards.com/recover-show-dialplan.php
>>
>
> Sorry about that...
>
> Try:
>
> http://www.sedwards.com/recover-show-dialplan.txt
>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
> https://www.linkedin.com/in/steve-edwards-4244281
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>  https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

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

2017-04-07 Thread Steve Edwards

On Thu, 6 Apr 2017, Steve Edwards wrote:


You're welcome to the script at:

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


Sorry about that...

Try:

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

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

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


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

2017-04-06 Thread Steve Edwards

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   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


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

2017-04-06 Thread Tzafrir Cohen
On Thu, Apr 06, 2017 at 09:54:25AM +, Nathan Anderson wrote:
> 'lo,
> 
> So yesterday, one of our clients had the misfortune of having the disk that 
> their Asterisk config (*.conf) was stored on take a dirt nap.  Of course, 
> Asterisk was still running at the time, and everything continued to work 
> (except for voicemail, which was stored on the same disk) right up until I 
> shut down Asterisk to investigate what was going on.  Because the disk was 
> dead, though, I couldn't start Asterisk back up after that, and OF COURSE the 
> backups were not firing off correctly so now we are faced with regenerating 
> the config again (including dialplan) from scratch.
> 
> 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...

I'm not sure this works. But it's worth a shot: (bind-?)mount a writable
file system at /etc/asterisk .

Be sure to umount it quickly enough after the write.

-- 
   Tzafrir Cohen
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


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

2017-04-06 Thread John Novack



Nathan Anderson wrote:

'lo,

So yesterday, one of our clients had the misfortune of having the disk that 
their Asterisk config (*.conf) was stored on take a dirt nap.  Of course, 
Asterisk was still running at the time, and everything continued to work 
(except for voicemail, which was stored on the same disk) right up until I shut 
down Asterisk to investigate what was going on.  Because the disk was dead, 
though, I couldn't start Asterisk back up after that, and OF COURSE the backups 
were not firing off correctly so now we are faced with regenerating the config 
again (including dialplan) from scratch.

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...

Thanks,

-- Nathan


Isn't this a task for Linux and a cron job rather than asterisk?
Simplest thing would be to copy to another machine even off site, all the confs 
and whatever else would help you resurrect a machine more quickly.
Backups not "firing off correctly"  means what?

When changes are made to the dialplan a copy off site or at least off machine 
is in order

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.


John Novack

--

Dog is my Co-pilot


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


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

2017-04-06 Thread Jean Aunis
You can execute something like asterisk -rx "dialplan show" > 
some_file.conf, but unfortunately the result cannot be directly parsed 
by Asterisk. Still it will give you a readable snapshot of your current 
dialplan.



Le 06/04/2017 à 11:54, Nathan Anderson a écrit :

'lo,

So yesterday, one of our clients had the misfortune of having the disk that 
their Asterisk config (*.conf) was stored on take a dirt nap.  Of course, 
Asterisk was still running at the time, and everything continued to work 
(except for voicemail, which was stored on the same disk) right up until I shut 
down Asterisk to investigate what was going on.  Because the disk was dead, 
though, I couldn't start Asterisk back up after that, and OF COURSE the backups 
were not firing off correctly so now we are faced with regenerating the config 
again (including dialplan) from scratch.

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...

Thanks,

-- Nathan




--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


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

2017-04-06 Thread Nathan Anderson
'lo,

So yesterday, one of our clients had the misfortune of having the disk that 
their Asterisk config (*.conf) was stored on take a dirt nap.  Of course, 
Asterisk was still running at the time, and everything continued to work 
(except for voicemail, which was stored on the same disk) right up until I shut 
down Asterisk to investigate what was going on.  Because the disk was dead, 
though, I couldn't start Asterisk back up after that, and OF COURSE the backups 
were not firing off correctly so now we are faced with regenerating the config 
again (including dialplan) from scratch.

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...

Thanks,

-- Nathan

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users