kamctl.ctlbase 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #
  2. # control tool for maintaining Kamailio
  3. #
  4. #===================================================================
  5. [ "${IMPCTLBASE}" = "yes" ] && return
  6. export IMPCTLBASE="yes"
  7. ##### ----------------------------------------------- #####
  8. ### common variables and functions for CTL engines
  9. #
  10. # period in which stats are reprinted
  11. if [ -z "$WATCH_PERIOD" ] ; then
  12. WATCH_PERIOD=2
  13. fi
  14. #
  15. ##### ------------------------------------------------ #####
  16. ### usage functions
  17. #
  18. usage_cisco_restart() {
  19. echo
  20. mecho " -- command 'cisco_restart' - restart CISCO phone (NOTIFY)"
  21. echo
  22. cat <<EOF
  23. cisco_restart <uri> ................ restart phone configured for <uri>
  24. EOF
  25. }
  26. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_cisco_restart"
  27. usage_online() {
  28. echo
  29. mecho " -- command 'online' - dump online users from memory"
  30. echo
  31. cat <<EOF
  32. online ............................. display online users
  33. EOF
  34. }
  35. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_online"
  36. usage_kamailio_monitor() {
  37. echo
  38. mecho " -- command 'monitor' - show internal status"
  39. echo
  40. cat <<EOF
  41. monitor ............................ show server's internal status
  42. EOF
  43. }
  44. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_kamailio_monitor"
  45. usage_ping() {
  46. echo
  47. mecho " -- command 'ping' - ping a SIP URI (OPTIONS)"
  48. echo
  49. cat <<EOF
  50. ping <uri> ......................... ping <uri> with SIP OPTIONS
  51. EOF
  52. }
  53. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_ping"
  54. usage_usrloc() {
  55. echo
  56. mecho " -- command 'ul|alias' - manage user location or aliases"
  57. echo
  58. cat <<EOF
  59. ul show [<username>]................... show in-RAM online users
  60. ul show --brief........................ show in-RAM online users in short format
  61. ul rm <username> [<contact URI>]....... delete user's usrloc entries
  62. ul add <username> <uri> ............... introduce a permanent usrloc entry
  63. ul add <username> <uri> <expires> ..... introduce a temporary usrloc entry
  64. ul add <user> <uri> <expires> <path> .. introduce a temporary usrloc entry
  65. EOF
  66. }
  67. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_usrloc"
  68. usage_ctlcommon() {
  69. echo
  70. mecho " -- command 'ps' - print details about running processes"
  71. echo
  72. cat <<EOF
  73. ps ................................. details about running processes
  74. EOF
  75. echo
  76. mecho " -- command 'uptime' - print uptime details"
  77. echo
  78. cat <<EOF
  79. uptime ............................. print start time end elapsed seconds
  80. EOF
  81. echo
  82. mecho " -- command 'stats' - print internal statistics"
  83. echo
  84. cat <<EOF
  85. stats [group]....................... dump all or a group of internall statistics
  86. EOF
  87. }
  88. USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_ctlcommon"