| 1 |
cfg_rpc Module |
| 2 |
|
| 3 |
Miklos Tirpak |
| 4 |
|
| 5 |
<[email protected]> |
| 6 |
|
| 7 |
Copyright © 2007 iptelorg GmbH |
| 8 |
__________________________________________________________________ |
| 9 |
|
| 10 |
Table of Contents |
| 11 |
|
| 12 |
1. Admin Guide |
| 13 |
|
| 14 |
1. Overview |
| 15 |
2. Dependencies |
| 16 |
|
| 17 |
2.1. SIP Router Modules |
| 18 |
2.2. External Libraries or Applications |
| 19 |
|
| 20 |
3. RPC Commands |
| 21 |
|
| 22 |
3.1. cfg.list |
| 23 |
3.2. cfg.get |
| 24 |
3.3. cfg.seti |
| 25 |
3.4. cfg.set_now_int |
| 26 |
3.5. cfg.sets |
| 27 |
3.6. cfg.reset |
| 28 |
3.7. cfg.set_now_string |
| 29 |
3.8. cfg.set |
| 30 |
3.9. cfg.del |
| 31 |
3.10. cfg.set_delayed_int |
| 32 |
3.11. cfg.set_delayed_string |
| 33 |
3.12. cfg.set_delayed |
| 34 |
3.13. cfg.del_delayed |
| 35 |
3.14. cfg.commit |
| 36 |
3.15. cfg.rollback |
| 37 |
3.16. cfg.help |
| 38 |
3.17. cfg.diff |
| 39 |
3.18. cfg.add_group_inst |
| 40 |
3.19. cfg.del_group_inst |
| 41 |
|
| 42 |
List of Examples |
| 43 |
|
| 44 |
1.1. Use cfg.get RPC command |
| 45 |
1.2. Use cfg.get RPC command |
| 46 |
1.3. Use cfg.seti RPC command |
| 47 |
1.4. Use cfg.sets RPC command |
| 48 |
1.5. Use cfg.reset RPC command |
| 49 |
|
| 50 |
Chapter 1. Admin Guide |
| 51 |
|
| 52 |
Table of Contents |
| 53 |
|
| 54 |
1. Overview |
| 55 |
2. Dependencies |
| 56 |
|
| 57 |
2.1. SIP Router Modules |
| 58 |
2.2. External Libraries or Applications |
| 59 |
|
| 60 |
3. RPC Commands |
| 61 |
|
| 62 |
3.1. cfg.list |
| 63 |
3.2. cfg.get |
| 64 |
3.3. cfg.seti |
| 65 |
3.4. cfg.set_now_int |
| 66 |
3.5. cfg.sets |
| 67 |
3.6. cfg.reset |
| 68 |
3.7. cfg.set_now_string |
| 69 |
3.8. cfg.set |
| 70 |
3.9. cfg.del |
| 71 |
3.10. cfg.set_delayed_int |
| 72 |
3.11. cfg.set_delayed_string |
| 73 |
3.12. cfg.set_delayed |
| 74 |
3.13. cfg.del_delayed |
| 75 |
3.14. cfg.commit |
| 76 |
3.15. cfg.rollback |
| 77 |
3.16. cfg.help |
| 78 |
3.17. cfg.diff |
| 79 |
3.18. cfg.add_group_inst |
| 80 |
3.19. cfg.del_group_inst |
| 81 |
|
| 82 |
1. Overview |
| 83 |
|
| 84 |
The module implements RPC commands to set and get configuration |
| 85 |
variables on-the-fly, that are declared by Kamailio core and by the |
| 86 |
modules. |
| 87 |
|
| 88 |
For example, it can be used to fine-tune values for global parameters |
| 89 |
such as debug, tcp/sctp/dns attributes, without the need of restart. |
| 90 |
|
| 91 |
RPC connector modules, such as “ctl” or “xmlrpc”, although not a |
| 92 |
dependency, should be loaded in order to execute the RPC commands |
| 93 |
exported by this module. When the ctl module is loaded, the tool |
| 94 |
'kamcmd' can be used to execute the RPC commands implemented in this |
| 95 |
module. |
| 96 |
|
| 97 |
2. Dependencies |
| 98 |
|
| 99 |
2.1. SIP Router Modules |
| 100 |
2.2. External Libraries or Applications |
| 101 |
|
| 102 |
2.1. SIP Router Modules |
| 103 |
|
| 104 |
The following modules must be loaded before this module: |
| 105 |
* No dependencies on other SIP Router modules. |
| 106 |
|
| 107 |
2.2. External Libraries or Applications |
| 108 |
|
| 109 |
The following libraries or applications must be installed before |
| 110 |
running SIP Router with this module loaded: |
| 111 |
* None. |
| 112 |
|
| 113 |
3. RPC Commands |
| 114 |
|
| 115 |
3.1. cfg.list |
| 116 |
3.2. cfg.get |
| 117 |
3.3. cfg.seti |
| 118 |
3.4. cfg.set_now_int |
| 119 |
3.5. cfg.sets |
| 120 |
3.6. cfg.reset |
| 121 |
3.7. cfg.set_now_string |
| 122 |
3.8. cfg.set |
| 123 |
3.9. cfg.del |
| 124 |
3.10. cfg.set_delayed_int |
| 125 |
3.11. cfg.set_delayed_string |
| 126 |
3.12. cfg.set_delayed |
| 127 |
3.13. cfg.del_delayed |
| 128 |
3.14. cfg.commit |
| 129 |
3.15. cfg.rollback |
| 130 |
3.16. cfg.help |
| 131 |
3.17. cfg.diff |
| 132 |
3.18. cfg.add_group_inst |
| 133 |
3.19. cfg.del_group_inst |
| 134 |
|
| 135 |
The module implements the RPC commands documented in the next sections. |
| 136 |
|
| 137 |
3.1. cfg.list |
| 138 |
|
| 139 |
cfg.list - List the configuration variables. The function has one |
| 140 |
optional parameter: group name. |
| 141 |
|
| 142 |
Example 1.1. Use cfg.get RPC command |
| 143 |
... |
| 144 |
# kamcmd cfg.list |
| 145 |
... |
| 146 |
|
| 147 |
3.2. cfg.get |
| 148 |
|
| 149 |
cfg.get - Get the value of a configuration variable. The function |
| 150 |
accepts two parameters: group name, variable name, but if all the |
| 151 |
elements belonging to a certain group is wanted to be retrieved then |
| 152 |
only the group name would suffice as the function parameter. The group |
| 153 |
name can optionally contain the group instance id, for example foo[5]. |
| 154 |
|
| 155 |
Example 1.2. Use cfg.get RPC command |
| 156 |
... |
| 157 |
# kamcmd cfg.get core debug |
| 158 |
# kamcmd cfg.get tm |
| 159 |
... |
| 160 |
|
| 161 |
3.3. cfg.seti |
| 162 |
|
| 163 |
cfg.seti - Set the value of a configuration variable and commit the |
| 164 |
change immediately. The function accepts three parameters: group name, |
| 165 |
variable name, integer value. The group name can optionally contain the |
| 166 |
group instance id, for example foo[5]. |
| 167 |
|
| 168 |
Example 1.3. Use cfg.seti RPC command |
| 169 |
... |
| 170 |
# kamctl rpc cfg.seti core debug 1 |
| 171 |
... |
| 172 |
|
| 173 |
3.4. cfg.set_now_int |
| 174 |
|
| 175 |
cfg.set_now_int - This is an alias to the command cfg.seti. |
| 176 |
|
| 177 |
3.5. cfg.sets |
| 178 |
|
| 179 |
cfg.sets - Set the value of a configuration variable and commit the |
| 180 |
change immediately. The function accepts three parameters: group name, |
| 181 |
variable name, string value. The group name can optionally contain the |
| 182 |
group instance id, for example foo[5]. |
| 183 |
|
| 184 |
Example 1.4. Use cfg.sets RPC command |
| 185 |
... |
| 186 |
# kamctl rpc cfg.sets voicemail srv_ip "1.2.3.4" |
| 187 |
... |
| 188 |
|
| 189 |
3.6. cfg.reset |
| 190 |
|
| 191 |
cfg.reset - Reset the variable values of a configuration group. The |
| 192 |
function accepts only one parameter: group name. |
| 193 |
|
| 194 |
Example 1.5. Use cfg.reset RPC command |
| 195 |
... |
| 196 |
# kamcmd cfg.reset core |
| 197 |
... |
| 198 |
|
| 199 |
3.7. cfg.set_now_string |
| 200 |
|
| 201 |
cfg.set_now_string - This is an alias to the command cfg.sets. |
| 202 |
|
| 203 |
3.8. cfg.set |
| 204 |
|
| 205 |
cfg.set - Set the value of a configuration variable and commit the |
| 206 |
change immediately. This is a wrapper command for cfg.set_now_int and |
| 207 |
cfg.set_now_string depending on the type of the value provided. The |
| 208 |
function accepts three parameters: group name, variable name, |
| 209 |
int/string value. The group name can optionally contain the group |
| 210 |
instance id, for example foo[5]. |
| 211 |
|
| 212 |
3.9. cfg.del |
| 213 |
|
| 214 |
cfg.del - Delete the value of a configuration variable from a group |
| 215 |
instance and commit the change immediately. The value is reset to the |
| 216 |
default value and it follows the changes of that. The function accepts |
| 217 |
two parameters: group name, variable name. The group name must contain |
| 218 |
the group instance id, for example foo[5]. |
| 219 |
|
| 220 |
3.10. cfg.set_delayed_int |
| 221 |
|
| 222 |
cfg.set_delayed_int - Prepare the change of a configuration variable, |
| 223 |
but does not commit the new value yet. The function accepts three |
| 224 |
parameters: group name, variable name, integer value. The group name |
| 225 |
can optionally contain the group instance id, for example foo[5]. |
| 226 |
|
| 227 |
3.11. cfg.set_delayed_string |
| 228 |
|
| 229 |
cfg.set_delayed_string - Prepare the change of a configuration |
| 230 |
variable, but does not commit the new value yet. The function accepts |
| 231 |
three parameters: group name, variable name, string value. The group |
| 232 |
name can optionally contain the group instance id, for example foo[5]. |
| 233 |
|
| 234 |
3.12. cfg.set_delayed |
| 235 |
|
| 236 |
cfg.set_delayed - Prepare the change of a configuration variable, but |
| 237 |
does not commit the new value yet. This is a wrapper command for |
| 238 |
cfg.set_delayed_int and cfg.set_delayed_string depending on the type of |
| 239 |
the value provided. The function accepts three parameters: group name, |
| 240 |
variable name, int/string value. The group name can optionally contain |
| 241 |
the group instance id, for example foo[5]. |
| 242 |
|
| 243 |
3.13. cfg.del_delayed |
| 244 |
|
| 245 |
cfg.del_delayed - Prepare the deletion of the value of a configuration |
| 246 |
variable from a group instance, but does not commit the change yet. The |
| 247 |
value is reset to the default value and it follows the changes of that. |
| 248 |
The function accepts two parameters: group name, variable name. The |
| 249 |
group name must contain the group instance id, for example foo[5]. |
| 250 |
|
| 251 |
3.14. cfg.commit |
| 252 |
|
| 253 |
cfg.commit - Commit the previously prepared configuration changes. The |
| 254 |
function does not have any parameters. |
| 255 |
|
| 256 |
3.15. cfg.rollback |
| 257 |
|
| 258 |
cfg.rollback - Drop the prepared configuration changes. The function |
| 259 |
does not have any parameters. |
| 260 |
|
| 261 |
3.16. cfg.help |
| 262 |
|
| 263 |
cfg.help - Print the description of a configuration variable. The |
| 264 |
function accepts two parameters: group name, variable name. |
| 265 |
|
| 266 |
3.17. cfg.diff |
| 267 |
|
| 268 |
cfg.diff - List the pending configuration changes that have not been |
| 269 |
committed yet. The function does not have any parameters. |
| 270 |
|
| 271 |
3.18. cfg.add_group_inst |
| 272 |
|
| 273 |
cfg.add_group_inst - Add a new instance to an existing configuration |
| 274 |
group. The function accepts one parameter: group name[instance id], for |
| 275 |
example foo[5]. |
| 276 |
|
| 277 |
3.19. cfg.del_group_inst |
| 278 |
|
| 279 |
cfg.del_group_inst - Delete an instance of an existing configuration |
| 280 |
group. The function accepts one parameter: group name[instance id], for |
| 281 |
example foo[5]. |