Skip to content

Commit

Permalink
pua: docs - removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 13, 2023
1 parent ee0c084 commit 4ac5ab5
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
6 changes: 3 additions & 3 deletions src/modules/pua/doc/pua.xml
Expand Up @@ -35,11 +35,11 @@
</copyright>
</bookinfo>
<toc></toc>

<xi:include href="pua_admin.xml"/>
<xi:include href="pua_devel.xml"/>


</book>


36 changes: 18 additions & 18 deletions src/modules/pua/doc/pua_admin.xml
Expand Up @@ -82,12 +82,12 @@
<section>
<title><varname>hash_size</varname> (int)</title>
<para>
The size of the hash table used for storing SUBSCRIBE and
PUBLISH information.
The size of the hash table used for storing SUBSCRIBE and
PUBLISH information.
This parameter will be used as the power of 2 when computing table size.
</para>
<para>
<emphasis>Default value is <quote>9</quote>.
<emphasis>Default value is <quote>9</quote>.
</emphasis>
</para>
<example>
Expand Down Expand Up @@ -175,8 +175,8 @@ modparam("pua", "default_expires", 3600)
<title><varname>update_period</varname> (int)</title>
<para>
The interval at which the information in database and hash table
should be updated. In the case of the hash table updating means
deleting expired messages.
should be updated. In the case of the hash table updating means
deleting expired messages.
Setting a value less than or equal to zero, disables updates.
</para>
<para>
Expand Down Expand Up @@ -216,13 +216,13 @@ modparam("pua", "outbound_proxy", "sip:outbound.example.com")
<title><varname>dlginfo_increase_version</varname> (int)</title>
<para>
When sending PUBLISH messages for Event: dialog, the body contains an
XML document according to RFC 4235. This XML document contains a
XML document according to RFC 4235. This XML document contains a
version attribute to easily detect changes in the dialog state.
By setting this parameter, the pua module parses the XML document and
sets the version attribute to the proper value. If the receiver of
the PUBLISH does not care about the version parameter (e.g. like
&kamailio; presence_dialoginfo module) it makes no sense to waste
CPU resources for parsing the XML body and the parameter should be
&kamailio; presence_dialoginfo module) it makes no sense to waste
CPU resources for parsing the XML body and the parameter should be
set to 0.
</para>
<para>
Expand All @@ -242,13 +242,13 @@ modparam("pua", "dlginfo_increase_version", 1)
<title><varname>reginfo_increase_version</varname> (int)</title>
<para>
When sending PUBLISH messages for Event: reg, the body contains an
XML document according to RFC 4235(?). This XML document contains a
XML document according to RFC 4235(?). This XML document contains a
version attribute to easily detect changes in the registration state.
By setting this parameter, the pua module parses the XML document and
sets the version attribute to the proper value. If the receiver of
the PUBLISH does not care about the version parameter (e.g. like
&kamailio; presence_reginfo module) it makes no sense to waste
CPU resources for parsing the XML body and the parameter should be
&kamailio; presence_reginfo module) it makes no sense to waste
CPU resources for parsing the XML body and the parameter should be
set to 0.
</para>
<para>
Expand All @@ -268,7 +268,7 @@ modparam("pua", "reginfo_increase_version", 1)
<title><varname>db_mode</varname> (int)</title>
<para>
The module supports 2 modes of operation, high speed memory
based storage (mode 0), and database only (mode 2) where all
based storage (mode 0), and database only (mode 2) where all
data is stored in a database, allowing scalability at the expense of speed.
Mode 1 is reserved.
</para>
Expand Down Expand Up @@ -306,7 +306,7 @@ modparam("pua", "db_table_lock_write", 0)
</programlisting>
</example>
</section>

<section>
<title><varname>check_remote_contact</varname> (int)</title>
<para>
Expand Down Expand Up @@ -355,7 +355,7 @@ modparam("pua", "fetch_rows", 1000)

<section>
<title>Functions</title>

<section>
<title>
<function moreinfo="none">pua_update_contact()</function>
Expand All @@ -364,7 +364,7 @@ modparam("pua", "fetch_rows", 1000)
The remote target can be updated by the Contact of a subsequent in
dialog request. In the PUA watcher case (sending a SUBSCRIBE messages),
this means that the remote target for the following Subscribe messages
can be updated at any time by the contact of a Notify message.
can be updated at any time by the contact of a Notify message.
If this function is called on request route on receiving a Notify
message, it will try to update the stored remote target.
</para>
Expand All @@ -386,7 +386,7 @@ modparam("pua", "fetch_rows", 1000)
</listitem>
</itemizedlist>
</para>

<example>
<title><function>pua_update_contact</function> usage</title>
<programlisting format="linespecific">
Expand Down Expand Up @@ -428,8 +428,8 @@ if(method=="NOTIFY")
<section>
<title>Installation</title>
<para>
The module requires one table in the &kamailio; database: pua. The SQL
syntax to create it can be found in presence_xml-create.sql
The module requires one table in the &kamailio; database: pua. The SQL
syntax to create it can be found in presence_xml-create.sql
script in the database directories in the kamailio/scripts folder.
You can also find the complete database documentation on the
project webpage, &kamailiodbdocslink;.
Expand Down
80 changes: 40 additions & 40 deletions src/modules/pua/doc/pua_devel.xml
Expand Up @@ -10,7 +10,7 @@
<!-- Module Developer's Guide -->

<chapter>

<title>&develguide;</title>
<para>
The module provides the following functions that can be used
Expand All @@ -21,7 +21,7 @@
<function moreinfo="none">bind_pua(pua_api_t* api)</function>
</title>
<para>
This function binds the pua modules and fills the structure
This function binds the pua modules and fills the structure
with the two exported functions.
</para>
<example>
Expand Down Expand Up @@ -53,9 +53,9 @@ typedef struct pua_api {
typedef int (*send_publish_t)(publ_info_t* publ);
...
</programlisting>
</para>
</para>
<para>
This function receives as a parameter a structure with Publish
This function receives as a parameter a structure with Publish
required information and sends a Publish message.
</para>
<para>
Expand All @@ -67,14 +67,14 @@ typedef struct publ_info

str id; /* (optional )a value unique for one combination
of pres_uri and flag */
str* pres_uri; /* the presentity uri */
str* body; /* the body of the Publish message;
can be NULL in case of an update expires*/
str* pres_uri; /* the presentity uri */
str* body; /* the body of the Publish message;
can be NULL in case of an update expires*/
int expires; /* the expires value that will be used in
Publish Expires header*/
Publish Expires header*/
int flag; /* it can be : INSERT_TYPE or UPDATE_TYPE
if missing it will be established according
to the result of the search in hash table*/
if missing it will be established according
to the result of the search in hash table*/
int source_flag; /* flag identifying the resource ;
supported values: UL_PUBLISH, MI_PUBLISH,
BLA_PUBLISH, XMPP_PUBLISH*/
Expand All @@ -86,7 +86,7 @@ typedef struct publ_info
for that event)*/
str* etag; /* (optional) the value of the etag the request
should match */
str* outbound_proxy;/* outbound_proxy to use when sending the
str* outbound_proxy;/* outbound_proxy to use when sending the
Publish request */
str* extra_headers /* (optional) extra_headers that should be added
to Publish msg*/
Expand All @@ -106,9 +106,9 @@ typedef struct publ_info
typedef int (*send_subscribe_t)(subs_info_t* subs);
...
</programlisting>
</para>
</para>
<para>
This function receives as a parameter a structure with Subscribe
This function receives as a parameter a structure with Subscribe
required information and sends a Subscribe message.
</para>
<para>
Expand All @@ -119,24 +119,24 @@ typedef struct subs_info

str id; /* an id value unique for one combination
of pres_uri and flag */
str* pres_uri; /* the presentity uri */
str* pres_uri; /* the presentity uri */
str* watcher_uri; /* the watcher uri */
str* contact; /* the uri that will be used in
Contact header*/
Contact header*/
str* remote_target; /* the uri that will be used as R-URI
for the Subscribe message(not compulsory;
if not set the value of the pres_uri field
is used) */
str* outbound_proxy; /* the outbound_proxy to use when sending the
str* outbound_proxy; /* the outbound_proxy to use when sending the
Subscribe request*/
int event; /* the event flag; supported value:
PRESENCE_EVENT, BLA_EVENT, PWINFO_EVENT*/
int event; /* the event flag; supported value:
PRESENCE_EVENT, BLA_EVENT, PWINFO_EVENT*/
int expires; /* the expires value that will be used in
Subscribe Expires header */
Subscribe Expires header */
int flag; /* it can be : INSERT_TYPE or UPDATE_TYPE
not compulsory */
not compulsory */
int source_flag; /* flag identifying the resource ;
supported values: MI_SUBSCRIBE,
supported values: MI_SUBSCRIBE,
BLA_SUBSCRIBE, XMPP_SUBSCRIBE,
XMPP_INITIAL_SUBS */
}subs_info_t;
Expand All @@ -155,21 +155,21 @@ typedef struct subs_info
typedef int (*query_dialog_t)(ua_pres_t* presentity);
...
</programlisting>
</para>
</para>
<para>
This function checks is the parameter corresponds to a stored
Subscribe initiated dialog.
Subscribe initiated dialog.
</para>
<example>
<title><function>pua_is_dialog </function>usage example</title>
<programlisting format="linespecific">
...
...
if(pua_is_dialog(dialog) &lt; 0)
{
LM_ERR("querying dialog\n");
goto error;
}
...
...
</programlisting>
</example>
</section>
Expand All @@ -186,7 +186,7 @@ typedef int (*register_puacb_t)(int types, pua_cb f, void* param );
...
</programlisting>
</para>

<para>
This function registers a callback to be called on receiving the reply message
for a sent Publish or Subscribe request.
Expand All @@ -205,7 +205,7 @@ typedef int (*register_puacb_t)(int types, pua_cb f, void* param );
LM_ERR("Could not register callback\n");
return -1;
}
...
...
</programlisting>
<para>
The callback function type:
Expand All @@ -226,54 +226,54 @@ typedef int (pua_cb)(ua_pres_t* hentity, struct sip_msg*);
Field type:
<programlisting format="linespecific">
...
typedef int (*add_pua_event_t)(int ev_flag, char* name,
typedef int (*add_pua_event_t)(int ev_flag, char* name,
char* content_type,evs_process_body_t* process_body);

- ev_flag : an event flag defined as a macro in pua module
- ev_flag : an event flag defined as a macro in pua module
- name : the event name to be used in Event request headers
- content_type: the default content_type for Publish body for
- content_type: the default content_type for Publish body for
that event (NULL if winfo event)
- process_body: function that processes the received body before
- process_body: function that processes the received body before
using it to construct the PUBLISH request
(NULL if winfo event)
...
</programlisting>
</para>
<para>
This function allows registering new events to the pua module.
Now there are 4 events supported by the pua module: presence,
presence;winfo, message-summary, dialog;sla, application/reginfo+xml.
Now there are 4 events supported by the pua module: presence,
presence;winfo, message-summary, dialog;sla, application/reginfo+xml.
These events are registered from within the pua module.
</para>
<para>
Filed type for process_body:
Filed type for process_body:
<programlisting format="linespecific">
...
typedef int (evs_process_body_t)(struct publ_info* publ,
typedef int (evs_process_body_t)(struct publ_info* publ,
str** final_body, int ver, str* tuple);
- publ : the structure received as a parameter in send_publish
- publ : the structure received as a parameter in send_publish
function ( initial body found in publ->body)
- final_body: the pointer where the result(final_body) should be stored
- final_body: the pointer where the result(final_body) should be stored
- ver : a counter for the sent Publish requests
(used for winfo events)
- tuple : a unique identifier for the resource;
if an initial Publish it should be returned as a result
and it will be stored for that record, otherwise it will
be given as a parameter;
be given as a parameter;
...
</programlisting>
</para>
<example>
<title><function>add_event </function>usage example</title>
<programlisting format="linespecific">
...
if(pua.add_event((PRESENCE_EVENT, "presence", "application/pidf+xml",
if(pua.add_event((PRESENCE_EVENT, "presence", "application/pidf+xml",
pres_process_body) &amp; 0)
{
LM_ERR("Could not register new event\n");
return -1;
}
...
...
</programlisting>
</example>

Expand Down

0 comments on commit 4ac5ab5

Please sign in to comment.