File: pdb_admin.xml

package info (click to toggle)
kamailio 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 56,100 kB
  • sloc: ansic: 552,832; xml: 166,484; sh: 8,659; makefile: 7,676; sql: 6,235; perl: 3,487; yacc: 3,428; python: 1,457; cpp: 1,219; php: 1,047; java: 449; pascal: 194; cs: 40; awk: 27
file content (182 lines) | stat: -rw-r--r-- 5,131 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [

<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
%docentities;

]>

<chapter>
	<title>&adminguide;</title>
	
	<section>
	<title>Overview</title>
	<para>
	This is a module for fast number portability handling. The client is this module
	and the server exists in the /utils/pdbt directory.
	The PDB module and server supports load-balancing and aggressive timeouts.
	Normally it does not need more than a few ms to query the remote server and return
	the reply to the configuration script.
	</para>
	<para>
	The pdb module allows &kamailio; to send queries to a list of servers
  	and store the answer in an AVP. The idea is to ask all servers in
  	parallel and use the first answer, that comes back. A timeout for the
	query can be defined in milliseconds. The queying can be activated and
  	deactivated using FIFO commands.
	</para>
	</section>

	<section>
		<title>Dependencies</title>
		<section>
			<title>&kamailio; Modules</title>
			<para>
			The module depends on the following modules (in the other words 
			the listed modules must be loaded before this module):
			</para>
			<itemizedlist>
			<listitem>
				<para><emphasis>none</emphasis></para>
			</listitem>
			</itemizedlist>
		</section>
		<section>
			<title>External Libraries or Applications</title>
			<para>
			The following libraries or applications must be installed 
			before running &kamailio; with this module loaded:
			</para>
			<itemizedlist>
				<listitem>
				<para><emphasis>The PDB server</emphasis></para>
				</listitem>
			</itemizedlist>
		</section>
	</section>


	<section>
	<title>Parameters</title>
    <section>
	    <title><varname>timeout</varname> (integer)</title>
	    <para>
			This is the timeout in milliseconds for the pdb_query function.
	    </para>
	    <para>
		    <emphasis>
			    Default value is <quote>50</quote>.
		    </emphasis>
	    </para>
	    <example>
		    <title>Set <varname>timeout</varname> parameter</title>
		    <programlisting format="linespecific">
...
modparam("pdb", "timeout", 10)
...
		    </programlisting>
	    </example>
    </section>
    <section>
	    <title><varname>server</varname> (string)</title>
	    <para>
			This is the list of servers to be used by the pdb_query function.
      Queries will be sent in parallel to all servers configured in this list.
			This parameter is mandatory.
	    </para>
	    <example>
		    <title>Set <varname>server</varname> parameter</title>
		    <programlisting format="linespecific">
...
modparam("pdb", "server", "localhost:10001,host.name:10001,192.168.1.7:10002")
...
		    </programlisting>
	    </example>
    </section>
	</section>
	<section>
		<title>Functions</title>
		<section>
	    <title>
				<function moreinfo="none">pdb_query (string query, string dstavp)</function>
	    </title>
	    <para>
				Sends the query string to all configured servers and stores the answer in
				dstavp. If it takes more than the configured timeout, false is returned.
				
				Pseudo-variables or AVPs can be used for the query string.
				
				The answer must consist of the null terminated query string followed by
				a two byte integer value in network byte order. The integer value will
				be stored in the given AVP.
	    </para>
			<example>
				<title><function>pdb_query</function> usage</title>
				<programlisting format="linespecific">
...
# query external service for routing information
if (!pdb_query("$rU", "$avp(i:82)"))
  $avp(i:82) = 0; # default routing
}
cr_route("$avp(i:82)", "$rd", "$rU", "$rU", "call_id");
...
				</programlisting>
			</example>
		</section>
	</section>
	<section>
		<title><acronym>MI</acronym> Commands</title>
		<section>
	    <title>
				<function moreinfo="none">pdb_status</function>
	    </title>
	    <para>
				Prints the status of the module.
				This can either be "active" or "deactivated".
	    </para>
			<example>
				<title><function>pdb_status</function> usage</title>
				<programlisting format="linespecific">
...
&ctltool; fifo pdb_status
...
				</programlisting>
	    </example>
		</section>
		<section>
	    <title>
				<function moreinfo="none">pdb_activate</function>
	    </title>
	    <para>
				Activates the module. This is the default after loading the module.
	    </para>
			<example>
				<title><function>pdb_activate</function> usage</title>
				<programlisting format="linespecific">
...
&ctltool; fifo pdb_activate
...
				</programlisting>
	    </example>
		</section>
		<section>
	    <title>
				<function moreinfo="none">pdb_deactivate</function>
	    </title>
	    <para>
				Deactivates the module. No more queries are performed until it is
				activated again. As long as the module is deactivated, the
				pdb_query function will return -1.
	    </para>
			<example>
				<title><function>pdb_deactivate</function> usage</title>
				<programlisting format="linespecific">
...
&ctltool; fifo pdb_deactivate
...
				</programlisting>
	    </example>
		</section>
	</section>
</chapter>