-
Notifications
You must be signed in to change notification settings - Fork 909
/
pua_xmpp_admin.xml
166 lines (154 loc) · 3.94 KB
/
pua_xmpp_admin.xml
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
<?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" [
<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
%docentities;
]>
<!-- Module User's Guide -->
<chapter>
<title>&adminguide;</title>
<section>
<title>Overview</title>
<para>
This module is a gateway for presence between SIP and XMPP.
</para>
<para>
It translates one format into another and uses xmpp, pua and presence
modules to manage the transmission of presence state information.
</para>
</section>
<section>
<title>Dependencies</title>
<section>
<title>&kamailio; Modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
<emphasis>presence</emphasis>.
</para>
</listitem>
<listitem>
<para>
<emphasis>pua</emphasis>.
</para>
</listitem>
<listitem>
<para>
<emphasis>xmpp</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before running
&kamailio; with this module loaded:
<itemizedlist>
<listitem>
<para>
<emphasis>libxml</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section>
<title>Parameters</title>
<section id="pua_xmpp.p.server_address">
<title><varname>server_address</varname>(str)</title>
<para>
The SIP URI specifying the address of the SIP server.
</para>
<example>
<title>Set <varname>server_address</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("pua_xmpp", "server_address", "sip:160.23.23.10")
...
</programlisting>
</example>
</section>
</section>
<section>
<title>Functions</title>
<para>
Functions exported to be used in configuration file.
</para>
<section id="pua_xmpp.f.pua_xmpp_notify">
<title>
<function moreinfo="none">pua_xmpp_notify()</function>
</title>
<para>
Function that handles Notify messages addressed to a user from
an xmpp domain. It requires filtering after method and domain in
configuration file. If the function is successful, a 2xx reply must
be sent.
</para>
<para>
This function can be used from REQUEST_ROUTE.
</para>
<example>
<title><function>pua_xmpp_notify</function> usage</title>
<programlisting format="linespecific">
...
if( is_method("NOTIFY") && uri=~"sip:.+@sip-xmpp.kamailio.org")
{
if(pua_xmpp_notify())
t_reply("200", "OK");
exit;
}
...
</programlisting>
</example>
</section>
<section id="pua_xmpp.f.pua_xmpp_req_winfo">
<title>
<function moreinfo="none">pua_xmpp_req_winfo(request_uri, expires)</function>
</title>
<para>
Function called when a Subscribe addressed to a user from an
xmpp domain is received. It calls sending a Subscribe for
winfo for the user, and the following Notify with dialog-info
is translated into a subscription in xmpp.
It also requires filtering in configuration file, after method,
domain and event(only for presence).
</para>
<para>
It takes 2 parameters: request_uri and the value of Expires header field
in received Subscribe.
</para>
<para>
This function can be used from REQUEST_ROUTE.
</para>
<example>
<title><function>xmpp_send_winfo</function> usage</title>
<programlisting format="linespecific">
...
if( is_method("SUBSCRIBE"))
{
handle_subscribe();
if(uri=~"sip:.+@sip-xmpp.siphub.ro" && $hdr(Event)== "presence")
{
pua_xmpp_req_winfo("$ruri", "$hdr(Expires)");
}
t_release();
}
...
</programlisting>
</example>
</section>
</section>
<section>
<title> Filtering </title>
<para>
Instead of "sip-xmpp.siphub.ro" in the example you should use the value
set for the xmpp module parameter named 'gateway_domain'.
</para>
</section>
</chapter>