Browse code

corex: a new module to collect reimplemented core cfg functions

- old core functions for cofiguration file do not take variables in the
parameters, working only with static strings or integers
- some of them will be reimplemented in corex moduel to add support for
variables, making the parameters to be dynamic at runtime
- append_branch(...) was reimplemented at this moment, allowing URI and
Q parameters to contain variables
- there are also brand new features - two RPC commands, one to list the
listen sockets and the other to list the hostname aliases
- name of the module comes from CORE eXtensions

Daniel-Constantin Mierla authored on 30/08/2012 20:38:11
Showing 10 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+# $Id$
1
+#
2
+# WARNING: do not run this directly, it should be run by the master Makefile
3
+
4
+include ../../Makefile.defs
5
+auto_gen=
6
+NAME=corex.so
7
+LIBS=
8
+
9
+DEFS+=-DOPENSER_MOD_INTERFACE
10
+
11
+include ../../Makefile.modules
0 12
new file mode 100644
... ...
@@ -0,0 +1,130 @@
0
+COREX Module
1
+
2
+Daniel-Constantin Mierla
3
+
4
+   <miconda@gmail.com>
5
+
6
+Edited by
7
+
8
+Daniel-Constantin Mierla
9
+
10
+   <miconda@gmail.com>
11
+
12
+   Copyright � 2012 asipto.com
13
+     __________________________________________________________________
14
+
15
+   Table of Contents
16
+
17
+   1. Admin Guide
18
+
19
+        1. Overview
20
+        2. Dependencies
21
+
22
+              2.1. Kamailio Modules
23
+              2.2. External Libraries or Applications
24
+
25
+        3. Functions
26
+
27
+              3.1. append_branch([ uri, [ q ] ])
28
+
29
+        4. RPC Commands
30
+
31
+              4.1. corex.list_sockets
32
+              4.2. corex.list_aliases
33
+
34
+   List of Examples
35
+
36
+   1.1. append_branch usage
37
+
38
+Chapter 1. Admin Guide
39
+
40
+   Table of Contents
41
+
42
+   1. Overview
43
+   2. Dependencies
44
+
45
+        2.1. Kamailio Modules
46
+        2.2. External Libraries or Applications
47
+
48
+   3. Functions
49
+
50
+        3.1. append_branch([ uri, [ q ] ])
51
+
52
+   4. RPC Commands
53
+
54
+        4.1. corex.list_sockets
55
+        4.2. corex.list_aliases
56
+
57
+1. Overview
58
+
59
+   This module provides reimplementation of very old functions that were
60
+   in core and supported only static string or integer parameters. The new
61
+   versions bring support for dynamic parameters (allowing variables
62
+   inside the parameters).
63
+
64
+   There are also brand new features, related to core internals, but
65
+   controlled from configuration file or via control interfaces.
66
+
67
+   Contributions to this module must be done under BSD license, to follow
68
+   the requirements of the core contributions.
69
+
70
+2. Dependencies
71
+
72
+   2.1. Kamailio Modules
73
+   2.2. External Libraries or Applications
74
+
75
+2.1. Kamailio Modules
76
+
77
+   The following modules must be loaded before this module:
78
+     * None.
79
+
80
+2.2. External Libraries or Applications
81
+
82
+   The following libraries or applications must be installed before
83
+   running Kamailio with this module loaded:
84
+     * None
85
+
86
+3. Functions
87
+
88
+   3.1. append_branch([ uri, [ q ] ])
89
+
90
+3.1. append_branch([ uri, [ q ] ])
91
+
92
+   Append a new branch to the destination set, useful to build the
93
+   addresses for parallel forking or redirect replies.
94
+
95
+   Both parameters are optional, If no uri parameter is provided, then the
96
+   address from request URI (r-uri) is taken to build the new branch.
97
+
98
+   Meaning of the parameters is as follows:
99
+     * uri - SIP address of the branch to be used as R-URI in the outgoing
100
+       request.
101
+     * q - the Q value to set the priority of the branch based on Contact
102
+       address specifications
103
+
104
+   This function can be used from REQUEST_ROUTE or FAILURE_ROUTE.
105
+
106
+   Example 1.1. append_branch usage
107
+...
108
+    append_branch();
109
+    append_branch("$avp(uri)", "0.5");
110
+...
111
+
112
+4. RPC Commands
113
+
114
+   4.1. corex.list_sockets
115
+   4.2. corex.list_aliases
116
+
117
+4.1. corex.list_sockets
118
+
119
+   Print the list of sockets the application is listening on.
120
+
121
+   Example:
122
+                sercmd corex.list_sockets
123
+
124
+4.2. corex.list_aliases
125
+
126
+   Print the list of hostname aliases used to match myself condition.
127
+
128
+   Example:
129
+                sercmd corex.list_aliases
0 130
new file mode 100644
... ...
@@ -0,0 +1,90 @@
0
+/**
1
+ * $Id$
2
+ *
3
+ * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+ *
19
+ */
20
+
21
+#include <stdio.h>
22
+#include <unistd.h>
23
+#include <stdlib.h>
24
+#include <string.h>
25
+
26
+#include "../../dprint.h"
27
+#include "../../dset.h"
28
+
29
+#include "corex_lib.h"
30
+
31
+/**
32
+ * append new branches with generic parameters
33
+ */
34
+int corex_append_branch(sip_msg_t *msg, gparam_t *pu, gparam_t *pq)
35
+{
36
+	str uri = {0};
37
+	str qv = {0};
38
+	int ret = 0;
39
+
40
+	qvalue_t q = Q_UNSPECIFIED;
41
+	flag_t branch_flags = 0;
42
+
43
+	if (pu!=NULL)
44
+	{
45
+		if(fixup_get_svalue(msg, pu, &uri)!=0)
46
+		{
47
+			LM_ERR("cannot get the URI parameter\n");
48
+			return -1;
49
+		}
50
+	}
51
+
52
+	if (pq!=NULL)
53
+	{
54
+		if(fixup_get_svalue(msg, pq, &qv)!=0)
55
+		{
56
+			LM_ERR("cannot get the Q parameter\n");
57
+			return -1;
58
+		}
59
+		if(qv.len>0 && str2q(&q, qv.s, qv.len)<0)
60
+		{
61
+			LM_ERR("cannot parse the Q parameter\n");
62
+			return -1;
63
+		}
64
+	}
65
+
66
+
67
+	getbflagsval(0, &branch_flags);
68
+	ret = append_branch(msg, (uri.len>0)?&uri:0, &msg->dst_uri,
69
+			&msg->path_vec, q, branch_flags,
70
+			msg->force_send_socket);
71
+
72
+
73
+	if(uri.len<=0)
74
+	{
75
+		/* reset all branch attributes if r-uri was shifted to branch */
76
+		reset_force_socket(msg);
77
+		setbflagsval(0, 0);
78
+		if(msg->dst_uri.s!=0)
79
+			pkg_free(msg->dst_uri.s);
80
+		msg->dst_uri.s = 0;
81
+		msg->dst_uri.len = 0;
82
+		if(msg->path_vec.s!=0)
83
+			pkg_free(msg->path_vec.s);
84
+		msg->path_vec.s = 0;
85
+		msg->path_vec.len = 0;
86
+	}
87
+
88
+	return ret;
89
+}
0 90
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+/**
1
+ * $Id$
2
+ *
3
+ * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+ *
19
+ */
20
+
21
+#ifndef _COREX_LIB_H_
22
+#define _COREX_LIB_H_
23
+
24
+#include "../../mod_fix.h"
25
+
26
+int corex_append_branch(sip_msg_t *msg, gparam_t *pu, gparam_t *pq);
27
+
28
+#endif
0 29
new file mode 100644
... ...
@@ -0,0 +1,115 @@
0
+/**
1
+ * $Id$
2
+ *
3
+ * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+ *
19
+ */
20
+
21
+#include <stdio.h>
22
+#include <unistd.h>
23
+#include <stdlib.h>
24
+#include <string.h>
25
+
26
+#include "../../sr_module.h"
27
+#include "../../dprint.h"
28
+#include "../../ut.h"
29
+
30
+#include "corex_lib.h"
31
+#include "corex_rpc.h"
32
+
33
+MODULE_VERSION
34
+
35
+static int w_append_branch(sip_msg_t *msg, char *su, char *sq);
36
+
37
+static int  mod_init(void);
38
+static int  child_init(int);
39
+static void mod_destroy(void);
40
+
41
+static cmd_export_t cmds[]={
42
+	{"append_branch", (cmd_function)w_append_branch, 0, 0,
43
+			0, REQUEST_ROUTE | FAILURE_ROUTE },
44
+	{"append_branch", (cmd_function)w_append_branch, 1, fixup_spve_null,
45
+			0, REQUEST_ROUTE | FAILURE_ROUTE },
46
+	{"append_branch", (cmd_function)w_append_branch, 2, fixup_spve_spve,
47
+			0, REQUEST_ROUTE | FAILURE_ROUTE },
48
+
49
+
50
+	{0, 0, 0, 0, 0, 0}
51
+};
52
+
53
+static param_export_t params[]={
54
+	{0, 0, 0}
55
+};
56
+
57
+struct module_exports exports = {
58
+	"corex",
59
+	DEFAULT_DLFLAGS, /* dlopen flags */
60
+	cmds,
61
+	params,
62
+	0,
63
+	0,              /* exported MI functions */
64
+	0,              /* exported pseudo-variables */
65
+	0,              /* extra processes */
66
+	mod_init,       /* module initialization function */
67
+	0,              /* response function */
68
+	mod_destroy,    /* destroy function */
69
+	child_init      /* per child init function */
70
+};
71
+
72
+
73
+
74
+/**
75
+ * init module function
76
+ */
77
+static int mod_init(void)
78
+{
79
+	if(corex_init_rpc()<0)
80
+	{
81
+		LM_ERR("failed to register RPC commands\n");
82
+		return -1;
83
+	}
84
+
85
+	return 0;
86
+}
87
+
88
+/**
89
+ * @brief Initialize async module children
90
+ */
91
+static int child_init(int rank)
92
+{
93
+	if (rank!=PROC_MAIN)
94
+		return 0;
95
+
96
+	return 0;
97
+}
98
+/**
99
+ * destroy module function
100
+ */
101
+static void mod_destroy(void)
102
+{
103
+}
104
+
105
+/**
106
+ * config wrapper for append branch
107
+ */
108
+static int w_append_branch(sip_msg_t *msg, char *su, char *sq)
109
+{
110
+	if(corex_append_branch(msg, (gparam_t*)su, (gparam_t*)sq) < 0)
111
+		return -1;
112
+	return 1;
113
+}
114
+
0 115
new file mode 100644
... ...
@@ -0,0 +1,168 @@
0
+/**
1
+ * $Id$
2
+ *
3
+ * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+ *
19
+ */
20
+
21
+#include <stdio.h>
22
+#include <unistd.h>
23
+#include <stdlib.h>
24
+#include <string.h>
25
+
26
+#include "../../dprint.h"
27
+#include "../../ut.h"
28
+#include "../../socket_info.h"
29
+#include "../../name_alias.h"
30
+#include "../../rpc.h"
31
+#include "../../rpc_lookup.h"
32
+
33
+
34
+static const char* corex_rpc_list_sockets_doc[2] = {
35
+	"List listening sockets",
36
+	0
37
+};
38
+
39
+
40
+/*
41
+ * RPC command to list the listening sockets
42
+ */
43
+static void corex_rpc_list_sockets(rpc_t* rpc, void* ctx)
44
+{
45
+	void* th;
46
+	void* ih;
47
+
48
+	struct socket_info *si;
49
+	struct socket_info** list;
50
+	struct addr_info* ai;
51
+	unsigned short proto;
52
+	
53
+	proto=PROTO_UDP;
54
+	do {
55
+		list=get_sock_info_list(proto);
56
+		for(si=list?*list:0; si; si=si->next)
57
+		{
58
+			/* add structure node */
59
+			if (rpc->add(ctx, "{", &th) < 0)
60
+			{
61
+				rpc->fault(ctx, 500, "Internal error socket structure");
62
+				return;
63
+			}
64
+
65
+			if(rpc->struct_add(th, "ss{",
66
+				"PROTO", 	get_valid_proto_name(proto),
67
+				"NAME", 	si->name.s,
68
+				"ADDRLIST",  &ih)<0)
69
+			{
70
+				rpc->fault(ctx, 500, "Internal error address list structure");
71
+				return;
72
+			}
73
+
74
+			if(rpc->struct_add(ih, "s", "ADDR", si->address_str.s)<0)
75
+			{
76
+				rpc->fault(ctx, 500, "Internal error address structure");
77
+				return;
78
+			}
79
+	
80
+			if (si->addr_info_lst)
81
+			{
82
+
83
+				for (ai=si->addr_info_lst; ai; ai=ai->next)
84
+				{
85
+					if(rpc->struct_add(ih, "s", "ADDR", ai->address_str.s)<0)
86
+					{
87
+						rpc->fault(ctx, 500,
88
+								"Internal error extra address structure");
89
+						return;
90
+					}
91
+
92
+				}
93
+			}
94
+
95
+			if(rpc->struct_add(th, "ssss",
96
+					"PORT", si->port_no_str.s,
97
+					"MCAST", si->flags & SI_IS_MCAST ? "yes" : "no",
98
+					"MHOMED", si->flags & SI_IS_MHOMED? "yes" : "no",
99
+					"ADVERTISE", si->useinfo.name.s?si->useinfo.name.s:"-")<0)
100
+			{
101
+				rpc->fault(ctx, 500, "Internal error attrs structure");
102
+				return;
103
+			}
104
+		}
105
+	} while((proto=next_proto(proto)));
106
+
107
+	return;
108
+}
109
+
110
+
111
+static const char* corex_rpc_list_aliases_doc[2] = {
112
+	"List socket aliases",
113
+	0
114
+};
115
+
116
+
117
+/*
118
+ * RPC command to list the socket aliases
119
+ */
120
+static void corex_rpc_list_aliases(rpc_t* rpc, void* ctx)
121
+{
122
+	void* th;
123
+
124
+	struct host_alias* a;
125
+
126
+	for(a=aliases; a; a=a->next) 
127
+	{
128
+		/* add structure node */
129
+		if (rpc->add(ctx, "{", &th) < 0)
130
+		{
131
+			rpc->fault(ctx, 500, "Internal error alias structure");
132
+			return;
133
+		}
134
+		if(rpc->struct_add(th, "sSd",
135
+				"PROTO", get_valid_proto_name(a->proto),
136
+				"ADDR",  &a->alias,
137
+				"PORT",  a->port)<0)
138
+		{
139
+			rpc->fault(ctx, 500, "Internal error alias attributes");
140
+			return;
141
+		}
142
+	}
143
+
144
+	return;
145
+}
146
+
147
+
148
+rpc_export_t corex_rpc_cmds[] = {
149
+	{"corex.list_sockets", corex_rpc_list_sockets,
150
+		corex_rpc_list_sockets_doc, 0},
151
+	{"corex.list_aliases", corex_rpc_list_aliases,
152
+		corex_rpc_list_aliases_doc, 0},
153
+	{0, 0, 0, 0}
154
+};
155
+
156
+/**
157
+ * register RPC commands
158
+ */
159
+int corex_init_rpc(void)
160
+{
161
+	if (rpc_register_array(corex_rpc_cmds)!=0)
162
+	{
163
+		LM_ERR("failed to register RPC commands\n");
164
+		return -1;
165
+	}
166
+	return 0;
167
+}
0 168
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+/**
1
+ * $Id$
2
+ *
3
+ * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+ *
19
+ */
20
+
21
+#ifndef _COREX_RPC_H_
22
+#define _COREX_RPC_H_
23
+
24
+int corex_init_rpc(void);
25
+
26
+#endif
0 27
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+docs = corex.xml
1
+
2
+docbook_dir = ../../../docbook
3
+include $(docbook_dir)/Makefile.module
0 4
new file mode 100644
... ...
@@ -0,0 +1,37 @@
0
+<?xml version="1.0" encoding='ISO-8859-1'?>
1
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
2
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3
+
4
+<!-- Include general documentation entities -->
5
+<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
6
+%docentities;
7
+
8
+]>
9
+
10
+<book xmlns:xi="http://www.w3.org/2001/XInclude">
11
+    <bookinfo>
12
+	<title>COREX Module</title>
13
+	<productname class="trade">kamailio.org</productname>
14
+	<authorgroup>
15
+	    <author>
16
+		<firstname>Daniel-Constantin</firstname>
17
+		<surname>Mierla</surname>
18
+		<email>miconda@gmail.com</email>
19
+	    </author>
20
+	    <editor>
21
+		<firstname>Daniel-Constantin</firstname>
22
+		<surname>Mierla</surname>
23
+		<email>miconda@gmail.com</email>
24
+	    </editor>
25
+	</authorgroup>
26
+	<copyright>
27
+	    <year>2012</year>
28
+	    <holder>asipto.com</holder>
29
+	</copyright>
30
+    </bookinfo>
31
+    <toc></toc>
32
+    
33
+    <xi:include href="corex_admin.xml"/>
34
+    
35
+    
36
+</book>
0 37
new file mode 100644
... ...
@@ -0,0 +1,142 @@
0
+<?xml version="1.0" encoding='ISO-8859-1'?>
1
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
2
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3
+
4
+<!-- Include general documentation entities -->
5
+<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
6
+%docentities;
7
+
8
+]>
9
+<!-- Module User's Guide -->
10
+
11
+<chapter>
12
+	
13
+	<title>&adminguide;</title>
14
+	
15
+	<section>
16
+	<title>Overview</title>
17
+	<para>
18
+		This module provides reimplementation of very old functions that
19
+		were in core and supported only static string or integer parameters.
20
+		The new versions bring support for dynamic parameters (allowing
21
+		variables inside the parameters).
22
+	</para>
23
+	<para>
24
+		There are also brand new features, related to core internals, but
25
+		controlled from configuration file or via control interfaces.
26
+	</para>
27
+	<para>
28
+		Contributions to this module must be done under BSD license, to
29
+		follow the requirements of the core contributions.
30
+	</para>
31
+	</section>
32
+
33
+	<section>
34
+	<title>Dependencies</title>
35
+	<section>
36
+		<title>&kamailio; Modules</title>
37
+		<para>
38
+		The following modules must be loaded before this module:
39
+			<itemizedlist>
40
+			<listitem>
41
+			<para>
42
+				<emphasis>None</emphasis>.
43
+			</para>
44
+			</listitem>
45
+			</itemizedlist>
46
+		</para>
47
+	</section>
48
+	<section>
49
+		<title>External Libraries or Applications</title>
50
+		<para>
51
+		The following libraries or applications must be installed before running
52
+		&kamailio; with this module loaded:
53
+			<itemizedlist>
54
+			<listitem>
55
+			<para>
56
+				<emphasis>None</emphasis>
57
+			</para>
58
+			</listitem>
59
+			</itemizedlist>
60
+		</para>
61
+	</section>
62
+	</section>
63
+	<section>
64
+	<title>Functions</title>
65
+	<section>
66
+	    <title>
67
+		<function moreinfo="none">append_branch([ uri, [ q ] ])</function>
68
+	    </title>
69
+	    <para>
70
+			Append a new branch to the destination set, useful to build the
71
+			addresses for parallel forking or redirect replies.
72
+		</para>
73
+		<para>
74
+			Both parameters are optional, If no uri parameter is provided,
75
+			then the address from request URI (r-uri) is taken to build the
76
+			new branch.
77
+		</para>
78
+		<para>Meaning of the parameters is as follows:</para>
79
+		<itemizedlist>
80
+		<listitem>
81
+			<para>
82
+				<emphasis>uri</emphasis> - SIP address of the branch to be
83
+				used as R-URI in the outgoing request.
84
+			</para>
85
+		</listitem>
86
+		<listitem>
87
+			<para>
88
+				<emphasis>q</emphasis> - the Q value to set the priority
89
+				of the branch based on Contact address specifications
90
+			</para>
91
+		</listitem>
92
+		</itemizedlist>
93
+		<para>
94
+		This function can be used from REQUEST_ROUTE or FAILURE_ROUTE.
95
+		</para>
96
+		<example>
97
+		<title><function>append_branch</function> usage</title>
98
+		<programlisting format="linespecific">
99
+...
100
+    append_branch();
101
+    append_branch("$avp(uri)", "0.5");
102
+...
103
+</programlisting>
104
+	    </example>
105
+	</section>
106
+	</section>
107
+
108
+	<section>
109
+	<title>RPC Commands</title>
110
+	<section>
111
+		<title>
112
+		<function moreinfo="none">corex.list_sockets</function>
113
+		</title>
114
+		<para>
115
+			Print the list of sockets the application is listening on.
116
+		</para>
117
+		<para>
118
+		Example:
119
+		</para>
120
+        <programlisting  format="linespecific">
121
+		sercmd corex.list_sockets
122
+		</programlisting>
123
+    </section>
124
+	<section>
125
+		<title>
126
+		<function moreinfo="none">corex.list_aliases</function>
127
+		</title>
128
+		<para>
129
+			Print the list of hostname aliases used to match myself
130
+			condition.
131
+		</para>
132
+		<para>
133
+		Example:
134
+		</para>
135
+        <programlisting  format="linespecific">
136
+		sercmd corex.list_aliases
137
+		</programlisting>
138
+    </section>
139
+    </section>
140
+</chapter>
141
+