Hi,
I have to modify kamailio to add QoS to presence module. I have to fork a
new process that is allowed to access presentity table into database but
with the classik fork() function i cannot access to it. Have I to do
something in particular?
Thanks!
--
Stefano Poli
Hi, I want to create a transaction prior to performing some DB queries
or any other type of communication with external processes. I want to
create the transaction manually (t_newtrans) before invoking t_relay,
so if something blocks the request processing for a while, a
retransmission would not trigger all the DB queries again.
The problem is that changes to the transaction done after invoking
t_newtrans() are not saved within the transaction (this is: adding
headers, setting flags, AVP's....) which makes t_newtrans() function
really ugly and anti-user-friendly.
So my question is: couldn't t_relay() update transaction information
in case there are changes after calling t_newtrans()?
Thanks.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>
Module: sip-router
Branch: master
Commit: c676d5303fe928c21ec17ed2ecb6353eaf4f1b5a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c676d53…
Author: Alex Balashov <abalashov(a)evaristesys.com>
Committer: Alex Balashov <abalashov(a)evaristesys.com>
Date: Sun Oct 3 22:08:53 2010 -0400
Updated generated README with doc changes for is_known_dlg() as well.
---
modules_k/dialog/README | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/modules_k/dialog/README b/modules_k/dialog/README
index 348b694..0cb0730 100644
--- a/modules_k/dialog/README
+++ b/modules_k/dialog/README
@@ -1113,11 +1113,16 @@ if(dlg_get("abcdef", "123", "456"))
6.13. is_known_dlg()
- This function checks if the dialog module is aware of this dialog,
- regardless of whether it is in any profiles. The dialog module tracks
- all dialogs irrespectively of profile usage; as such, this function
- will return affirmatively if the request corresponds to a dialog that
- is currently active.
+ This function checks if the current SIP message being processed belongs
+ to any transaction within an active dialog that the dialog module is
+ currently tracking. This is a check for tracking of any kind, without
+ regard to profiles.
+
+ This function has numerous potential applications, among which is that
+ it can be used to strengthen security for loose-routing sequential
+ (in-dialog) requests or responses to them, as by providing a
+ preventative check against spoofing on the proxy level instead of
+ leaving the issue purely to the receiving UA.
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
Module: sip-router
Branch: master
Commit: 8c0bdbd5f70d9a6f61b206ecc918404c880fdf24
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8c0bdbd…
Author: Alex Balashov - Diminuendo-2 <evariste-admins(a)evaristesys.com>
Committer: Alex Balashov - Diminuendo-2 <evariste-admins(a)evaristesys.com>
Date: Sun Oct 3 20:52:35 2010 -0400
Improved documentation for is_known_dlg() function and added some
clarifications, and also tested my commit rights.
---
modules_k/dialog/doc/dialog_admin.xml | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules_k/dialog/doc/dialog_admin.xml b/modules_k/dialog/doc/dialog_admin.xml
index ec80223..d6ecfe2 100644
--- a/modules_k/dialog/doc/dialog_admin.xml
+++ b/modules_k/dialog/doc/dialog_admin.xml
@@ -1394,11 +1394,18 @@ if(dlg_get("abcdef", "123", "456"))
<function moreinfo="none">is_known_dlg()</function>
</title>
<para>
- This function checks if the dialog module is aware of this
- dialog, regardless of whether it is in any profiles. The
- dialog module tracks all dialogs irrespectively of profile usage;
- as such, this function will return affirmatively if the request
- corresponds to a dialog that is currently active.
+ This function checks if the current SIP message being processed
+ belongs to any transaction within an active dialog that the
+ dialog module is currently tracking. This is a check for
+ tracking of any kind, without regard to profiles.
+ </para>
+ <para>
+ This function has numerous potential applications, among which
+ is that it can be used to strengthen security for
+ loose-routing sequential (in-dialog) requests or responses
+ to them, as by providing a preventative check against
+ spoofing on the proxy level instead of leaving the issue
+ purely to the receiving UA.
</para>
<para>
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
Module: sip-router
Branch: master
Commit: 7370685a2eb6d27d6775c8cffa59f6f17cdb76b5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7370685…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Oct 3 21:51:35 2010 +0200
db_postgres: null-terminate blob buffers
- reapply part of patch done for FS#77: fix BLOBs with postgres
- fix BLOBs with postgres, also add a null-termination as the other
SQL databases in order to be able to work with the presence modules
- change: do not increment the lenght of blob
- initial fix by Henning Westerholt, commit
2e56720769913c55cacc83fe3a31f44f072e7590
---
modules/db_postgres/km_val.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/modules/db_postgres/km_val.c b/modules/db_postgres/km_val.c
index cb3fe9f..b2e97c0 100644
--- a/modules/db_postgres/km_val.c
+++ b/modules/db_postgres/km_val.c
@@ -55,9 +55,11 @@
* \param _l string length
* \return 0 on success, negative on error
*/
-int db_postgres_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l)
+int db_postgres_str2val(const db_type_t _t, db_val_t* _v, const char* _s,
+ const int _l)
{
- /* use common function for non BLOB, NULL setting and input parameter checking */
+ /* use common function for non BLOB, NULL setting and input
+ * parameter checking */
if ( _t != DB1_BLOB || _s == NULL || _v == NULL) {
return db_str2val(_t, _v, _s, _l, 1);
} else {
@@ -67,21 +69,24 @@ int db_postgres_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const
* The string is stored in new allocated memory, which we could
* not free later thus we need to copy it to some new memory here.
*/
- tmp_s = (char*)PQunescapeBytea((unsigned char*)_s, (size_t*)(void*)&(VAL_BLOB(_v).len));
+ tmp_s = (char*)PQunescapeBytea((unsigned char*)_s,
+ (size_t*)(void*)&(VAL_BLOB(_v).len));
if(tmp_s==NULL) {
LM_ERR("PQunescapeBytea failed\n");
return -7;
}
- VAL_BLOB(_v).s = pkg_malloc(VAL_BLOB(_v).len);
+ VAL_BLOB(_v).s = pkg_malloc(VAL_BLOB(_v).len + 1);
if (VAL_BLOB(_v).s == NULL) {
LM_ERR("no private memory left\n");
PQfreemem(tmp_s);
return -8;
}
- LM_DBG("allocate %d bytes memory for BLOB at %p", VAL_BLOB(_v).len, VAL_BLOB(_v).s);
+ LM_DBG("allocate %d+1 bytes memory for BLOB at %p",
+ VAL_BLOB(_v).len, VAL_BLOB(_v).s);
memcpy(VAL_BLOB(_v).s, tmp_s, VAL_BLOB(_v).len);
PQfreemem(tmp_s);
+ VAL_BLOB(_v).s[VAL_BLOB(_v).len] = '\0';
VAL_TYPE(_v) = DB1_BLOB;
VAL_FREE(_v) = 1;