Module: sip-router
Branch: master
Commit: 501df6bd29bb1c22c53de8bd772eb4c641ad0d6f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=501df6b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 13 23:18:02 2011 +0100
sdpops: documented sdp_print(...) and sdp_with_media(...)
---
modules/sdpops/README | 40 +++++++++++++++++++++++++++
modules/sdpops/doc/sdpops_admin.xml | 52 ++++++++++++++++++++++++++++++++++-
2 files changed, 91 insertions(+), 1 deletions(-)
diff --git a/modules/sdpops/README b/modules/sdpops/README
index 50630f7..10d72ce 100644
--- a/modules/sdpops/README
+++ b/modules/sdpops/README
@@ -27,10 +27,14 @@ Daniel-Constantin Mierla
4. Exported Functions
4.1. sdp_remove_codecs_by_id(list)
+ 4.2. sdp_with_media(type)
+ 4.3. sdp_print(level)
List of Examples
1.1. sdp_remove_codecs_by_id usage
+ 1.2. sdp_with_media usage
+ 1.3. sdp_print usage
Chapter 1. Admin Guide
@@ -46,6 +50,8 @@ Chapter 1. Admin Guide
4. Exported Functions
4.1. sdp_remove_codecs_by_id(list)
+ 4.2. sdp_with_media(type)
+ 4.3. sdp_print(level)
1. Overview
@@ -80,6 +86,8 @@ Chapter 1. Admin Guide
4. Exported Functions
4.1. sdp_remove_codecs_by_id(list)
+ 4.2. sdp_with_media(type)
+ 4.3. sdp_print(level)
4.1. sdp_remove_codecs_by_id(list)
@@ -88,6 +96,8 @@ Chapter 1. Admin Guide
comma separated list of numeric codec IDs. The parameter can be a
static string or a variable holding the list of numeric codec IDs.
+ This function can be used from ANY_ROUTE.
+
Example 1.1. sdp_remove_codecs_by_id usage
...
# remove PCMU
@@ -95,3 +105,33 @@ sdp_remove_codecs_by_id("0");
# remove PCMU, PCMA and GSM
sdp_remove_codecs_by_id("0,8,3");
...
+
+4.2. sdp_with_media(type)
+
+ Return true of the SDP has 'media=type ...' line. Useful to check the
+ content of the RTP sessions, such as 'audio' or 'video'. The parameter
+ can be static string or variable holding the media type.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.2. sdp_with_media usage
+...
+# check for video stream
+if(sdp_with_media("video"))
+{
+ # the session has a video stream
+}
+...
+
+4.3. sdp_print(level)
+
+ Print the SDP internal structure to log 'level'. The parameter can be
+ static integer or variable holding the integer value of the log level.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.3. sdp_print usage
+...
+# print the SDP
+sdp_print("1");
+...
diff --git a/modules/sdpops/doc/sdpops_admin.xml b/modules/sdpops/doc/sdpops_admin.xml
index 4981c07..bbb4738 100644
--- a/modules/sdpops/doc/sdpops_admin.xml
+++ b/modules/sdpops/doc/sdpops_admin.xml
@@ -67,7 +67,7 @@
<section>
<title>Exported Functions</title>
- <section>
+ <section>
<title>
<function moreinfo="none">sdp_remove_codecs_by_id(list)</function>
</title>
@@ -78,6 +78,9 @@
parameter can be a static string or a variable holding the
list of numeric codec IDs.
</para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
<example>
<title><function>sdp_remove_codecs_by_id</function> usage</title>
<programlisting format="linespecific">
@@ -90,6 +93,53 @@ sdp_remove_codecs_by_id("0,8,3");
</programlisting>
</example>
</section>
+ <section>
+ <title>
+ <function moreinfo="none">sdp_with_media(type)</function>
+ </title>
+ <para>
+ Return true of the SDP has 'media=type ...' line. Useful to check
+ the content of the RTP sessions, such as 'audio' or 'video'. The
+ parameter can be static string or variable holding the media type.
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>sdp_with_media</function> usage</title>
+ <programlisting format="linespecific">
+...
+# check for video stream
+if(sdp_with_media("video"))
+{
+ # the session has a video stream
+}
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title>
+ <function moreinfo="none">sdp_print(level)</function>
+ </title>
+ <para>
+ Print the SDP internal structure to log 'level'. The
+ parameter can be static integer or variable holding the integer
+ value of the log level.
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>sdp_print</function> usage</title>
+ <programlisting format="linespecific">
+...
+# print the SDP
+sdp_print("1");
+...
+</programlisting>
+ </example>
+ </section>
</section>
</chapter>
Module: sip-router
Branch: master
Commit: a4daa0d11e758dc7e72673a2e670338d19591ee8
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a4daa0d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 13 22:19:12 2011 +0100
sqlops: adding missing ending tags to docbook
- replaced list of routing blocks with ANY_ROUTE
---
modules_k/sqlops/README | 71 +++++++++++++++++++++++++++------
modules_k/sqlops/doc/sqlops_admin.xml | 17 ++++----
2 files changed, 67 insertions(+), 21 deletions(-)
diff --git a/modules_k/sqlops/README b/modules_k/sqlops/README
index 902f709..5656715 100644
--- a/modules_k/sqlops/README
+++ b/modules_k/sqlops/README
@@ -32,7 +32,8 @@ Daniel-Constantin Mierla
4. Exported Functions
4.1. sql_query(connection, query, result)
- 4.2. sql_result_free(result)
+ 4.2. sql_xquery(connection, query, result)
+ 4.3. sql_result_free(result)
5. Exported pseudo-variables
@@ -43,8 +44,9 @@ Daniel-Constantin Mierla
1.1. Set sqlcon parameter
1.2. Set sqlres parameter
1.3. sql_query() usage
- 1.4. sql_result_free() usage
- 1.5. $dbr(result=>key) usage
+ 1.4. sql_xquery() usage
+ 1.5. sql_result_free() usage
+ 1.6. $dbr(result=>key) usage
Chapter 1. Admin Guide
@@ -64,7 +66,8 @@ Chapter 1. Admin Guide
4. Exported Functions
4.1. sql_query(connection, query, result)
- 4.2. sql_result_free(result)
+ 4.2. sql_xquery(connection, query, result)
+ 4.3. sql_result_free(result)
5. Exported pseudo-variables
@@ -91,6 +94,10 @@ Chapter 1. Admin Guide
[row,column].
* persistence in process space - a result can be used many times in
the same worker process. Query once, use many times.
+ * alternatively, results can be stored in xavps - columns are
+ accessed by their names, rows by xavp index. Xavp's are available
+ during the transactions lifetime and don't need to be destroyed
+ manually.
2. Dependencies
@@ -153,7 +160,8 @@ modparam("sqlops", "sqlres", "ra")
4. Exported Functions
4.1. sql_query(connection, query, result)
- 4.2. sql_result_free(result)
+ 4.2. sql_xquery(connection, query, result)
+ 4.3. sql_result_free(result)
4.1. sql_query(connection, query, result)
@@ -164,8 +172,7 @@ modparam("sqlops", "sqlres", "ra")
* result - string name to identify the result. Will be used by
$dbr(...) pseudo-variable to access result attributes.
- This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
- ONREPLY_ROUTE, BRANCH_ROUTE.
+ This function can be used from ANY_ROUTE.
Example 1.3. sql_query() usage
...
@@ -176,14 +183,32 @@ xlog("number of rows in table domain: $dbr(ra=>rows)\n");
sql_result_free("ra");
...
-4.2. sql_result_free(result)
+4.2. sql_xquery(connection, query, result)
+
+ Make a SQL query using 'connection' and store data in 'result' xavp.
+ * connection - the name of the connection to be used for query
+ (defined via the “sqlcon” parameter).
+ * query - SQL query string or pseudo-variables containing SQL query.
+ * result - string name to identify the result xavp. Each row will be
+ added to this xavp, each column can be accessed by its name.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.4. sql_xquery() usage
+...
+modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
+...
+sql_xquery("ca", "select * from domain", "ra");
+ xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
+...
+
+4.3. sql_result_free(result)
Free data in SQL 'result'.
- This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
- ONREPLY_ROUTE, BRANCH_ROUTE.
+ This function can be used from ANY_ROUTE.
- Example 1.4. sql_result_free() usage
+ Example 1.5. sql_result_free() usage
...
modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
...
@@ -212,7 +237,7 @@ sql_result_free("ra");
integer.
* colname[N] - return the name of the N-th column in the result set.
- Example 1.5. $dbr(result=>key) usage
+ Example 1.6. $dbr(result=>key) usage
...
modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
...
@@ -240,3 +265,25 @@ if($dbr(ra=>rows)>0)
}
sql_result_free("ra");
...
+
+
+...
+if (sql_xquery("ca", "select * from domain", "ra") == 1)
+{
+# non-destructive iteration
+ $var(i) = 0;
+ while($xavp(ra[$var(i)]) != $null)
+ {
+ xlog("[id, domain] = [$xavp(ra[$var(i)]=>id), $xavp(ra[$var(i)]=>domain)
+]\n");
+ $var(i) = $var(i) + 1;
+ }
+
+# destructive iteration
+ while($xavp(ra) != $null)
+ {
+ xlog("[id, domain] = [$xavp(ra=>id), $xavp(ra=>domain)]\n");
+ pv_unset("$xavp(ra)");
+ }
+}
+...
diff --git a/modules_k/sqlops/doc/sqlops_admin.xml b/modules_k/sqlops/doc/sqlops_admin.xml
index 57ac3ab..d042c61 100644
--- a/modules_k/sqlops/doc/sqlops_admin.xml
+++ b/modules_k/sqlops/doc/sqlops_admin.xml
@@ -62,9 +62,10 @@
</listitem>
<listitem>
<para>
- <emphasis>alternatively, results can be stored in xavps. Columns are
- accessed by their names, rows by xavp index. Xavp's are available
- during the transactions lifetime and don't need to be destroyed manually.
+ <emphasis>alternatively, results can be stored in xavps</emphasis>
+ - columns are accessed by their names, rows by xavp index. Xavp's
+ are available during the transactions lifetime and don't need to
+ be destroyed manually.
</para>
</listitem>
@@ -204,8 +205,7 @@ modparam("sqlops", "sqlres", "ra")
</listitem>
</itemizedlist>
<para>
- This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
- ONREPLY_ROUTE, BRANCH_ROUTE.
+ This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>sql_query()</function> usage</title>
@@ -220,6 +220,7 @@ sql_result_free("ra");
</programlisting>
</example>
</section>
+ <section>
<title>
<function moreinfo="none">sql_xquery(connection, query, result)</function>
</title>
@@ -247,8 +248,7 @@ sql_result_free("ra");
</listitem>
</itemizedlist>
<para>
- This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
- ONREPLY_ROUTE, BRANCH_ROUTE.
+ This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>sql_xquery()</function> usage</title>
@@ -270,8 +270,7 @@ sql_xquery("ca", "select * from domain", "ra");
Free data in SQL 'result'.
</para>
<para>
- This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
- ONREPLY_ROUTE, BRANCH_ROUTE.
+ This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>sql_result_free()</function> usage</title>
Hello,
At Daniel's suggestion, I am planning to work on a distributed message queue
system for Kamailio for my BCS thesis.
The idea is having a way of communicating between different Kamailio instances
for user presence states, user location information, etc.
The plan is to use SIP for transport, and to have efficient ways of
adding/deleting a node from the message queue bus.
Any suggestions/opinions are very welcomed.
Cheers,
Marius
Module: sip-router
Branch: 3.1
Commit: fb04c55464adb63325ca1772f868e6b80c5c95ca
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb04c55…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Jan 3 12:41:20 2011 +0100
doc: add small note about SCTP compile time deps to INSTALL file, reported from Juha
(cherry picked from commit d4d6d3c0270a5892fae87650adc7600a40e25c0e)
---
INSTALL | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/INSTALL b/INSTALL
index 85b568f..e631567 100644
--- a/INSTALL
+++ b/INSTALL
@@ -126,6 +126,7 @@ Requirements:
module
- libpcre libs and devel headers - if you want to compile the lcr and dialplan
modules
+- libsctp devel headers - if you want to compile the SCTP transport in the core
OS Notes: