Module: sip-router
Branch: master
Commit: a9b939d7881696aab9d5c39099491e65b4902cee
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9b939d…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Fri Jan 8 18:26:11 2010 +0100
lib/srdb1 (k): add generic helper method for bulk data loading, e.g. for route infos
- add a generic helper method for bulk data loading, e.g. for routing informations
from cr, lcr, htable or other similar tasks
- TODO: adapt cr (patch ready, testing needed), adapt more modules
---
lib/srdb1/db.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
lib/srdb1/db.h | 16 ++++++++++++++++
2 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/lib/srdb1/db.c b/lib/srdb1/db.c
index c4bf7cf..6f85b22 100644
--- a/lib/srdb1/db.c
+++ b/lib/srdb1/db.c
@@ -425,3 +425,55 @@ int db_use_table(db1_con_t* _h, const str* _t)
CON_TABLE(_h) = _t;
return 0;
}
+
+
+/*! \brief Generic query helper for load bulk data
+ *
+ * Generic query helper method for load bulk data, e.g. lcr tables
+ * \param binding database module binding
+ * \param handle database connection
+ * \param name database table name
+ * \param cols queried columns
+ * \param count number of queried columns
+ * \param strict if set to 1 an error is returned when no data could be loaded,
+ otherwise just a warning is logged
+ * \param res database result, unchanged on failure and if no data could be found
+ * \return 0 if the query was run successful, -1 otherwise
+ */
+int db_load_bulk_data(db_func_t* binding, db1_con_t* handle, str* name, db_key_t* cols,
+ unsigned int count, unsigned int strict, db1_res_t* res)
+{
+ if (binding == NULL) {
+ LM_ERR("invalid database module binding\n");
+ return -1;
+ }
+
+ if(handle == NULL) {
+ LM_ERR("invalid database handle\n");
+ return -1;
+ }
+
+ if (binding->use_table(handle, name) < 0) {
+ LM_ERR("error in use_table for database\n");
+ return -1;
+ }
+
+ /* select the whole table and all the columns */
+ if(binding->query(handle, 0, 0, 0, cols, 0, count, 0, &res) < 0) {
+ LM_ERR("error while querying database\n");
+ return -1;
+ }
+
+ if(RES_ROW_N(res) == 0) {
+ binding->free_result(handle, res);
+ if (strict == 1) {
+ LM_ERR("no data in the database table %.*s\n", name->len, name->s);
+ return -1;
+ } else {
+ LM_WARN("no data in the database table %.*s, use an empty set\n", name->len, name->s);
+ return 0;
+ }
+ }
+
+ return 0;
+}
diff --git a/lib/srdb1/db.h b/lib/srdb1/db.h
index 0429e2c..7da401b 100644
--- a/lib/srdb1/db.h
+++ b/lib/srdb1/db.h
@@ -398,5 +398,21 @@ int db_use_table(db1_con_t* _h, const str* _t);
typedef int (*db_bind_api_f)(db_func_t *dbb);
+/**
+ * \brief Generic query helper for load bulk data
+ *
+ * Generic query helper method for load bulk data, e.g. lcr tables
+ * \param binding database module binding
+ * \param handle database connection
+ * \param name database table name
+ * \param cols queried columns
+ * \param count number of queried columns
+ * \param strict if set to 1 an error is returned when no data could be loaded,
+ otherwise just a warning is logged
+ * \param res database result, unchanged on failure and if no data could be found
+ * \return 0 if the query was run successful, -1 otherwise
+ */
+int db_load_bulk_data(db_func_t* binding, db1_con_t* handle, str* name, db_key_t* cols,
+ unsigned int count, unsigned int strict, db1_res_t* res);
#endif /* DB1_H */
Friends,
I know that the number of security reports for SER and Kamailio are very low, in fact so low that I can't remember any. However, it can still happen to us in the future. Do we have any policies and procedure for how to handle it?
Yes, this is being negative, but also realistic. It's not only about our own code, we depend on a large number of external libraries that could release security reports that will affect our user base too, and propably should be forwarded.
Any thoughts?
/O
Module: sip-router
Branch: sr_3.0
Commit: e69239060196f60def7807fba1f18ff9cc789f8a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e692390…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Thu Jan 7 18:38:52 2010 +0100
kex: documented missing functions
- reported by Santiago Gimeno
(cherry picked from commit e97f68ebe9d909f56577b3abdc305395df9db5ba)
---
modules_k/kex/README | 77 ++++++++++++++++++++++++++++++
modules_k/kex/doc/kex_admin.xml | 100 +++++++++++++++++++++++++++++++++++++++
2 files changed, 177 insertions(+), 0 deletions(-)
diff --git a/modules_k/kex/README b/modules_k/kex/README
index b5e1986..99ab563 100644
--- a/modules_k/kex/README
+++ b/modules_k/kex/README
@@ -33,6 +33,10 @@ Daniel-Constantin Mierla
3.5. isbflagset(flag [, branch])
3.6. resetsflag(flag [, branch])
3.7. km_append_branch([uri])
+ 3.8. setdsturi(uri)
+ 3.9. resetdsturi()
+ 3.10. isdsturiset()
+ 3.11. pv_printf(var, str)
4. Exported MI Functions
@@ -52,6 +56,10 @@ Daniel-Constantin Mierla
1.5. setbflag usage
1.6. resetsflag usage
1.7. km_append_branch usage
+ 1.8. >setdsturi usage
+ 1.9. >resetdsturi usage
+ 1.10. >isdsturiset usage
+ 1.11. >pv_printf usage
Chapter 1. Admin Guide
@@ -72,6 +80,10 @@ Chapter 1. Admin Guide
3.5. isbflagset(flag [, branch])
3.6. resetsflag(flag [, branch])
3.7. km_append_branch([uri])
+ 3.8. setdsturi(uri)
+ 3.9. resetdsturi()
+ 3.10. isdsturiset()
+ 3.11. pv_printf(var, str)
4. Exported MI Functions
@@ -113,6 +125,10 @@ Chapter 1. Admin Guide
3.5. isbflagset(flag [, branch])
3.6. resetsflag(flag [, branch])
3.7. km_append_branch([uri])
+ 3.8. setdsturi(uri)
+ 3.9. resetdsturi()
+ 3.10. isdsturiset()
+ 3.11. pv_printf(var, str)
3.1. setsflag(flag)
@@ -243,6 +259,67 @@ km_append_branch();
km_append_branch("sip:alice@sip-router.org");
...
+3.8. setdsturi(uri)
+
+ Set the destination address URI (outbound proxy address).
+
+ Meaning of the parameters is as follows:
+ * uri - Valid SIP URI representing the address where to send the
+ request. It must be a static string, no variables are evaluated at
+ runtime. If you need to set outbound proxy address via a variable,
+ use assginment to $du.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.8. >setdsturi usage
+...
+setdsturi("sip:10.0.0.10");
+...
+
+3.9. resetdsturi()
+
+ Reset the destination address URI (outbound proxy address).
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.9. >resetdsturi usage
+...
+resetdsturi();
+...
+
+3.10. isdsturiset()
+
+ Check if the destination address URI (outbound proxy address) is set.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.10. >isdsturiset usage
+...
+if(isdsturiset())
+{
+ ...
+}
+...
+
+3.11. pv_printf(var, str)
+
+ Evalues the str and sets the resulted value to variable var. For
+ backward compatibility reasons, same function can be executed via
+ 'avp_printf(var, str)'.
+
+ Meaning of the parameters is as follows:
+ * var - name of a writable variable
+ * str - string that may contain variables which will be evaluated at
+ runtime.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.11. >pv_printf usage
+...
+pv_printf("$ru", "sip:$rU@$fd");
+pv_printf("$avp(x)", "From: $fU - To: $tU");
+...
+
4. Exported MI Functions
4.1. arg
diff --git a/modules_k/kex/doc/kex_admin.xml b/modules_k/kex/doc/kex_admin.xml
index 7fff6a3..2a82593 100644
--- a/modules_k/kex/doc/kex_admin.xml
+++ b/modules_k/kex/doc/kex_admin.xml
@@ -277,6 +277,106 @@ km_append_branch("sip:alice@sip-router.org");
</programlisting>
</example>
</section>
+ <section>
+ <title><function moreinfo="none">setdsturi(uri)</function></title>
+ <para>
+ Set the destination address URI (outbound proxy address).
+ </para>
+ <para>Meaning of the parameters is as follows:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>uri</emphasis> - Valid SIP URI representing the
+ address where to send the request. It must be a static string,
+ no variables are evaluated at runtime. If you need to set
+ outbound proxy address via a variable, use assginment to $du.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>>setdsturi</function> usage</title>
+ <programlisting format="linespecific">
+...
+setdsturi("sip:10.0.0.10");
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title><function moreinfo="none">resetdsturi()</function></title>
+ <para>
+ Reset the destination address URI (outbound proxy address).
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>>resetdsturi</function> usage</title>
+ <programlisting format="linespecific">
+...
+resetdsturi();
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title><function moreinfo="none">isdsturiset()</function></title>
+ <para>
+ Check if the destination address URI (outbound proxy address)
+ is set.
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>>isdsturiset</function> usage</title>
+ <programlisting format="linespecific">
+...
+if(isdsturiset())
+{
+ ...
+}
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title><function moreinfo="none">pv_printf(var, str)</function></title>
+ <para>
+ Evalues the str and sets the resulted value to variable var. For
+ backward compatibility reasons, same function can be executed via
+ 'avp_printf(var, str)'.
+ </para>
+ <para>Meaning of the parameters is as follows:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>var</emphasis> - name of a writable variable
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>str</emphasis> - string that may contain variables
+ which will be evaluated at runtime.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>>pv_printf</function> usage</title>
+ <programlisting format="linespecific">
+...
+pv_printf("$ru", "sip:$rU@$fd");
+pv_printf("$avp(x)", "From: $fU - To: $tU");
+...
+</programlisting>
+ </example>
+ </section>
</section>
<section>
Module: sip-router
Branch: sr_3.0
Commit: e5f0ed558e642b69cfbac40a925a4d2f02153242
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e5f0ed5…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Jan 7 18:56:32 2010 +0100
Merge branch 'sr_3.0' of ssh://henning@git.sip-router.org/sip-router into backport-tmp
* 'sr_3.0' of ssh://henning@git.sip-router.org/sip-router:
- fix bug in encode_contact()
- fix bug when RURI was changed before and newuri will be used
- remove unused code
---