VoIP.info Guide

Asterisk AMI configuration-file inspection and controlled update

Use GetConfig, ListCategories, CreateConfig and UpdateConfig without confusing file content, inherited effective values, a write response, a reload or loaded runtime state.

Reviewed 2026-10-16Asterisk branch-23-generated and branch-22-generated GetConfig, GetConfigJSON, ListCategories, CreateConfig and UpdateConfig action references plus official configuration-file, template, include, AMI-permission and network-security documentation reviewed October 16, 2026; installed branch, configuration directory, file ownership, generated-file owner, include graph, template inheritance, module parser, reload support, manager privileges and runtime outcome remain deployment specific; no PBX, module, manager session, configuration file, filesystem, reload, channel, packet, media stream or live call was inspected or testedAdvancedDocumentation based · not lab tested

Inventory the file before reading values

ListCategories names the categories in one configuration filename. GetConfig returns categories and contents and can scope the request to a category. Preserve filename, category order, duplicate names, timestamp, manager identity and ActionID rather than flattening the response into a key-value map.

GetConfigJSON is documented for rawman over the HTTP interface; it is a representation choice, not a stronger source of truth. Treat any secrets returned by these actions as sensitive operational data.

Filter duplicate categories and templates deliberately

GetConfig and GetConfigJSON accept a comma-separated category filter. The special TEMPLATES expression can include templates or restrict the result to templates; omitting it excludes templates by default. A category can therefore look incomplete when inherited content or a duplicate category was outside the request.

Record template inheritance and the #include or #tryinclude graph separately. A response for one filename is not proof that every effective value originated in that file.

Create only an intentionally empty destination

CreateConfig creates an empty file in the Asterisk configuration directory and is intended to precede UpdateConfig. It does not create a category, populate a valid module configuration or load anything into a running module.

Confirm the resolved configuration directory, filename policy, ownership, permissions, backup scope and management-platform ownership before use. Do not use the action to bypass a generator or supported administration layer.

Model UpdateConfig as an ordered edit list

UpdateConfig reads SrcFilename, writes DstFilename, and accepts six-digit indexed operations. The documented operations are NewCat, RenameCat, DelCat, EmptyCat, Update, Delete, Append and Insert; each uses the matching indexed category, variable, value, match, line and options fields.

Retain a before-image and the exact ordered request. Line is used by delete and insert, while catfilter can restrict operations when category names repeat. An accepted response is not a diff review.

Handle inheritance and reload as explicit choices

PreserveEffectiveContext controls whether effective category contents are preserved on a template change; the generated reference says its default is true. Because that choice can materialize inherited state, record it rather than assuming a template edit has only local effects.

Reload can request no reload, a reload, or a named module. Its presence does not prove the target module supports reload, accepted the new configuration or preserved active service. Capture the reload request and module-specific result separately.

Prove file, parser, runtime and outcome separately

Read back the destination file through a bounded action and compare it with the approved model. Then inspect the target module or object through its supported runtime surface and test the intended behavior in a controlled window. File equality does not prove parse success, loaded values or a successful call.

Limit AMI write classes and network reachability, redact secrets, and keep a tested rollback through the true configuration owner. No PBX, module, manager session, configuration file, filesystem, reload, channel, packet, media stream or live call was inspected or tested for this guide.

Connect configuration update to the owning module

The AMI module-control guide verifies module registration and reload support after a file change without treating write success as loaded state.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.