记得先加载 cfg_rpc 模块
`loadmodule "cfg_rpc.so"`
kamailio 起来之后 运行 `kamcmd cfg.list` 可以得到:
dispatcher: probing_threshold
dispatcher: inactive_threshold
dispatcher: ping_reply_codes
rtpengine: rtpengine_disable_tout
rtpengine: aggressive_redetection
rtpengine: rtpengine_tout_ms
rtpengine: queried_nodes_limit
rtpengine: rtpengine_retr
websocket: keepalive_timeout
websocket: enabled
xlog: methods_filter
siputils: ring_timeout
registrar: realm_pref
registrar: default_expires
registrar: default_expires_range
registrar: expires_range
registrar: min_expires
registrar: max_expires
registrar: max_contacts
registrar: retry_after
registrar: case_sensitive
registrar: default_q
registrar: append_branches
registrar: use_expired_contacts
maxfwd: max_limit
tm: auto_inv_100_reason
tm: default_reason
tm: ac_extra_hdrs
tm: ruri_matching
tm: via1_matching
tm: callid_matching
tm: callid_cseq_matching
tm: fr_timer
tm: fr_inv_timer
tm: fr_inv_timer_next
tm: wt_timer
tm: retr_timer1
tm: retr_timer2
tm: max_inv_lifetime
tm: max_noninv_lifetime
tm: noisy_ctimer
tm: auto_inv_100
tm: unix_tx_timeout
tm: restart_fr_on_each_reply
tm: pass_provisional_replies
tm: aggregate_challenges
tm: unmatched_cancel
tm: default_code
tm: reparse_invite
tm: blst_503
tm: blst_503_def_timeout
tm: blst_503_min_timeout
tm: blst_503_max_timeout
tm: blst_methods_add
tm: blst_methods_lookup
tm: cancel_b_method
core: debug
...
现在可以临时把 core:debug设置为3
`kamcmd cfg.seti core debug 3`
等问题复现拿到日志之后要记得用下面的命令进行恢复
`kamcmd cfg.seti core debug 2`
现在看下 registrar 模块的参数:
`kamcmd cfg.get registrar`
得到:
{
realm_pref: <null string>
default_expires: 3600
default_expires_range: 0
expires_range: 0
min_expires: 60
max_expires: 3600
max_contacts: 10
retry_after: 0
case_sensitive: 0
default_q: -1
append_branches: 1
use_expired_contacts: 0
}
现在要把 max_expires 设置为1800
`kamcmd cfg.seti registrar max_expires 1800`
现在再看一遍,`kamcmd cfg.get registrar`,得到:
{
realm_pref: <null string>
default_expires: 3600
default_expires_range: 0
expires_range: 0
min_expires: 60
max_expires: 1800
max_contacts: 10
retry_after: 0
case_sensitive: 1
default_q: -1
append_branches: 1
use_expired_contacts: 0
}
最后建议多读 Kamailio 官方文档,活学活用,为己所用