Asterisk Manager API Action UpdateConfig
Created by: justhamade,Last modification on Sat 16 of Aug, 2008 [01:39 UTC] by vadim
UpdateConfig
- CLI> manager show command updateconfig
Synopsis: Update basic configuration
Privilege: config,all
Description: A 'UpdateConfig' action will dump the contents of a configuration
file by category and contents.
Variables (X's represent 6 digit number beginning with 000000):
SrcFilename: Configuration filename to read(e.g. foo.conf)
DstFilename: Configuration filename to write(e.g. foo.conf)
Reload: Whether or not a reload should take place (or name of specific module)
Action-XXXXXX: Action to Take (NewCat,RenameCat,DelCat,Update,Delete,Append)
Cat-XXXXXX: Category to operate on
Var-XXXXXX: Variable to work on
Value-XXXXXX: Value to work on
Match-XXXXXX: Extra match required to match line
Example:
action:updateconfig
reload:yes
srcfilename:manager.conf
dstfilename:manager.conf
Action-000000:append
Cat-000000:newuser
Var-000000:secret
Value-000000:nottelling
To modify extensions.conf one need to prefix the value by '>'.
Example:
action:updateconfig
reload:yes
srcfilename: extensions.conf
dstfilename: extensions.conf
Action-000000:append
Cat-000000: ami-test
Var-000000:exten
Value-000000:>999,1,Dial(SIP/Bob)
Action: Delete
action: updateconfig
srcfilename: manager.conf
dstfilename: manager.conf
action-000000: delete
cat-000000: newuser
var-000000: secret
value-000000: nottelling
match-000000: nottelling
srcfilename: manager.conf
dstfilename: manager.conf
action-000000: delete
cat-000000: newuser
var-000000: secret
value-000000: nottelling
match-000000: nottelling
Both "value" and "match" must be set to delete an entry. Not setting "match" will delete all entries with the variable name in "var".

Comments
333Error in updateconfig
Help me, please, as soon as possible!
Thanks
333=> vs =
<blockquote>
This command cannot be used to add extensions, agents, conference rooms, voicemailboxes to the configuration files, as it outputs in the form "var = value" instead of "var => value" form that is required.
</blockquote>
But the extensions.conf wiki page says:
<blockquote>
In the syntax of the extensions.conf file, each execution step in an extension is written in this format:
exten = extension,priority,Command(parameters)
where the equal sign can also be ornamented as an arrow, i.e., "=>", a form most often seen in many examples.
</blockquote>
So it should be possible.