Total Newb, Quick Question!

Friends, where do I start saving all this code??? I’m looking at what appears to be some regex, but not sure where to save the file to! Sorry, complete newb here to Asterisk! Also, any tools you all suggest using or will a text editor suffice?

I organize my configuration files in a directory specific to the project or client.

When I think I have something workable, I ‘publish’ it to the /etc/asterisk/ directory.

emacs is my primary foil.

Thanks for the response. Great! So I’m assuming there’s a way to read in these files from Asterisk?

When Asterisk starts, it reads the configuration files from (by default) ‘/etc/asterisk/’

Each ‘module’ can be requested to reload it’s files without having to restart Asterisk. For example:

        sudo asterisk -x 'core reload'        # reload a bunch of stuff
        sudo asterisk -x 'dialplan reload'    # reload extensions.conf

My workflow is to:

  1. edit a file
  2. pass it through a ‘pre-processor’ to apply settings specific to a project or client
  3. set the UNIX file permissions
  4. ask the module to reload the file

Since this is a process likely to be repeated many times, I codify these steps in my ‘makefile’ so all I type (for dialplan changes) is:

  1. emacs extensions.conf.pre
  2. make dialplan

Here’s the makefile snippet:

        asterisk                        = sudo /usr/sbin/asterisk -C /etc/asterisk/${PROJECT}/asterisk.conf
dialplan:
        for     FILE in\
                        extensions.ael\
                        extensions.conf\
                        ;\
                do\
                preprocessor.pl -E -I preprocessor.pre $$FILE.pre\
                        >/etc/asterisk/${PROJECT}/$$FILE;\
                chmod u=rw,g=r,o=r /etc/asterisk/${PROJECT}/$$FILE;\
                done
        -${asterisk} -x 'ael reload'
        -${asterisk} -x 'dialplan reload'

Note that this is specific to my workflow. I’m sure most developers have a different workflow but you may get some ideas that are relevant to you.

Thanks so much for the info, appreciate it! I guess I’ll only know, once I get started! But is helpful, thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.