Hi,
I'm trying to pass a variable back to the Kamailio script from the Kamailio
module. Let's say that my module is called "random" and it exports the
function:
static int do_this(struct sip_msg *msg, char* _information);
- I pass some "_param1" and "_param2" parameters to this function from
Kamailio script:
(Kamailio script code)
loadmodule "random.so"
modparam("random", "_param1", "www.host.com")
modparam("random", "_param2", 8877)
- "_information" is the content I get back from the function.
Reading _param1 and _param2 from the function of the module is
pretty straight forward. In order to write the "_information" variable
and being able to read from Kamailio script :
(Module code)
// this is inside do_this() function
// "content" has the value of the information that I would like to pass back
from the function.
pv_spec_t* dst;
pv_value_t val;
val.rs.s = content;
val.rs.len = strlen(content);
val.flags = PV_VAL_STR;
dst = (pv_spec_t *) _information;
dst->setf(msg, &dst->pvp, (int)EQ_T, &val);
>From Kamailio script I can do:
(Kamailio script code)
xlog("L_INFO","Calling do_this()\n");
$var(result) = do_this("$var(response)");
xlog("L_INFO","Returning do_this(). result=$var(result).
uri=$var(response)\n");
And works fine.
Now, I was wondering If I can have the _information parameter as this :
(Kamailio script code)
loadmodule "random.so"
modparam("random", "_param1", "www.host.com")
modparam("random", "_param2", 8877)
modparam("random", "_information", $(response))
Changing the interface of the function as:
static int do_this(struct sip_msg *msg);
Calling from the kamailio script as this:
(Kamailio script code)
xlog("L_INFO","Calling do_this()\n");
$var(result) = do_this();
xlog("L_INFO","Returning do_this(). result=$var(result).
uri=$var(response)\n");
But it doesn't work.
Anyone is welcome to provide insight.
Thanks,
Luis
Hello!
Today at SIPit 29 we successfully tested the kamailio auth_identity module that implements RFC 4474.
We could successfully add SIP identity headers and verify incoming headers from one other implementation.
Now, the module is not built for scalability and redundance. A lot of stuff is cached in RAM, like certificates - which could lead to an DOS attack vector. It doesn't make it simple either when you have multiple servers for one domain. Maybe a memcached backend could help.
We will also try to look for other attack vectors, like sending bad HTTPS URL's.
Regardless, this was the first time I got SIP identity working and the others are struggling with their code to get their end working :-)
Kamailio rocks.
/O
Module: sip-router
Branch: 3.2
Commit: 639f0a4b7608217679e63e9121fcff34a5c6424c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=639f0a4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Oct 27 03:50:56 2011 +0200
dialog(k): removed invalid html tag for docbook source
(cherry picked from commit 1d917dac68bdaf3a6aabcb644e08c00fd2f9ae0f)
---
modules_k/dialog/doc/dialog_admin.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/doc/dialog_admin.xml b/modules_k/dialog/doc/dialog_admin.xml
index 86a5ad2..cdc3f19 100644
--- a/modules_k/dialog/doc/dialog_admin.xml
+++ b/modules_k/dialog/doc/dialog_admin.xml
@@ -1435,7 +1435,7 @@ dlg_refer("caller", "sip:annoucement@kamailio.org");
This function can be used from REQUEST_ROUTE.
</para>
<para>
- <b>IMPORTANT</b>: Users of this function should make sure that the
+ IMPORTANT: Users of this function should make sure that the
dialog created is further processed statefully. Specifically, if a
stateless response is sent out after dlg_manage() is called, the
dialog cannot be handled properly. So make sure that a transaction
Module: sip-router
Branch: 3.2
Commit: 6eeaecbf81f07ee4f3d9453c5c3090ef8e90954b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6eeaecb…
Author: Jason Penton <jason.penton(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Oct 26 14:32:00 2011 +0200
Dialog: Fixed lurking html tag in XML doc
(cherry picked from commit db308939b551a920b31bdebd76c28b5b104db68c)
---
modules_k/dialog/doc/dialog_admin.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/doc/dialog_admin.xml b/modules_k/dialog/doc/dialog_admin.xml
index 9bcbea1..86a5ad2 100644
--- a/modules_k/dialog/doc/dialog_admin.xml
+++ b/modules_k/dialog/doc/dialog_admin.xml
@@ -1439,7 +1439,7 @@ dlg_refer("caller", "sip:annoucement@kamailio.org");
dialog created is further processed statefully. Specifically, if a
stateless response is sent out after dlg_manage() is called, the
dialog cannot be handled properly. So make sure that a transaction
- exists or create it explicitly using the tm module.<br>This is a
+ exists or create it explicitly using the tm module. This is a
shortcoming of the current implementation that may be resolved in a
future version hopefully.
</para>
Module: sip-router
Branch: master
Commit: 1d917dac68bdaf3a6aabcb644e08c00fd2f9ae0f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1d917da…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Oct 27 03:50:56 2011 +0200
dialog(k): removed invalid html tag for docbook source
---
modules_k/dialog/doc/dialog_admin.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/doc/dialog_admin.xml b/modules_k/dialog/doc/dialog_admin.xml
index 86a5ad2..cdc3f19 100644
--- a/modules_k/dialog/doc/dialog_admin.xml
+++ b/modules_k/dialog/doc/dialog_admin.xml
@@ -1435,7 +1435,7 @@ dlg_refer("caller", "sip:annoucement@kamailio.org");
This function can be used from REQUEST_ROUTE.
</para>
<para>
- <b>IMPORTANT</b>: Users of this function should make sure that the
+ IMPORTANT: Users of this function should make sure that the
dialog created is further processed statefully. Specifically, if a
stateless response is sent out after dlg_manage() is called, the
dialog cannot be handled properly. So make sure that a transaction