Read and change system configuration
These methods read and write configuration keys of the switch, including keys that have no field in the panel. Only the root customer may call them. They change the configuration keys only, not the settings of the System Parameters screens.
getSystemConfig
Section titled “getSystemConfig”Returns all known keys with their current and default values, or one key.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
key |
string | no | Return only this key |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
config |
array | One struct per key with key, current_value and default_value, all strings |
Example
Section titled “Example”call("getSystemConfig", {"key": "system/sip/headers/passthrough"}){ "result": "OK", "config": [ {"key": "system/sip/headers/passthrough", "current_value": "", "default_value": ""}, ],}setSystemConfig
Section titled “setSystemConfig”Sets the value of one key.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
key |
string | yes | Name of the key. Only keys returned by getSystemConfig are accepted |
value |
string | yes | New value |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”Pass the Remote-Party-ID header from trusted networks through to the other call leg:
call("setSystemConfig", {"key": "system/sip/headers/passthrough", "value": "Remote-Party-ID"}){"result": "OK"}