1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
mi_datagram Module
Andreea-Ancuta Onofrei
Voice Sistem SRL
Edited by
Andreea-Ancuta Onofrei
Copyright 2007 Voice Sistem SRL
__________________________________________________________________
Table of Contents
1. Admin Guide
1. Overview
2. DATAGRAM command syntax
3. Dependencies
3.1. Kamailio Modules
3.2. External Libraries or Applications
4. Parameters
4.1. socket_name (string)
4.2. children_count (string)
4.3. unix_socket_mode (integer)
4.4. unix_socket_group (integer) unix_socket_group (string)
4.5. unix_socket_user (integer) unix_socket_group (string)
4.6. socket_timeout (integer)
4.7. reply_indent (string)
5. Functions
6. Example
2. Frequently Asked Questions
List of Examples
1.1. Set socket_name parameter
1.2. Set children_count parameter
1.3. Set unix_socket_mode parameter
1.4. Set unix_socket_group parameter
1.5. Set unix_socket_user parameter
1.6. Set socket_timeout parameter
1.7. Set reply_ident parameter
1.8. DATAGRAM request
Chapter 1. Admin Guide
Table of Contents
1. Overview
2. DATAGRAM command syntax
3. Dependencies
3.1. Kamailio Modules
3.2. External Libraries or Applications
4. Parameters
4.1. socket_name (string)
4.2. children_count (string)
4.3. unix_socket_mode (integer)
4.4. unix_socket_group (integer) unix_socket_group (string)
4.5. unix_socket_user (integer) unix_socket_group (string)
4.6. socket_timeout (integer)
4.7. reply_indent (string)
5. Functions
6. Example
1. Overview
This is a module which provides a UNIX/UDP SOCKET transport layer
implementation for the Management Interface.
2. DATAGRAM command syntax
The external commands issued via DATAGRAM interface must follow the
following syntax:
* request = first_line (argument '\n')*
* first_line = ':'command_name':''\n'
* argument = (arg_name '::' (arg_value)? ) | (arg_value)
* arg_name = not-quoted_string
* arg_value = not-quoted_string | '"' string '"'
* not-quoted_string = string - {',",\n,\r}
3. Dependencies
3.1. Kamailio Modules
3.2. External Libraries or Applications
3.1. Kamailio Modules
The following modules must be loaded before this module:
* No dependencies on other Kamailio modules.
3.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* none
4. Parameters
4.1. socket_name (string)
4.2. children_count (string)
4.3. unix_socket_mode (integer)
4.4. unix_socket_group (integer) unix_socket_group (string)
4.5. unix_socket_user (integer) unix_socket_group (string)
4.6. socket_timeout (integer)
4.7. reply_indent (string)
4.1. socket_name (string)
The name of a UNIX SOCKET or an IP address. The UNIX datagram or UDP
socket will be created using this parameter in order to read the
external commands. Both IPv4 and IPv6 are supported.
Default value is NONE.
Example 1.1. Set socket_name parameter
...
modparam("mi_datagram", "socket_name", "/tmp/kamailio.sock")
...
modparam("mi_datagram", "socket_name", "udp:192.168.2.133:8080")
...
4.2. children_count (string)
The number of child processes to be created. Each child process will be
a datagram server.
Default value is 1.
Example 1.2. Set children_count parameter
...
modparam("mi_datagram", "children_count", 3)
...
4.3. unix_socket_mode (integer)
Permission to be used for creating the listening UNIX datagram socket.
Not necessary for a UDP socket. It follows the UNIX conventions.
Default value is 0660 (rw-rw----).
Example 1.3. Set unix_socket_mode parameter
...
modparam("mi_datagram", "unix_socket_mode", 0600)
...
4.4. unix_socket_group (integer) unix_socket_group (string)
Group to be used for creating the listening UNIX socket.
Default value is the inherited one.
Example 1.4. Set unix_socket_group parameter
...
modparam("mi_datagram", "unix_socket_group", 0)
modparam("mi_datagram", "unix_socket_group", "root")
...
4.5. unix_socket_user (integer) unix_socket_group (string)
User to be used for creating the listening UNIX socket.
Default value is the inherited one.
Example 1.5. Set unix_socket_user parameter
...
modparam("mi_datagram", "unix_socket_user", 0)
modparam("mi_datagram", "unix_socket_user", "root")
...
4.6. socket_timeout (integer)
The reply will expire after trying to sent it for socket_timeout
miliseconds.
Default value is 2000.
Example 1.6. Set socket_timeout parameter
...
modparam("mi_datagram", "socket_timeout", 2000)
...
4.7. reply_indent (string)
Strings to be used for line indentation. As the MI data structure is
tree oriendeted, the depth level will printed as identation.
Default value is ""\t" (TAB)".
Example 1.7. Set reply_ident parameter
...
modparam("mi_datagram", "reply_ident", " ")
...
5. Functions
No function exported to be used from configuration file.
6. Example
This is an example showing the DATAGRAM format for the "get_statistics
dialog: tm:" MI commad: response.
Example 1.8. DATAGRAM request
:get_statistics:\n
dialog:\n
tm:\n
Chapter 2. Frequently Asked Questions
2.1. Both UNIX and UDP type of socket can be created simultaneusly?
2.2. Is there a limit in the datagram request's size?
2.3. Where can I find more about Kamailio?
2.4. Where can I post a question about this module?
2.5. How can I report a bug?
2.1.
Both UNIX and UDP type of socket can be created simultaneusly?
This version supports only one kind of socket at a time. If there are
more than one value set for socket_name the last one will take effect.
2.2.
Is there a limit in the datagram request's size?
The maximum length of a datagram request or reply is 65457 bytes.
2.3.
Where can I find more about Kamailio?
Take a look at http://www.kamailio.org/.
2.4.
Where can I post a question about this module?
First at all check if your question was already answered on one of our
mailing lists:
* User Mailing List -
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
* Developer Mailing List -
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
E-mails regarding any stable Kamailio release should be sent to
<sr-users@lists.sip-router.org> and e-mails regarding development
versions should be sent to <sr-dev@lists.sip-router.org>.
If you want to keep the mail private, send it to
<sr-users@lists.sip-router.org>.
2.5.
How can I report a bug?
Please follow the guidelines provided at:
http://sip-router.org/tracker.
|