[sr-dev] git:5.0:ee3fe583: doc: entities updated to use lists.kamailio.org

2017-04-11 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 5.0
Commit: ee3fe583b0452c57b1317911d9ff5f6ddd7dc91e
URL: 
https://github.com/kamailio/kamailio/commit/ee3fe583b0452c57b1317911d9ff5f6ddd7dc91e

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-11T15:47:23+02:00

doc: entities updated to use lists.kamailio.org

- http replaced with https in entity urls

(cherry picked from commit 2e089367f42a7d919ad5e59071f9e713a76425d9)

---

Modified: doc/docbook/entities.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/ee3fe583b0452c57b1317911d9ff5f6ddd7dc91e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ee3fe583b0452c57b1317911d9ff5f6ddd7dc91e.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] modules/nathelper: add undocumented filter_server_id (#1067)

2017-04-11 Thread Daniel-Constantin Mierla
Thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1067#issuecomment-293302399___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:a2fe77bc: kamilio.cfg: updated the address of sr-users mailing list

2017-04-11 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: a2fe77bcce3c9c1f926ca1767f2ea8e25ed4fe75
URL: 
https://github.com/kamailio/kamailio/commit/a2fe77bcce3c9c1f926ca1767f2ea8e25ed4fe75

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-11T15:24:32+02:00

kamilio.cfg: updated the address of sr-users mailing list

---

Modified: etc/kamailio.cfg

---

Diff:  
https://github.com/kamailio/kamailio/commit/a2fe77bcce3c9c1f926ca1767f2ea8e25ed4fe75.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a2fe77bcce3c9c1f926ca1767f2ea8e25ed4fe75.patch

---

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 99b6cc9..85d43bc 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -4,7 +4,7 @@
 # - web: http://www.kamailio.org
 # - git: http://sip-router.org
 #
-# Direct your questions about this file to: <sr-us...@lists.sip-router.org>
+# Direct your questions about this file to: <sr-us...@lists.kamailio.org>
 #
 # Refer to the Core CookBook at http://www.kamailio.org/wiki/
 # for an explanation of possible statements, functions and parameters.


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.0:315e2002: README: updated the addresses to sr-dev and sr-users mailing lists

2017-04-11 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 5.0
Commit: 315e20020a773337b7508359caf089298d8b275c
URL: 
https://github.com/kamailio/kamailio/commit/315e20020a773337b7508359caf089298d8b275c

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-11T15:35:45+02:00

README: updated the addresses to sr-dev and sr-users mailing lists

(cherry picked from commit dd3a55d190cf00066cb23a13d9c81827f1da14cd)

---

Modified: README
Modified: README.md

---

Diff:  
https://github.com/kamailio/kamailio/commit/315e20020a773337b7508359caf089298d8b275c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/315e20020a773337b7508359caf089298d8b275c.patch

---

diff --git a/README b/README
index 965d6dc..5ff6ee5 100644
--- a/README
+++ b/README
@@ -106,7 +106,7 @@ To receive feedback to your inquiries, we recommend you to 
subscribe
 to the sr-users mailing list and post your queries there. This mailing
 list is set up for mutual help by the community of Kamailio users and 
developers.
 To participate in the mailing list, subscribe at the following web address:
- https://lists.sip-router.org/mailman/listinfo/sr-users
+ https://lists.kamailio.org/mailman/listinfo/sr-users
 
 The IRC channel #kamailio on freenode.net is a place where to meet and discuss
 with other members of Kamailio community.
diff --git a/README.md b/README.md
index e2d6a39..d3513d9 100644
--- a/README.md
+++ b/README.md
@@ -83,11 +83,11 @@ To report a bug or make a request for new features, use the 
Issues Page in the K
 
 Mailing list for discussions regarding stable versions of Kamailio:
 
-  * **sr-users (at) lists.sip-router.org** - [sr-users web 
page](https://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users)
+  * **sr-users (at) lists.kamailio.org** - [sr-users web 
page](https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users)
 
 Mailing list for discussions regarding the development of Kamailio and the 
state of master (devel) branch:
 
-  * **sr-dev (at) lists.sip-router.org** - [sr-dev web 
page](https://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev)
+  * **sr-dev (at) lists.kamailio.org** - [sr-dev web 
page](https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev)
 
 Mailing list for discussions with commercial purpose:
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] modules/{acc, cdp}: allows big endian build (#1068)

2017-04-13 Thread Daniel-Constantin Mierla
auth_diameter had a different implementation than cdp. Maybe @ngvoice, 
@jaybeepee or @vingarzan can comment if cdp is safe for big endian.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1068#issuecomment-293804306___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] drouting: use keepalive to monitor GW/destinations (sort_order 0 only) (#1066)

2017-04-21 Thread Daniel-Constantin Mierla
Closed #1066.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1066#event-1052168440___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] drouting: use keepalive to monitor GW/destinations (sort_order 0 only) (#1066)

2017-04-21 Thread Daniel-Constantin Mierla
Merged manually.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1066#issuecomment-296148993___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] ipops compiler warnings (#1074)

2017-04-21 Thread Daniel-Constantin Mierla
Regenerated with later ragel version didn't change anything, so I removed them 
manually to get the compilation clean.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1074#issuecomment-296250247___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 4.4.5 crash at receive_fd() (#1069)

2017-04-13 Thread Daniel-Constantin Mierla
Seems a bit similar with #1059 -- can you try with patch e4a11d7?

Also, what is executed in the event_route[dialog:end]? Are there operations 
that could take long time?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1069#issuecomment-293808652___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] After having updated to 5.1 version of kamailio ICSCF doesn't send the UAR towards HSS (#1065)

2017-04-14 Thread Daniel-Constantin Mierla
Closing, if 987c810 doesn't solve it, then reopen.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1065#issuecomment-294101110___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:f5c3d50d: jsonrpcs: exported jsonrpc_exec() to kemi framework

2017-04-14 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f5c3d50d94ef92dfc82fdbbdf301ce5e79091c38
URL: 
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5e79091c38

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-14T09:07:39+02:00

jsonrpcs: exported jsonrpc_exec() to kemi framework

- available as jsonrpcs.exec()

---

Modified: src/modules/jsonrpcs/jsonrpcs_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5e79091c38.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5e79091c38.patch

---

diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c 
b/src/modules/jsonrpcs/jsonrpcs_mod.c
index 34f5f64..7e05029 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -45,6 +45,7 @@
 #include "../../core/sip_msg_clone.h"
 #include "../../core/data_lump.h"
 #include "../../core/data_lump_rpl.h"
+#include "../../core/kemi.h"
 #include "../../modules/xhttp/api.h"
 
 #include "jsonrpcs_mod.h"
@@ -1445,3 +1446,35 @@ static int jsonrpc_pv_parse_jrpl_name(pv_spec_t *sp, str 
*in)
}
return 0;
 }
+
+/**
+ *
+ */
+static int ki_jsonrpcs_exec(sip_msg_t *msg, str *scmd)
+{
+   return jsonrpc_exec_ex(scmd, NULL);
+}
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_jsonrpcs_exports[] = {
+   { str_init("jsonrpcs"), str_init("exec"),
+   SR_KEMIP_INT, ki_jsonrpcs_exec,
+   { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
+
+   { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+/* clang-format on */
+
+/**
+ *
+ */
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
+{
+   sr_kemi_modules_add(sr_kemi_jsonrpcs_exports);
+   return 0;
+}


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] How to cherry-pick from master to 4.4 since file paths have changed

2017-04-13 Thread Daniel-Constantin Mierla
Hello,

in most of the cases it worked with 'cherry-pick -x' for me, latest git
versions seems to be smart and figure out the path change.

Otherwise I just get the patch as a diff from the commit with `git
diff-tree -p COMMITID` and apply it manually with 'patch'.

If there are better ways, I am keen to learn about as well.

Cheers,
Daniel


On 13.04.17 14:54, Lucian Balaceanu wrote:
> Hi guys,
>
> I would like to port my latest master commit to the 4.4 branch.
> Since the path to the modules have changed I can no longer do a simple
> `git cherry-pick -x ...`.
>
> What is the accepted way to backport changes to 4.4? Maybe something
> using the `git cherry-pick --strategy ...` ?
>
> Thank you,
> Lucian
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Planning next IRC devel meeting - Apr 20, 2017

2017-04-20 Thread Daniel-Constantin Mierla
Small correction: it was about 3 hours when I wrote instead of 2 hours.

From now: 2h30min.

Cheers,
Daniel


On 20.04.17 13:00, Daniel-Constantin Mierla wrote:
> Hello,
>
> quick note to sync for those that want to participate today at kamailio
> devel irc meeting -- it going to start in about 2 hours from now:
>
>   - https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>
> Cheers,
> Daniel
>
> On 18.04.17 17:38, Daniel-Constantin Mierla wrote:
>> Hello,
>>
>> based on the people that showed interest to participate, the next IRC
>> meeting is going to be on this week, Thursday, April 20, at 14:00UTC
>> (16:00 in Berlin, Madrid, Paris; 15:00 in London, ...).
>>
>> For more details, see:
>>
>>   - https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>>
>> If you have new topics to discuss, try to add them before the start of
>> the event in order to plan properly the schedule.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 07.04.17 12:49, Daniel-Constantin Mierla wrote:
>>> Hello,
>>>
>>> probably it is the time to have another IRC devel meeting to discuss the
>>> plans for the project and the roadmap to next major release, v5.1.
>>>
>>> First proposed date would be Apr 20, with secondary options for Apr 24
>>> or 25, but other dates can be taken in consideration if more convenient
>>> for a consistent group of developers.
>>>
>>> I created the wiki page for it at:
>>>
>>>   * https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>>>
>>> Feel free to add there the subjects you want to discuss, I also have
>>> several other topics to add.
>>>
>>> It would be good to list yourself if you are going to participate (or
>>> want to participate) in a specific day in order to see who are we
>>> relying on being present.
>>>
>>> Cheers,
>>> Daniel
>>>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] topos: fix incorrect contact in 183 and 200 OK responces (#1081)

2017-04-20 Thread Daniel-Constantin Mierla
Thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1081#issuecomment-295697624___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Planning next IRC devel meeting - Apr 20, 2017

2017-04-20 Thread Daniel-Constantin Mierla
Here we are: 5 minutes before the start of the session notification.

Join the #kamailio irc channel on freenode.net if you want to join the
sessions.

Cheers,
Daniel


On 20.04.17 13:30, Daniel-Constantin Mierla wrote:
> Small correction: it was about 3 hours when I wrote instead of 2 hours.
>
> From now: 2h30min.
>
> Cheers,
> Daniel
>
>
> On 20.04.17 13:00, Daniel-Constantin Mierla wrote:
>> Hello,
>>
>> quick note to sync for those that want to participate today at kamailio
>> devel irc meeting -- it going to start in about 2 hours from now:
>>
>>   - https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>>
>> Cheers,
>> Daniel
>>
>> On 18.04.17 17:38, Daniel-Constantin Mierla wrote:
>>> Hello,
>>>
>>> based on the people that showed interest to participate, the next IRC
>>> meeting is going to be on this week, Thursday, April 20, at 14:00UTC
>>> (16:00 in Berlin, Madrid, Paris; 15:00 in London, ...).
>>>
>>> For more details, see:
>>>
>>>   - https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>>>
>>> If you have new topics to discuss, try to add them before the start of
>>> the event in order to plan properly the schedule.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 07.04.17 12:49, Daniel-Constantin Mierla wrote:
>>>> Hello,
>>>>
>>>> probably it is the time to have another IRC devel meeting to discuss the
>>>> plans for the project and the roadmap to next major release, v5.1.
>>>>
>>>> First proposed date would be Apr 20, with secondary options for Apr 24
>>>> or 25, but other dates can be taken in consideration if more convenient
>>>> for a consistent group of developers.
>>>>
>>>> I created the wiki page for it at:
>>>>
>>>>   * https://www.kamailio.org/wiki/devel/irc-meetings/2017a
>>>>
>>>> Feel free to add there the subjects you want to discuss, I also have
>>>> several other topics to add.
>>>>
>>>> It would be good to list yourself if you are going to participate (or
>>>> want to participate) in a specific day in order to see who are we
>>>> relying on being present.
>>>>
>>>> Cheers,
>>>> Daniel
>>>>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:03763216: app_sqlang: implemented KSR.x.exit() using context field

2017-04-20 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 037632161767262c3c562d20985ae8c66637f0d8
URL: 
https://github.com/kamailio/kamailio/commit/037632161767262c3c562d20985ae8c66637f0d8

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-20T20:07:55+02:00

app_sqlang: implemented KSR.x.exit() using context field

---

Modified: src/modules/app_sqlang/app_sqlang_api.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/037632161767262c3c562d20985ae8c66637f0d8.diff
Patch: 
https://github.com/kamailio/kamailio/commit/037632161767262c3c562d20985ae8c66637f0d8.patch

---

diff --git a/src/modules/app_sqlang/app_sqlang_api.c 
b/src/modules/app_sqlang/app_sqlang_api.c
index d5e3f86..e654cdc 100644
--- a/src/modules/app_sqlang/app_sqlang_api.c
+++ b/src/modules/app_sqlang/app_sqlang_api.c
@@ -52,7 +52,9 @@ void sqlang_sr_kemi_register_libs(HSQUIRRELVM J);
 typedef struct _sr_sqlang_env
 {
HSQUIRRELVM J;
+   int J_exit;
HSQUIRRELVM JJ;
+   int JJ_exit;
sip_msg_t *msg;
unsigned int flags;
unsigned int nload; /* number of scripts loaded */
@@ -248,7 +250,15 @@ static int sqlang_isfunction(HSQUIRRELVM J, int idx)
 
 static char* sqlang_safe_tostring(HSQUIRRELVM J, int idx)
 {
-   return "Error on sqlang";
+   const SQChar *s = NULL;
+
+   if(idx>=0) {
+   idx += 2;
+   }
+   if(sqlang_isstring(J, idx)) {
+   sq_getstring(J, idx, );
+   }
+   return (s)?(char*)s:"Error on sqlang";
 }
 
 static int sqlang_gettype(HSQUIRRELVM J, int idx)
@@ -508,6 +518,11 @@ const SQRegFunction _sr_kemi_pv_J_Map[] = {
  */
 static SQInteger sqlang_sr_exit (HSQUIRRELVM J)
 {
+   if(_sr_J_env.JJ==J) {
+   _sr_J_env.JJ_exit = 1;
+   } else {
+   _sr_J_env.J_exit = 1;
+   }
return sq_throwerror(J, _SC("~~ksr~exit~~"));
 }
 
@@ -516,6 +531,11 @@ static SQInteger sqlang_sr_exit (HSQUIRRELVM J)
  */
 static SQInteger sqlang_sr_drop (HSQUIRRELVM J)
 {
+   if(_sr_J_env.JJ==J) {
+   _sr_J_env.JJ_exit = 1;
+   } else {
+   _sr_J_env.J_exit = 1;
+   }
sr_kemi_core_drop(NULL);
return sq_throwerror(J, _SC("~~ksr~exit~~"));
 }
@@ -693,11 +713,23 @@ const SQRegFunction _sr_kemi_x_J_Map[] = {
 /**
  *
  */
-void sqlang_errorfunc(HSQUIRRELVM SQ_UNUSED_ARG(J), const SQChar *fmt,...)
+void sqlang_errorfunc(HSQUIRRELVM J, const SQChar *fmt, ...)
 {
char ebuf[4096];
va_list ap;
 
+   if(_sr_J_env.JJ==J) {
+   if(_sr_J_env.JJ_exit == 1) {
+   LM_DBG("exception on ksr exit (JJ)\n");
+   return;
+   }
+   } else {
+   if(_sr_J_env.J_exit == 1) {
+   LM_DBG("exception on ksr exit (J)\n");
+   return;
+   }
+   }
+
ebuf[0] = '\0';
va_start(ap, fmt);
vsnprintf(ebuf, 4094, fmt, ap);
@@ -965,16 +997,23 @@ int app_sqlang_run_ex(sip_msg_t *msg, char *func, char 
*p1, char *p2,
LM_DBG("executing sqlang function: [[%s]] (n: %d)\n", func, n);
bmsg = _sr_J_env.msg;
_sr_J_env.msg = msg;
+   _sr_J_env.JJ_exit = 0;
/* call the function */
rv = sq_call(_sr_J_env.JJ, n, SQFalse, SQTrue);
if(SQ_SUCCEEDED(rv)) {
ret = 1;
} else {
-   LM_ERR("failed to execute the func: %s (%d)\n", func, (int)rv);
-   sqstd_printcallstack(_sr_J_env.JJ);
-   ret = -1;
+   if(_sr_J_env.JJ_exit==0) {
+   LM_ERR("failed to execute the func: %s (%d)\n", func, 
(int)rv);
+   sqstd_printcallstack(_sr_J_env.JJ);
+   ret = -1;
+   } else {
+   LM_DBG("script execution exit\n");
+   ret = 1;
+   }
}
_sr_J_env.msg = bmsg;
+   _sr_J_env.JJ_exit = 0;
sq_settop(_sr_J_env.JJ, (top<=0)?1:top); /* restores the original stack 
size */
 
return ret;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:04cc991f: app_jsdt: documented app_jsdt.api_list rpc command

2017-04-20 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 04cc991ffed78c52dda0fc405f2919c1e546a9ce
URL: 
https://github.com/kamailio/kamailio/commit/04cc991ffed78c52dda0fc405f2919c1e546a9ce

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-20T18:51:49+02:00

app_jsdt: documented app_jsdt.api_list rpc command

---

Modified: src/modules/app_jsdt/doc/app_jsdt_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/04cc991ffed78c52dda0fc405f2919c1e546a9ce.diff
Patch: 
https://github.com/kamailio/kamailio/commit/04cc991ffed78c52dda0fc405f2919c1e546a9ce.patch

---

diff --git a/src/modules/app_jsdt/doc/app_jsdt_admin.xml 
b/src/modules/app_jsdt/doc/app_jsdt_admin.xml
index 75703f0..47f50bd 100644
--- a/src/modules/app_jsdt/doc/app_jsdt_admin.xml
+++ b/src/modules/app_jsdt/doc/app_jsdt_admin.xml
@@ -201,14 +201,14 @@ if(!jsdt_runstring('KSR.dbg("Hello World from $fU\n")'))
 
 
 RPC Commands
-
+
 
-app_jsrt.reload
+app_jsdt.reload
 
 
 Marks the need to reload the js script.
 The actual reload is done by every working process when the next
-call to jsrt_run() function or KEMI config is executed.
+call to jsdt_run() function or KEMI config is executed.
 
 
 Name: app_jsdt.reload
@@ -219,7 +219,27 @@ if(!jsdt_runstring('KSR.dbg("Hello World from $fU\n")'))
 
 
 ...
- app_jsrt.reload
+ app_jsdt.reload
+...
+
+
+   
+
+app_jsdt.api_list
+
+
+   List the functions available via Kemi framework.
+
+
+Name: app_jsdt.api_list
+
+Parameters: none
+
+Example:
+
+
+...
+ app_jsdt.api_list
 ...
 
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:c86b8820: kex: exported setdebug() and resetdebug() to kemi framework

2017-04-14 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: c86b882087b6fa9b45f70715c4178178a0086804
URL: 
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c4178178a0086804

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-14T17:50:14+02:00

kex: exported setdebug() and resetdebug() to kemi framework

---

Modified: src/modules/kex/kex_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c4178178a0086804.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c4178178a0086804.patch

---

diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index 9af58c6..46bc97a 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -32,6 +32,7 @@
 #include "../../core/flags.h"
 #include "../../core/dset.h"
 #include "../../core/mod_fix.h"
+#include "../../core/kemi.h"
 #include "../../core/parser/parse_uri.h"
 #include "../../lib/srutils/sruid.h"
 
@@ -233,3 +234,49 @@ static int pv_get_sruid_val(struct sip_msg *msg, 
pv_param_t *param,
return pv_get_strval(msg, param, res, &_kex_sruid.uid);
 }
 
+/**
+ *
+ */
+static int ki_kex_setdebug(sip_msg_t *msg, int lval)
+{
+   set_local_debug_level(lval);
+   return 1;
+}
+
+/**
+ *
+ */
+static int ki_kex_resetdebug(sip_msg_t *msg)
+{
+   reset_local_debug_level();
+   return 1;
+}
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_kex_exports[] = {
+   { str_init("kex"), str_init("setdebug"),
+   SR_KEMIP_INT, ki_kex_setdebug,
+   { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
+   { str_init("kex"), str_init("resetdebug"),
+   SR_KEMIP_INT, ki_kex_resetdebug,
+   { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
+
+   { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+/* clang-format on */
+
+/**
+ *
+ */
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
+{
+   sr_kemi_modules_add(sr_kemi_kex_exports);
+   return 0;
+}
\ No newline at end of file


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] dmq_usrloc: sync with multi contacts per message (#1054)

2017-04-18 Thread Daniel-Constantin Mierla
@charlesrchance I guess this is ready to be merged if you are fine with 
everything so far.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1054#issuecomment-294816291___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] tm: don't reset uac reply if in a continue route (#1063)

2017-04-18 Thread Daniel-Constantin Mierla
Merging it. Thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1063#issuecomment-294906905___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] tm: don't reset uac reply if in a continue route (#1063)

2017-04-18 Thread Daniel-Constantin Mierla
Merged #1063.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1063#event-1047034837___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Compile problem+fix on solaris in app_jsdt (#1072)

2017-04-18 Thread Daniel-Constantin Mierla
The file `duk_config.h` is imported from Duktape project as it is and I would 
try to avoid diverting from the official version:

  * https://duktape.org

We had tuktape v2.0.0 and I just updated to v2.0.2. Can you try with kamailio 
master branch and see if all ok? I noticed some updates in the code regarding 
to this and may have it addressed. If all ok, I will backport.

If not, then I would suggest to also report to ducktape project so there it 
gets fixed as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1072#issuecomment-294910194___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:81741d65: app_jsdt: updated embedded duktape js interpreter from 2.0.0 to 2.0.2

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 81741d652c751a0a5aa96f98635888ed359a
URL: 
https://github.com/kamailio/kamailio/commit/81741d652c751a0a5aa96f98635888ed359a

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-18T18:55:15+02:00

app_jsdt: updated embedded duktape js interpreter from 2.0.0 to 2.0.2

---

Modified: src/modules/app_jsdt/duk_config.h
Modified: src/modules/app_jsdt/duktape.c
Modified: src/modules/app_jsdt/duktape.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/81741d652c751a0a5aa96f98635888ed359a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/81741d652c751a0a5aa96f98635888ed359a.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:90e44290: corex: exported append_branch() to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 90e44290889cd00e0b2edd566d923b8eecdf5437
URL: 
https://github.com/kamailio/kamailio/commit/90e44290889cd00e0b2edd566d923b8eecdf5437

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

corex: exported append_branch() to kemi framework

---

Modified: src/modules/corex/corex_lib.c
Modified: src/modules/corex/corex_lib.h
Modified: src/modules/corex/corex_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/90e44290889cd00e0b2edd566d923b8eecdf5437.diff
Patch: 
https://github.com/kamailio/kamailio/commit/90e44290889cd00e0b2edd566d923b8eecdf5437.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:06ba0b3c: xhttp: added section ids

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 06ba0b3c77d4747686e58c0083eb318a579798cf
URL: 
https://github.com/kamailio/kamailio/commit/06ba0b3c77d4747686e58c0083eb318a579798cf

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

xhttp: added section ids

---

Modified: src/modules/xhttp/doc/xhttp_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/06ba0b3c77d4747686e58c0083eb318a579798cf.diff
Patch: 
https://github.com/kamailio/kamailio/commit/06ba0b3c77d4747686e58c0083eb318a579798cf.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:8960972b: htable: exported iterator functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 8960972b2ad5d460ed494b24a3bba1cb118e8b1f
URL: 
https://github.com/kamailio/kamailio/commit/8960972b2ad5d460ed494b24a3bba1cb118e8b1f

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

htable: exported iterator functions to kemi framework

---

Modified: src/modules/htable/htable.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/8960972b2ad5d460ed494b24a3bba1cb118e8b1f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/8960972b2ad5d460ed494b24a3bba1cb118e8b1f.patch

---

diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index 1876b28..18a3ab8 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -458,6 +458,18 @@ static int w_ht_iterator_start(struct sip_msg* msg, char* 
iname, char* hname)
return 1;
 }
 
+static int ki_ht_iterator_start(sip_msg_t *msg, str *iname, str *hname)
+{
+   if(iname==NULL || iname->s==NULL || iname->len<=0
+   || hname==NULL || hname->s==NULL || hname->len<=0) {
+   LM_ERR("invalid parameters\n");
+   return -1;
+   }
+   if(ht_iterator_start(iname, hname)<0)
+   return -1;
+   return 1;
+}
+
 static int w_ht_iterator_next(struct sip_msg* msg, char* iname, char* foo)
 {
str siname;
@@ -472,6 +484,17 @@ static int w_ht_iterator_next(struct sip_msg* msg, char* 
iname, char* foo)
return 1;
 }
 
+static int ki_ht_iterator_next(sip_msg_t *msg, str *iname)
+{
+   if(iname==NULL || iname->s==NULL || iname->len<=0) {
+   LM_ERR("invalid parameters\n");
+   return -1;
+   }
+   if(ht_iterator_next(iname)<0)
+   return -1;
+   return 1;
+}
+
 static int w_ht_iterator_end(struct sip_msg* msg, char* iname, char* foo)
 {
str siname;
@@ -486,6 +509,17 @@ static int w_ht_iterator_end(struct sip_msg* msg, char* 
iname, char* foo)
return 1;
 }
 
+static int ki_ht_iterator_end(sip_msg_t *msg, str *iname)
+{
+   if(iname==NULL || iname->s==NULL || iname->len<=0) {
+   LM_ERR("invalid parameters\n");
+   return -1;
+   }
+   if(ht_iterator_end(iname)<0)
+   return -1;
+   return 1;
+}
+
 static int ki_ht_slot_xlock(sip_msg_t *msg, str *htname, str *skey, int lmode)
 {
ht_t *ht;
@@ -1138,6 +1172,21 @@ static sr_kemi_t sr_kemi_htable_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+   { str_init("htable"), str_init("sht_iterator_start"),
+   SR_KEMIP_INT, ki_ht_iterator_start,
+   { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
+   { str_init("htable"), str_init("sht_iterator_next"),
+   SR_KEMIP_INT, ki_ht_iterator_next,
+   { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
+   { str_init("htable"), str_init("sht_iterator_end"),
+   SR_KEMIP_INT, ki_ht_iterator_end,
+   { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
 
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:1a38dd7b: dialog: exported profile functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 1a38dd7be8bdee8bebe2420b46b9be82c1e52927
URL: 
https://github.com/kamailio/kamailio/commit/1a38dd7be8bdee8bebe2420b46b9be82c1e52927

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

dialog: exported profile functions to kemi framework

---

Modified: src/modules/dialog/dialog.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/1a38dd7be8bdee8bebe2420b46b9be82c1e52927.diff
Patch: 
https://github.com/kamailio/kamailio/commit/1a38dd7be8bdee8bebe2420b46b9be82c1e52927.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:ba64899e: textopsx: exported several functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: ba64899e3c8dce9c683a6c5d0c836add080a7eb9
URL: 
https://github.com/kamailio/kamailio/commit/ba64899e3c8dce9c683a6c5d0c836add080a7eb9

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

textopsx: exported several functions to kemi framework

---

Modified: src/modules/textopsx/textopsx.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/ba64899e3c8dce9c683a6c5d0c836add080a7eb9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ba64899e3c8dce9c683a6c5d0c836add080a7eb9.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Fix memory leak in ldap module. (#1071)

2017-04-18 Thread Daniel-Constantin Mierla
Closed #1071.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1071#event-1046557228___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:f076ed99: Makefile.rules: make clean rules removes static libs from modules

2017-04-20 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f076ed992770d53e7cded5f5d8b7362c92a212be
URL: 
https://github.com/kamailio/kamailio/commit/f076ed992770d53e7cded5f5d8b7362c92a212be

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-20T07:54:11+02:00

Makefile.rules: make clean rules removes static libs from modules

---

Modified: src/Makefile.rules

---

Diff:  
https://github.com/kamailio/kamailio/commit/f076ed992770d53e7cded5f5d8b7362c92a212be.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f076ed992770d53e7cded5f5d8b7362c92a212be.patch

---

diff --git a/src/Makefile.rules b/src/Makefile.rules
index 4d73a68..10d04a1 100644
--- a/src/Makefile.rules
+++ b/src/Makefile.rules
@@ -210,7 +210,7 @@ static: $(objs)
 # (it's usefull to have it separated from clean for speeding up make proper)
 .PHONY: local-clean
 local-clean:
-   -@rm -f $(objs) $(NAME) $(objs:.o=.il) librpath.lst 2>/dev/null
+   -@rm -f $(objs) $(NAME) $(objs:.o=.il) *.a librpath.lst 2>/dev/null
 
 .PHONY: clean
 clean: local-clean


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:ec7dd4fa: core: script callbacks api - updated log messages

2017-04-23 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: ec7dd4fa56a052e98008205e187ad6ce9a819142
URL: 
https://github.com/kamailio/kamailio/commit/ec7dd4fa56a052e98008205e187ad6ce9a819142

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-23T11:25:44+02:00

core: script callbacks api - updated log messages

---

Modified: src/core/script_cb.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/ec7dd4fa56a052e98008205e187ad6ce9a819142.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ec7dd4fa56a052e98008205e187ad6ce9a819142.patch

---

diff --git a/src/core/script_cb.c b/src/core/script_cb.c
index efd76cf..52d3698 100644
--- a/src/core/script_cb.c
+++ b/src/core/script_cb.c
@@ -79,18 +79,17 @@ int register_script_cb( cb_function f, unsigned int flags, 
void *param )
 
/* type checkings */
if ( (flags&((1<<SCRIPT_CB_NUM)-1))==0 ) {
-   LOG(L_BUG, "register_script_cb: callback flag not specified\n");
+   LM_BUG("callback flag not specified\n");
return -1;
}
if ( (flags&(~(PRE_SCRIPT_CB|POST_SCRIPT_CB))) >= 1< SCRIPT_CB_NUM) {
-   LOG(L_BUG, "Uknown callback type %d\n", type);
+   LM_BUG("unknown callback type %d\n", type);
return 0;
}
 
@@ -174,7 +173,7 @@ int exec_post_script_cb( struct sip_msg *msg, enum 
script_cb_type type)
unsigned intflags;
 
if (type > SCRIPT_CB_NUM) {
-   LOG(L_BUG, "Uknown callback type %d\n", type);
+   LM_BUG("unknown callback type %d\n", type);
return 1;
}
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:7004969c: dialog: execute pre script callback only when event route is set

2017-04-21 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 7004969cf94815167d72d2e7158e4754c730ff1d
URL: 
https://github.com/kamailio/kamailio/commit/7004969cf94815167d72d2e7158e4754c730ff1d

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-21T19:59:38+02:00

dialog: execute pre script callback only when event route is set

---

Modified: src/core/script_cb.c
Modified: src/modules/dialog/dlg_handlers.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7004969cf94815167d72d2e7158e4754c730ff1d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7004969cf94815167d72d2e7158e4754c730ff1d.patch

---

diff --git a/src/core/script_cb.c b/src/core/script_cb.c
index 5e1547e..efd76cf 100644
--- a/src/core/script_cb.c
+++ b/src/core/script_cb.c
@@ -18,15 +18,15 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
  *
  */
 
 /*!
  * \file
- * \brief Kamailio core :: Script callbacks 
+ * \brief Kamailio core :: Script callbacks
  *
  * Script callbacks adds the ability to register callback
  * functions which are always called when script for request
@@ -151,12 +151,11 @@ int exec_pre_script_cb( struct sip_msg *msg, enum 
script_cb_type type)
struct script_cb*cb;
unsigned intflags;
 
-#ifdef EXTRA_DEBUG
if (type > SCRIPT_CB_NUM) {
-   LOG(L_BUG, "Uknown callback type\n");
-   abort();
+   LOG(L_BUG, "Uknown callback type %d\n", type);
+   return 0;
}
-#endif
+
flags = PRE_SCRIPT_CB | (1<<(type-1));
for (cb=pre_script_cb[type-1]; cb ; cb=cb->next ) {
/* stop on error */
@@ -174,12 +173,11 @@ int exec_post_script_cb( struct sip_msg *msg, enum 
script_cb_type type)
struct script_cb*cb;
unsigned intflags;
 
-#ifdef EXTRA_DEBUG
if (type > SCRIPT_CB_NUM) {
-   LOG(L_BUG, "exec_pre_script_cb: Uknown callback type\n");
-   abort();
+   LOG(L_BUG, "Uknown callback type %d\n", type);
+   return 1;
}
-#endif
+
flags = POST_SCRIPT_CB | (1<<(type-1));
for (cb=post_script_cb[type-1]; cb ; cb=cb->next){
cb->cbf(msg, flags, cb->param);
diff --git a/src/modules/dialog/dlg_handlers.c 
b/src/modules/dialog/dlg_handlers.c
index 2eb36f5..030847b 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -61,7 +61,7 @@ static str   rr_param;/*!< record-route 
parameter for matching */
 static int   dlg_flag_mask=0;  /*!< flag for dialog tracking */
 static pv_spec_t *timeout_avp; /*!< AVP for timeout setting */
 static int   default_timeout;  /*!< default dialog timeout */
-static int   seq_match_mode;   /*!< dlg_match mode */ 
+static int   seq_match_mode;   /*!< dlg_match mode */
 static int   shutdown_done = 0;/*!< 1 when destroy_dlg_handlers was 
called */
 extern int   detect_spirals;
 extern int   dlg_timeout_noreset;
@@ -171,7 +171,7 @@ static inline int add_dlg_rr_param(struct sip_msg *req, 
unsigned int entry,
 /*!
  * \brief Parse SIP message and populate leg informations
  *
- * Parse SIP message and populate leg informations. 
+ * Parse SIP message and populate leg informations.
  * \param dlg the dialog to add cseq, contact & record_route
  * \param msg sip message
  * \param t transaction
@@ -813,7 +813,7 @@ static void unref_new_dialog(void *iuid)
  * \param t transaction
  * \param run_initial_cbs if set zero, initial callbacks are not executed
  * \return 0 on success, -1 on failure
- */ 
+ */
 int dlg_new_dialog(sip_msg_t *req, struct cell *t, const int run_initial_cbs)
 {
dlg_cell_t *dlg;
@@ -1191,7 +1191,7 @@ dlg_cell_t *dlg_lookup_msg_dialog(sip_msg_t *msg, 
unsigned int *dir)
}
return dlg;
}
-   
+
if (pre_match_parse(msg, , , , 0)<0)
return NULL;
vdir = DLG_DIR_NONE;
@@ -1723,16 +1723,15 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t 
*msg, int ostate, int nstate
}
}
 
+   if(rt>=0 || dlg_event_callback.len>0) {
+   if(msg==NULL)
+   fmsg = faked_msg_next();
+   else
+   fmsg = msg;
 
-   if(msg==NULL)
-   fmsg = faked_msg_next();
-   else
-   fmsg = msg;
-
-  

[sr-dev] git:master:7b190e64: xhttp: allow execution of callback function for event route via kemi

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 7b190e644c4b1c18055ededa7f4b5d5f2c1b6ca1
URL: 
https://github.com/kamailio/kamailio/commit/7b190e644c4b1c18055ededa7f4b5d5f2c1b6ca1

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

xhttp: allow execution of callback function for event route via kemi

- new parameter event_callback

---

Modified: src/modules/xhttp/xhttp_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7b190e644c4b1c18055ededa7f4b5d5f2c1b6ca1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7b190e644c4b1c18055ededa7f4b5d5f2c1b6ca1.patch

---

diff --git a/src/modules/xhttp/xhttp_mod.c b/src/modules/xhttp/xhttp_mod.c
index d104883..d41fc47 100644
--- a/src/modules/xhttp/xhttp_mod.c
+++ b/src/modules/xhttp/xhttp_mod.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
+ * Copyright (C) 2010-2017 Daniel-Constantin Mierla (asipto.com)
  *
  * This file is part of Kamailio, a free SIP server.
  *
@@ -13,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
  *
  */
@@ -67,6 +67,7 @@ static regex_t xhttp_url_skip_regexp;
 /** SL API structure */
 sl_api_t slb;
 
+static str xhttp_event_callback = STR_NULL;
 
 static cmd_export_t cmds[] = {
{"xhttp_reply",(cmd_function)w_xhttp_send_reply,
@@ -87,6 +88,7 @@ static pv_export_t mod_pvs[] = {
 static param_export_t params[] = {
{"url_match",   PARAM_STRING, _url_match},
{"url_skip",PARAM_STRING, _url_skip},
+   {"event_callback",  PARAM_STR,_event_callback},
{0, 0, 0}
 };
 
@@ -120,18 +122,28 @@ static int mod_init(void)
 {
struct nonsip_hook nsh;
int route_no;
-   
-   route_no=route_get(_rt, "xhttp:request");
-   if (route_no==-1)
-   {
-   LM_ERR("failed to find event_route[xhttp:request]\n");
-   return -1;
-   }
-   if (event_rt.rlist[route_no]==0)
-   {
-   LM_WARN("event_route[xhttp:request] is empty\n");
+   sr_kemi_eng_t *keng = NULL;
+
+   if(xhttp_event_callback.s!=NULL && xhttp_event_callback.len>0) {
+   keng = sr_kemi_eng_get();
+   if(keng==NULL) {
+   LM_ERR("failed to find kemi engine\n");
+   return -1;
+   }
+   xhttp_route_no=-1;
+   } else {
+   route_no=route_lookup(_rt, "xhttp:request");
+   if (route_no==-1)
+   {
+   LM_ERR("failed to find event_route[xhttp:request]\n");
+   return -1;
+   }
+   if (event_rt.rlist[route_no]==0)
+   {
+   LM_WARN("event_route[xhttp:request] is empty\n");
+   }
+   xhttp_route_no=route_no;
}
-   xhttp_route_no=route_no;

/* bind the SL API */
if (sl_load_api()!=0) {
@@ -241,10 +253,14 @@ static int xhttp_process_request(sip_msg_t* orig_msg,
  char* new_buf, 
unsigned int new_len)
 {
int ret;
+   int backup_rt;
sip_msg_t tmp_msg, *msg;
struct run_act_ctx ra_ctx;
-   
+   sr_kemi_eng_t *keng = NULL;
+   str evrtname = str_init("xhttp:request");
+
ret=0;
+   backup_rt = get_route_type();
if (new_buf && new_len)
{
memset(_msg, 0, sizeof(sip_msg_t));
@@ -270,17 +286,31 @@ static int xhttp_process_request(sip_msg_t* orig_msg,
LM_CRIT("strange message: %.*s\n", msg->len, msg->buf);
goto error;
}
+
+   set_route_type(EVENT_ROUTE);
if (exec_pre_script_cb(msg, REQUEST_CB_TYPE) == 0)
{
goto done;
}
 
init_run_actions_ctx(_ctx);
-   if (run_actions(_ctx, event_rt.rlist[xhttp_route_no], msg) < 0)
-   {
-   ret=-1;
-   LM_DBG("error while trying script\n");
-   goto done;
+   if(xhttp_route_no>=0) {
+   if (run_actions(_ctx, event_rt.rlist[xhttp_route_no], msg) < 
0)
+   {
+   ret=-1;
+   LM_DBG("error while trying script\n");
+   goto done;
+   }
+   } else {
+ 

[sr-dev] git:master:f8bd4dcb: geoip2: exported functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f8bd4dcb68a513c525df5d54c4cb6accb1888b88
URL: 
https://github.com/kamailio/kamailio/commit/f8bd4dcb68a513c525df5d54c4cb6accb1888b88

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-18T14:07:48+02:00

geoip2: exported functions to kemi framework

---

Modified: src/modules/geoip2/geoip2_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f8bd4dcb68a513c525df5d54c4cb6accb1888b88.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f8bd4dcb68a513c525df5d54c4cb6accb1888b88.patch

---

diff --git a/src/modules/geoip2/geoip2_mod.c b/src/modules/geoip2/geoip2_mod.c
index 382a540..ffa083d 100644
--- a/src/modules/geoip2/geoip2_mod.c
+++ b/src/modules/geoip2/geoip2_mod.c
@@ -28,6 +28,7 @@
 #include "../../core/dprint.h"
 #include "../../core/ut.h"
 #include "../../core/pvar.h"
+#include "../../core/kemi.h"
 #include "../../core/mod_fix.h"
 
 #include "geoip2_pv.h"
@@ -40,7 +41,7 @@ static int  mod_init(void);
 static void mod_destroy(void);
 
 static int w_geoip2_match(struct sip_msg* msg, char* str1, char* str2);
-static int geoip2_match(struct sip_msg *msg, gparam_t *target, gparam_t 
*pvname);
+static int geoip2_match(sip_msg_t *msg, str *tomatch, str *pvclass);
 
 static pv_export_t mod_pvs[] = {
{ {"gip2", sizeof("gip2")-1}, PVT_OTHER, pv_get_geoip2, 0,
@@ -76,7 +77,6 @@ struct module_exports exports = {
 };
 
 
-
 /**
  * init module function
  */
@@ -105,34 +105,49 @@ static void mod_destroy(void)
geoip2_destroy_pv();
 }
 
-static int w_geoip2_match(struct sip_msg* msg, char* str1, char* str2)
+static int geoip2_match(sip_msg_t *msg, str *tomatch, str *pvclass)
 {
-   return geoip2_match(msg, (gparam_t*)str1, (gparam_t*)str2);
+   geoip2_pv_reset(pvclass);
+
+   return geoip2_update_pv(tomatch, pvclass);
 }
 
-static int geoip2_match(struct sip_msg *msg, gparam_t *target, gparam_t 
*pvname)
+static int w_geoip2_match(sip_msg_t* msg, char* target, char* pvname)
 {
-   str tomatch;
-   str pvclass;
+   str tomatch = STR_NULL;
+   str pvclass = STR_NULL;
 
-   if(msg==NULL)
-   {
+   if(msg==NULL) {
LM_ERR("received null msg\n");
return -1;
}
 
-   if(fixup_get_svalue(msg, target, )<0)
-   {
+   if(fixup_get_svalue(msg, (gparam_t*)target, )<0) {
LM_ERR("cannot get the address\n");
return -1;
}
-   if(fixup_get_svalue(msg, pvname, )<0)
-   {
+   if(fixup_get_svalue(msg, (gparam_t*)pvname, )<0) {
LM_ERR("cannot get the pv class\n");
return -1;
}
-   geoip2_pv_reset();
 
-   return geoip2_update_pv(, );
+   return geoip2_match(msg, , );
 }
 
+/**
+ *
+ */
+static sr_kemi_t sr_kemi_geoip2_exports[] = {
+{ str_init("geoip2"), str_init("match"),
+SR_KEMIP_INT, geoip2_match,
+{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+},
+
+{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+
+int mod_register(char *path, int *dlflags, void *p1, void *p2) {
+sr_kemi_modules_add(sr_kemi_geoip2_exports);
+return 0;
+}
\ No newline at end of file


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:450c9eb2: xhttp: documented event_callback parameter

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 450c9eb23e248c9dcd32a4a398f4585719c5bcd5
URL: 
https://github.com/kamailio/kamailio/commit/450c9eb23e248c9dcd32a4a398f4585719c5bcd5

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-17T20:27:01+02:00

xhttp: documented event_callback parameter

---

Modified: src/modules/xhttp/doc/xhttp_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/450c9eb23e248c9dcd32a4a398f4585719c5bcd5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/450c9eb23e248c9dcd32a4a398f4585719c5bcd5.patch

---

diff --git a/src/modules/xhttp/doc/xhttp_admin.xml 
b/src/modules/xhttp/doc/xhttp_admin.xml
index 869a1d5..90708ce 100644
--- a/src/modules/xhttp/doc/xhttp_admin.xml
+++ b/src/modules/xhttp/doc/xhttp_admin.xml
@@ -156,6 +156,33 @@ modparam("xhttp", "url_match", "^/sip/")
 


+   
+   event_callback (str)
+   
+   The name of the function in the kemi configuration file 
(embedded
+   scripting language such as Lua, Python, ...) to be 
executed instead
+   of event_route[xhttp:request] block.
+   
+   
+   The function has one string parameter with the value 
"xhttp:request".
+   
+   
+   
+   Default value is 'empty' (no function is executed for 
events).
+   
+   
+   
+   Set event_callback parameter
+   
+...
+modparam("xhttp", "event_callback", "ksr_xhttp_event")
+...
+-- event callback function implemented in Lua
+function ksr_xhttp_event(evname)
+   KSR.info("= xhttp module triggered event: " .. evname .. "\n");
+   return 1;
+end
+...

 



___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:39d23767: rtpengine: exported more functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 39d23767a0b86c385b1ab02d6d8523840796ff76
URL: 
https://github.com/kamailio/kamailio/commit/39d23767a0b86c385b1ab02d6d8523840796ff76

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-18T14:06:58+02:00

rtpengine: exported more functions to kemi framework

---

Modified: src/modules/rtpengine/rtpengine.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/39d23767a0b86c385b1ab02d6d8523840796ff76.diff
Patch: 
https://github.com/kamailio/kamailio/commit/39d23767a0b86c385b1ab02d6d8523840796ff76.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:a138f65c: geoip: exported functions to kemi framework

2017-04-18 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: a138f65cd5e4f810d3311891ac01a323a76c4807
URL: 
https://github.com/kamailio/kamailio/commit/a138f65cd5e4f810d3311891ac01a323a76c4807

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-04-18T14:07:27+02:00

geoip: exported functions to kemi framework

---

Modified: src/modules/geoip/geoip_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a138f65cd5e4f810d3311891ac01a323a76c4807.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a138f65cd5e4f810d3311891ac01a323a76c4807.patch

---

diff --git a/src/modules/geoip/geoip_mod.c b/src/modules/geoip/geoip_mod.c
index 1962172..ab827a1 100644
--- a/src/modules/geoip/geoip_mod.c
+++ b/src/modules/geoip/geoip_mod.c
@@ -30,6 +30,7 @@
 #include "../../core/dprint.h"
 #include "../../core/ut.h"
 #include "../../core/pvar.h"
+#include "../../core/kemi.h"
 #include "../../core/mod_fix.h"
 
 #include "geoip_pv.h"
@@ -42,7 +43,7 @@ static int  mod_init(void);
 static void mod_destroy(void);
 
 static int w_geoip_match(struct sip_msg* msg, char* str1, char* str2);
-static int geoip_match(struct sip_msg *msg, gparam_t *target, gparam_t 
*pvname);
+static int geoip_match(sip_msg_t *msg, str *tomatch, str *pvclass);
 
 static pv_export_t mod_pvs[] = {
{ {"gip", sizeof("git")-1}, PVT_OTHER, pv_get_geoip, 0,
@@ -78,7 +79,6 @@ struct module_exports exports = {
 };
 
 
-
 /**
  * init module function
  */
@@ -107,34 +107,50 @@ static void mod_destroy(void)
geoip_destroy_pv();
 }
 
-static int w_geoip_match(struct sip_msg* msg, char* str1, char* str2)
+
+static int geoip_match(sip_msg_t *msg, str *tomatch, str *pvclass)
 {
-   return geoip_match(msg, (gparam_t*)str1, (gparam_t*)str2);
+   geoip_pv_reset(pvclass);
+
+   return geoip_update_pv(tomatch, pvclass);
 }
 
-static int geoip_match(struct sip_msg *msg, gparam_t *target, gparam_t *pvname)
+static int w_geoip_match(sip_msg_t* msg, char* target, char* pvname)
 {
-   str tomatch;
-   str pvclass;
+   str tomatch = STR_NULL;
+   str pvclass = STR_NULL;
 
-   if(msg==NULL)
-   {
+   if(msg==NULL) {
LM_ERR("received null msg\n");
return -1;
}
 
-   if(fixup_get_svalue(msg, target, )<0)
-   {
+   if(fixup_get_svalue(msg, (gparam_t*)target, )<0) {
LM_ERR("cannot get the address\n");
return -1;
}
-   if(fixup_get_svalue(msg, pvname, )<0)
-   {
+   if(fixup_get_svalue(msg, (gparam_t*)pvname, )<0) {
LM_ERR("cannot get the pv class\n");
return -1;
}
-   geoip_pv_reset();
 
-   return geoip_update_pv(, );
+   return geoip_match(msg, , );
 }
 
+/**
+ *
+ */
+static sr_kemi_t sr_kemi_geoip_exports[] = {
+{ str_init("geoip"), str_init("match"),
+SR_KEMIP_INT, geoip_match,
+{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+},
+
+{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+
+int mod_register(char *path, int *dlflags, void *p1, void *p2) {
+sr_kemi_modules_add(sr_kemi_geoip_exports);
+return 0;
+}
\ No newline at end of file


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master:6d87794c: ndb_redis: Added REDIS-Cluster support [BETA]

2017-04-18 Thread Daniel-Constantin Mierla
Hi Carsten,


On 18.04.17 12:20, Carsten Bock wrote:
> Hi Daniel,
>
> after some further testing, I have to admit, you are right. However,
> I've noticed another issue with ndb_redis, which is associated with
> this issue: The File-Discriptor is also corrupt, when reconnecting to
> ReDIS (e.g. connection was down or similar), as the new connection is
> done in the child process. I have a setup, where I connect to REDIS
> using stunnel and it happens quite frequently, that I have to
> reconnect.
>
> A workaround for this, is to store the information about the
> connection status in the structure as well. Once I had to reconnect
> (which happens from a child process, so corrupt file descriptors), I
> need to reconnect each time I use REDIS. This is not the nicest
> solution, but solves the issue about corrupt file-descriptors. I've
> had this change running for ~5 days now.

I expect you have to reconnect only once from each child when the redis
server connection structure is in private memory.

Maybe I don't understand exactly what do mean by 'reconnect each time'.
I don't have any experience with redis cluster, but with single redis
server each kamailio worker process needed to reconnect just once.

Cheers,
Daniel

>
> Please let me know your thoughts.
>
> Thanks,
> Carsten
>
>
> 2017-04-04 17:02 GMT+02:00 Daniel-Constantin Mierla <mico...@gmail.com>:
>> Hi Carsten,
>>
>>
>> On 04.04.17 14:43, Carsten Bock wrote:
>>> Hi Daniel,
>>>
>>> i've just noticed, that in one line, I tried to free a reply from
>>> shmem instead of pkgmem (fixed).
>> ok, I see.
>>
>>>  I only put the list of
>>> REDIS-Connections into shmem, so other workers can access (and re-use)
>>> the newly added connections to REDIS.
>> Is this safe? If there is a tcp connection behind and the structure
>> references it via the file descriptor, then it is not going to work for
>> connections opened after kamailio forks the child processes.
>>
>> Cheers,
>> Daniel
>>
>>> Note to myself: I should add some locking to the list
>>>
>>> Thanks,
>>> Carsten
>>>
>>> 2017-04-04 13:11 GMT+02:00 Daniel-Constantin Mierla <mico...@gmail.com>:
>>>> Hello,
>>>>
>>>> I haven't checked the merged version, but if I spotted correctly from
>>>> the patch, it moves the redis response structure in shared memory.
>>>>
>>>> Is is right? If yes, why? Having it in shared memory will create races
>>>> between kamailio processes that store results on same container id --
>>>> one worker can overwrite on data stored by another ine.
>>>>
>>>> Cheers,
>>>> Daniel
>>>>
>>>> On 04.04.17 12:55, Carsten Bock wrote:
>>>>> Module: kamailio
>>>>> Branch: master
>>>>> Commit: 6d87794cac3f6f3bb967d6e0bf6714a4d78f1bd5
>>>>> URL: 
>>>>> https://github.com/kamailio/kamailio/commit/6d87794cac3f6f3bb967d6e0bf6714a4d78f1bd5
>>>>>
>>>>> Author: Carsten Bock <cars...@ng-voice.com>
>>>>> Committer: Carsten Bock <cars...@ng-voice.com>
>>>>> Date: 2017-04-04T12:55:26+02:00
>>>>>
>>>>> ndb_redis: Added REDIS-Cluster support [BETA]
>>>>>
>>>>> ---
>>>>>
>>>>> Modified: src/modules/ndb_redis/doc/ndb_redis.xml
>>>>> Modified: src/modules/ndb_redis/doc/ndb_redis_admin.xml
>>>>> Modified: src/modules/ndb_redis/ndb_redis_mod.c
>>>>> Modified: src/modules/ndb_redis/redis_client.c
>>>>> Modified: src/modules/ndb_redis/redis_client.h
>>>>>
>>>>> ---
>>>>>
>>>>> Diff:  
>>>>> https://github.com/kamailio/kamailio/commit/6d87794cac3f6f3bb967d6e0bf6714a4d78f1bd5.diff
>>>>> Patch: 
>>>>> https://github.com/kamailio/kamailio/commit/6d87794cac3f6f3bb967d6e0bf6714a4d78f1bd5.patch
>>>>>
>>>>>
>>>>> ___
>>>>> sr-dev mailing list
>>>>> sr-...@lists.sip-router.org
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>> --
>>>> Daniel-Constantin Mierla
>>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>>> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
>>>> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>>>>
>>>
>> --
>> Daniel-Constantin Mierla
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
>> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>>
>
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] drouting: use keepalive to monitor GW/destinations (sort_order 0 only) (#1066)

2017-04-19 Thread Daniel-Constantin Mierla
As a remark for the future: do not generate the README file and push it to GIT 
repository for exiting modules. The README is generated on server to get a 
coherent formatting. You can do it locally to check that changes to the docbook 
xml files are ok, then revert README before making the commit/pull request. You 
can use:

```
# generate readme locally
make modules-readme modules=src/modules/mymodules
# see the diffs of the readme
git diff src/modules/mymodule/README
# if all ok, revert it - system remove and git check out
rm src/modules/mymodule/README
git checkout src/modules/mymodule/README
# commit the changes and push 
git commit src/modules/mymodule/
git push origin master:master
```

For this PR I can merge manually, but for the future it is easier to have the 
PR without the patch to README>

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1066#issuecomment-295114558___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:32c5d9dd: pkg/kamailio/centos/7: Add rabbitmq module

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 32c5d9dd9f7a5e02ab428e5c16bf7406e4ff7856
URL: 
https://github.com/kamailio/kamailio/commit/32c5d9dd9f7a5e02ab428e5c16bf7406e4ff7856

Author: Stefan Mititelu <stefan.mitit...@onem.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T16:02:47+02:00

pkg/kamailio/centos/7: Add rabbitmq module

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  
https://github.com/kamailio/kamailio/commit/32c5d9dd9f7a5e02ab428e5c16bf7406e4ff7856.diff
Patch: 
https://github.com/kamailio/kamailio/commit/32c5d9dd9f7a5e02ab428e5c16bf7406e4ff7856.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec 
b/pkg/kamailio/centos/7/kamailio.spec
index 89d887428d..d6410c7e99 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -23,6 +23,7 @@ Conflicts:  kamailio-geoip < %ver, kamailio-gzcompress < %ver
 Conflicts:  kamailio-ims < %ver, kamailio-java < %ver, kamailio-json < %ver
 Conflicts:  kamailio-lcr < %ver, kamailio-ldap < %ver, kamailio-lua < %ver
 Conflicts:  kamailio-kazoo < %ver
+Conflicts:  kamailio-rabbitmq < %ver
 Conflicts:  kamailio-memcached < %ver, kamailio-mysql < %ver
 Conflicts:  kamailio-outbound < %ver, kamailio-perl < %ver
 Conflicts:  kamailio-postgresql < %ver, kamailio-presence < %ver
@@ -235,6 +236,16 @@ BuildRequires:  libuuid-devel, librabbitmq-devel, 
json-c-devel, libevent-devel
 Kazoo module for Kamailio.
 
 
+%packagerabbitmq
+Summary:RabbitMQ related modules
+Group:  System Environment/Daemons
+Requires:   uuid, librabbitmq, kamailio = %ver
+BuildRequires:librabbitmq-devel, uuid-devel
+
+%descriptionrabbitmq
+RabbitMQ module for Kamailio.
+
+
 %packagelcr
 Summary:Least cost routing for Kamailio.
 Group:  System Environment/Daemons
@@ -573,7 +584,7 @@ make every-module skip_modules="app_mono db_cassandra 
db_oracle iptrtpproxy \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo kldap klua kmemcached \
+kkazoo krabbitmq kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -593,7 +604,7 @@ make install-modules-all skip_modules="app_mono 
db_cassandra db_oracle \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo kldap klua kmemcached \
+kkazoo krabbitmq kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -1088,6 +1099,12 @@ fi
 %{_libdir}/kamailio/modules/kazoo.so
 
 
+%files  rabbitmq
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.rabbitmq
+%{_libdir}/kamailio/modules/rabbitmq.so
+
+
 %files  lcr
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.lcr
@@ -1352,6 +1369,8 @@ fi
 %{_libdir}/kamailio/modules/app_sqlang.so
 
 %changelog
+* Mon Jul 31 2017 Mititelu Stefan <stefan.mititel...@gmail.com>
+   - added rabbitmq module
 * Wed Apr 26 2017 Carsten Bock <cars...@ng-voice.co,>
   - added ims_diameter_server module
   - added topos_redis module


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Centos 7 specfile updates (#1194)

2017-07-31 Thread Daniel-Constantin Mierla
Merged #1194.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1194#event-1185812397___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:bc4591f5: pkg/kamailio/centos/7: Remove kamailio-ims module dependency

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: bc4591f54844b7d7a28fa278fe9ee9ff421ba206
URL: 
https://github.com/kamailio/kamailio/commit/bc4591f54844b7d7a28fa278fe9ee9ff421ba206

Author: Stefan Mititelu <stefan.mitit...@onem.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:56:28+02:00

pkg/kamailio/centos/7: Remove kamailio-ims module dependency

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  
https://github.com/kamailio/kamailio/commit/bc4591f54844b7d7a28fa278fe9ee9ff421ba206.diff
Patch: 
https://github.com/kamailio/kamailio/commit/bc4591f54844b7d7a28fa278fe9ee9ff421ba206.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec 
b/pkg/kamailio/centos/7/kamailio.spec
index d6410c7e99..17af5e71c8 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -807,6 +807,10 @@ fi
 %{_libdir}/kamailio/libtrie.so
 %{_libdir}/kamailio/libtrie.so.1
 %{_libdir}/kamailio/libtrie.so.1.0
+%{_libdir}/kamailio/libkamailio_ims.so
+%{_libdir}/kamailio/libkamailio_ims.so.0
+%{_libdir}/kamailio/libkamailio_ims.so.0.1
+
 
 %dir %{_libdir}/kamailio/modules
 %{_libdir}/kamailio/modules/acc.so
@@ -1034,10 +1038,6 @@ fi
 
 %files  ims
 %defattr(-,root,root)
-%{_libdir}/kamailio/libkamailio_ims.so
-%{_libdir}/kamailio/libkamailio_ims.so.0
-%{_libdir}/kamailio/libkamailio_ims.so.0.1
-
 %doc %{_docdir}/kamailio/modules/README.cdp
 %doc %{_docdir}/kamailio/modules/README.cdp_avp
 %doc %{_docdir}/kamailio/modules/README.cfgt


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:9ee303d9: Revert "pkg/kamailio/centos/7: Add rabbitmq module"

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 9ee303d91ee9167759b4a01c2d94fbd646ee41f9
URL: 
https://github.com/kamailio/kamailio/commit/9ee303d91ee9167759b4a01c2d94fbd646ee41f9

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:58:01+02:00

Revert "pkg/kamailio/centos/7: Add rabbitmq module"

This reverts commit f7666ef2ab5ce5e1088728458d76c7e816fbc25c.

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  
https://github.com/kamailio/kamailio/commit/9ee303d91ee9167759b4a01c2d94fbd646ee41f9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9ee303d91ee9167759b4a01c2d94fbd646ee41f9.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec 
b/pkg/kamailio/centos/7/kamailio.spec
index d6410c7e99..89d887428d 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -23,7 +23,6 @@ Conflicts:  kamailio-geoip < %ver, kamailio-gzcompress < %ver
 Conflicts:  kamailio-ims < %ver, kamailio-java < %ver, kamailio-json < %ver
 Conflicts:  kamailio-lcr < %ver, kamailio-ldap < %ver, kamailio-lua < %ver
 Conflicts:  kamailio-kazoo < %ver
-Conflicts:  kamailio-rabbitmq < %ver
 Conflicts:  kamailio-memcached < %ver, kamailio-mysql < %ver
 Conflicts:  kamailio-outbound < %ver, kamailio-perl < %ver
 Conflicts:  kamailio-postgresql < %ver, kamailio-presence < %ver
@@ -236,16 +235,6 @@ BuildRequires:  libuuid-devel, librabbitmq-devel, 
json-c-devel, libevent-devel
 Kazoo module for Kamailio.
 
 
-%packagerabbitmq
-Summary:RabbitMQ related modules
-Group:  System Environment/Daemons
-Requires:   uuid, librabbitmq, kamailio = %ver
-BuildRequires:librabbitmq-devel, uuid-devel
-
-%descriptionrabbitmq
-RabbitMQ module for Kamailio.
-
-
 %packagelcr
 Summary:Least cost routing for Kamailio.
 Group:  System Environment/Daemons
@@ -584,7 +573,7 @@ make every-module skip_modules="app_mono db_cassandra 
db_oracle iptrtpproxy \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo krabbitmq kldap klua kmemcached \
+kkazoo kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -604,7 +593,7 @@ make install-modules-all skip_modules="app_mono 
db_cassandra db_oracle \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo krabbitmq kldap klua kmemcached \
+kkazoo kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -1099,12 +1088,6 @@ fi
 %{_libdir}/kamailio/modules/kazoo.so
 
 
-%files  rabbitmq
-%defattr(-,root,root)
-%doc %{_docdir}/kamailio/modules/README.rabbitmq
-%{_libdir}/kamailio/modules/rabbitmq.so
-
-
 %files  lcr
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.lcr
@@ -1369,8 +1352,6 @@ fi
 %{_libdir}/kamailio/modules/app_sqlang.so
 
 %changelog
-* Mon Jul 31 2017 Mititelu Stefan <stefan.mititel...@gmail.com>
-   - added rabbitmq module
 * Wed Apr 26 2017 Carsten Bock <cars...@ng-voice.co,>
   - added ims_diameter_server module
   - added topos_redis module


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Revert "Centos 7 specfile updates" (#1195)

2017-07-31 Thread Daniel-Constantin Mierla
Reverts kamailio/kamailio#1194
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/1195

-- Commit Summary --

  * Revert "pkg/kamailio/centos/7: Remove kamailio-ims module dependency"
  * Revert "pkg/kamailio/centos/7: Add rabbitmq module"

-- File Changes --

M pkg/kamailio/centos/7/kamailio.spec (31)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1195.patch
https://github.com/kamailio/kamailio/pull/1195.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1195
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Revert "Centos 7 specfile updates" (#1195)

2017-07-31 Thread Daniel-Constantin Mierla
Merged #1195.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1195#event-1185815559___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:5238fe0a: rtpengine: free rtpl if error inside fixup_set_id()

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 5238fe0a5c66cf559bc099bf5e2e0ced42390625
URL: 
https://github.com/kamailio/kamailio/commit/5238fe0a5c66cf559bc099bf5e2e0ced42390625

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

rtpengine: free rtpl if error inside fixup_set_id()

---

Modified: src/modules/rtpengine/rtpengine.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5238fe0a5c66cf559bc099bf5e2e0ced42390625.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5238fe0a5c66cf559bc099bf5e2e0ced42390625.patch

---

diff --git a/src/modules/rtpengine/rtpengine.c 
b/src/modules/rtpengine/rtpengine.c
index d4f45bf7c0..83c56ab826 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -1046,6 +1046,7 @@ static int fixup_set_id(void ** param, int param_no)
int_val = pv_locate_name();
if(int_val<0 || int_val!=s.len) {
LM_ERR("invalid parameter %s\n", s.s);
+   pkg_free(rtpl);
return -1;
}
rtpl->rpv = pv_cache_get();


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Centos 7 specfile updates (#1194)

2017-07-31 Thread Daniel-Constantin Mierla
I am going to apply 054b865 manually, because the second patch (9010d7e) needs 
to be discussed. I rushed initially and merged, but then I noticed that the 
`lib/ims` depends on libxml2, and by moving it into the core kamailio package, 
that one becomes dependent of libxml2. Am I right? If yes, this needs to be 
sorted out in a different way (e.g., make a package kamailio-lib-ims)





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1194#issuecomment-319075752___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:3f96ede6: cplc: init structures, fix parameter number in fixup

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 3f96ede632ce9ef945086a1f384677151209fcc6
URL: 
https://github.com/kamailio/kamailio/commit/3f96ede632ce9ef945086a1f384677151209fcc6

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

cplc: init structures, fix parameter number in fixup

---

Modified: src/modules/cplc/cplc.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3f96ede632ce9ef945086a1f384677151209fcc6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3f96ede632ce9ef945086a1f384677151209fcc6.patch

---

diff --git a/src/modules/cplc/cplc.c b/src/modules/cplc/cplc.c
index cb47ffc4e0..95cf946a83 100644
--- a/src/modules/cplc/cplc.c
+++ b/src/modules/cplc/cplc.c
@@ -203,7 +203,7 @@ static int fixup_cpl_run_script3(void** param, int param_no)
 {
if (param_no==1 || param_no==2) {
return fixup_cpl_run_script(param, param_no);
-   } else if (param_no==2) {
+   } else if (param_no==3) {
return fixup_spve_null(param, 1);
}
return 0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:2f29115d: auth_identity: code clarity adjustments

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 2f29115d8280ccf04ea823d5cf8f6621b8624edc
URL: 
https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

auth_identity: code clarity adjustments

---

Modified: src/modules/auth_identity/auth_hdrs.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc.patch

---

diff --git a/src/modules/auth_identity/auth_hdrs.c 
b/src/modules/auth_identity/auth_hdrs.c
index 0947f5e9a1..24d2ab395f 100644
--- a/src/modules/auth_identity/auth_hdrs.c
+++ b/src/modules/auth_identity/auth_hdrs.c
@@ -471,7 +471,11 @@ int digeststr_asm(dynstr *sout, struct sip_msg *msg, str 
*sdate, int iflags)
LOG(L_ERR, 
"AUTH_IDENTITY:digeststr_asm: DATE header is not found\n");
return -9;
}
+   break;
}
+   if (app2dynstr(sout,))
+   return -10;
+   break;
default:
if (iRes==AUTH_NOTFOUND)
break;
@@ -514,13 +518,14 @@ int append_hf(struct sip_msg* msg, char *str1, enum 
_hdr_types_t type)
 
len=strlen(str1);
 
-   s = (char*)pkg_malloc(len);
+   s = (char*)pkg_malloc(len+1);
if (!s) {
LOG(L_ERR, "AUTH_IDENTITY:append_hf: No memory left\n");
return -1;
}
 
memcpy(s, str1, len);
+   s[len] = '\0';
 
if (insert_new_lump_before(anchor, s, len, type) == 0) {
LOG(L_ERR, "AUTH_IDENTITY:append_hf: Can't insert lump\n");
@@ -643,6 +648,8 @@ static char *auth_get_hf_name(char *begin, char *end, enum 
_hdr_types_t *type)
p += 4;
goto dc_end;
}
+   *type = HDR_OTHER_T;
+   break;
default:
/* compact headers */
switch(LOWER_BYTE(*p)) {
@@ -656,6 +663,8 @@ static char *auth_get_hf_name(char *begin, char *end, enum 
_hdr_types_t *type)
*type = HDR_CONTACT_T;
return (p + 2);
}
+   *type = HDR_OTHER_T;
+   break;
default:
*type = HDR_OTHER_T;
break;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:9a7fee2d: cfgt: check error case for mkdir()

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 9a7fee2dac2f59c277d2634937c7449b9659a20d
URL: 
https://github.com/kamailio/kamailio/commit/9a7fee2dac2f59c277d2634937c7449b9659a20d

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

cfgt: check error case for mkdir()

---

Modified: src/modules/cfgt/cfgt_int.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/9a7fee2dac2f59c277d2634937c7449b9659a20d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9a7fee2dac2f59c277d2634937c7449b9659a20d.patch

---

diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c
index 56292fb1a2..20fcfb0fb8 100644
--- a/src/modules/cfgt/cfgt_int.c
+++ b/src/modules/cfgt/cfgt_int.c
@@ -362,7 +362,10 @@ void cfgt_save_node(cfgt_node_p node)
return;
}
LM_DBG("dir [%s]\n", dest.s);
-   mkdir(dest.s, S_IRWXO|S_IXGRP|S_IRWXU);
+   if(mkdir(dest.s, S_IRWXO|S_IXGRP|S_IRWXU)<0) {
+   LM_ERR("failed to make directory (%d)\n", errno);
+   return;
+   }
dest.s[dir] = '/';
fp = fopen(dest.s, "w");
LM_DBG("file [%s]\n", dest.s);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:f7666ef2: pkg/kamailio/centos/7: Add rabbitmq module

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f7666ef2ab5ce5e1088728458d76c7e816fbc25c
URL: 
https://github.com/kamailio/kamailio/commit/f7666ef2ab5ce5e1088728458d76c7e816fbc25c

Author: Stefan Mititelu <stefan.mitit...@onem.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:56:28+02:00

pkg/kamailio/centos/7: Add rabbitmq module

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  
https://github.com/kamailio/kamailio/commit/f7666ef2ab5ce5e1088728458d76c7e816fbc25c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f7666ef2ab5ce5e1088728458d76c7e816fbc25c.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec 
b/pkg/kamailio/centos/7/kamailio.spec
index 89d887428d..d6410c7e99 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -23,6 +23,7 @@ Conflicts:  kamailio-geoip < %ver, kamailio-gzcompress < %ver
 Conflicts:  kamailio-ims < %ver, kamailio-java < %ver, kamailio-json < %ver
 Conflicts:  kamailio-lcr < %ver, kamailio-ldap < %ver, kamailio-lua < %ver
 Conflicts:  kamailio-kazoo < %ver
+Conflicts:  kamailio-rabbitmq < %ver
 Conflicts:  kamailio-memcached < %ver, kamailio-mysql < %ver
 Conflicts:  kamailio-outbound < %ver, kamailio-perl < %ver
 Conflicts:  kamailio-postgresql < %ver, kamailio-presence < %ver
@@ -235,6 +236,16 @@ BuildRequires:  libuuid-devel, librabbitmq-devel, 
json-c-devel, libevent-devel
 Kazoo module for Kamailio.
 
 
+%packagerabbitmq
+Summary:RabbitMQ related modules
+Group:  System Environment/Daemons
+Requires:   uuid, librabbitmq, kamailio = %ver
+BuildRequires:librabbitmq-devel, uuid-devel
+
+%descriptionrabbitmq
+RabbitMQ module for Kamailio.
+
+
 %packagelcr
 Summary:Least cost routing for Kamailio.
 Group:  System Environment/Daemons
@@ -573,7 +584,7 @@ make every-module skip_modules="app_mono db_cassandra 
db_oracle iptrtpproxy \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo kldap klua kmemcached \
+kkazoo krabbitmq kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -593,7 +604,7 @@ make install-modules-all skip_modules="app_mono 
db_cassandra db_oracle \
 kdnssec \
 %endif
 kgeoip kgzcompress khttp_async kims kjansson kjson kjsonrpcs \
-kkazoo kldap klua kmemcached \
+kkazoo krabbitmq kldap klua kmemcached \
 kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpython \
 kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
 kwebsocket kxml kxmpp kuuid"
@@ -1088,6 +1099,12 @@ fi
 %{_libdir}/kamailio/modules/kazoo.so
 
 
+%files  rabbitmq
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.rabbitmq
+%{_libdir}/kamailio/modules/rabbitmq.so
+
+
 %files  lcr
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.lcr
@@ -1352,6 +1369,8 @@ fi
 %{_libdir}/kamailio/modules/app_sqlang.so
 
 %changelog
+* Mon Jul 31 2017 Mititelu Stefan <stefan.mititel...@gmail.com>
+   - added rabbitmq module
 * Wed Apr 26 2017 Carsten Bock <cars...@ng-voice.co,>
   - added ims_diameter_server module
   - added topos_redis module


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:d2fa6939: pua: free in case of errors

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: d2fa6939e3ba075beb82d173c5d1a7330341c7d0
URL: 
https://github.com/kamailio/kamailio/commit/d2fa6939e3ba075beb82d173c5d1a7330341c7d0

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

pua: free in case of errors

---

Modified: src/modules/pua/add_events.c
Modified: src/modules/pua/send_publish.c
Modified: src/modules/pua/send_subscribe.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d2fa6939e3ba075beb82d173c5d1a7330341c7d0.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d2fa6939e3ba075beb82d173c5d1a7330341c7d0.patch

---

diff --git a/src/modules/pua/add_events.c b/src/modules/pua/add_events.c
index f4a9c8ebed..ce94d5a842 100644
--- a/src/modules/pua/add_events.c
+++ b/src/modules/pua/add_events.c
@@ -150,6 +150,7 @@ int pres_process_body(publ_info_t* publ, str** fin_body, 
int ver, str** tuple_pa
LM_ERR("No more memory\n");
goto error;
}
+   alloc_tuple = 1;
tuple->s= (char*)pkg_malloc(tuple_id_len* sizeof(char));
if(tuple->s== NULL)
{
@@ -160,7 +161,6 @@ int pres_process_body(publ_info_t* publ, str** fin_body, 
int ver, str** tuple_pa
tuple->len= tuple_id_len;
 
*tuple_param= tuple;
-   alloc_tuple= 1;
 
LM_DBG("allocated tuple_id\n\n");
}
@@ -252,12 +252,10 @@ int pres_process_body(publ_info_t* publ, str** fin_body, 
int ver, str** tuple_pa
xmlFreeDoc(doc);
if(body)
pkg_free(body);
-   if(tuple && alloc_tuple)
-   {
+   if(tuple && alloc_tuple) {
if(tuple->s)
pkg_free(tuple->s);
pkg_free(tuple);
-   tuple= NULL;
}
return -1;
 
diff --git a/src/modules/pua/send_publish.c b/src/modules/pua/send_publish.c
index fc5f2f1918..5bd13e0b59 100644
--- a/src/modules/pua/send_publish.c
+++ b/src/modules/pua/send_publish.c
@@ -457,7 +457,7 @@ void publ_cback_func(struct cell *t, int type, struct 
tmcb_params *ps)
return;
 
 error:
-   if(*ps->param)
+   if(ps->param && *ps->param)
{
shm_free(*ps->param);
*ps->param= NULL;
diff --git a/src/modules/pua/send_subscribe.c b/src/modules/pua/send_subscribe.c
index ff1f5bad23..89b597a77a 100644
--- a/src/modules/pua/send_subscribe.c
+++ b/src/modules/pua/send_subscribe.c
@@ -980,6 +980,7 @@ int send_subscribe(subs_info_t* subs)
if(str_hdr== NULL || str_hdr->s== NULL)
{
LM_ERR("while building extra headers\n");
+   if(str_hdr) pkg_free(str_hdr);
return -1;
}
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:fda8de91: ctl: skip condition on already set name variable

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: fda8de91d80a2aee7a3ec5e44e6fc1d918541254
URL: 
https://github.com/kamailio/kamailio/commit/fda8de91d80a2aee7a3ec5e44e6fc1d918541254

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

ctl: skip condition on already set name variable

---

Modified: src/modules/ctl/ctrl_socks.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/fda8de91d80a2aee7a3ec5e44e6fc1d918541254.diff
Patch: 
https://github.com/kamailio/kamailio/commit/fda8de91d80a2aee7a3ec5e44e6fc1d918541254.patch

---

diff --git a/src/modules/ctl/ctrl_socks.c b/src/modules/ctl/ctrl_socks.c
index 9e800a907b..f9d559564b 100644
--- a/src/modules/ctl/ctrl_socks.c
+++ b/src/modules/ctl/ctrl_socks.c
@@ -145,7 +145,7 @@ struct id_list* parse_listen_id(char* l, int len, enum 
socket_protos def)
proto=UDP_SOCK;
DBG("guess:%s is a tcp socket\n", name);
}
-   }else if (name && strchr(name, '/')){
+   }else if (strchr(name, '/')){
switch(def){
case TCP_SOCK:
case UDP_SOCK:


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:44db76ac: cplc: init time switch structures

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 44db76acb7523b3cd6816c77de45b71857b1a3c1
URL: 
https://github.com/kamailio/kamailio/commit/44db76acb7523b3cd6816c77de45b71857b1a3c1

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:54:27+02:00

cplc: init time switch structures

---

Modified: src/modules/cplc/cpl_switches.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/44db76acb7523b3cd6816c77de45b71857b1a3c1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/44db76acb7523b3cd6816c77de45b71857b1a3c1.patch

---

diff --git a/src/modules/cplc/cpl_switches.h b/src/modules/cplc/cpl_switches.h
index 03e9a48ae9..4a99b2cbe4 100644
--- a/src/modules/cplc/cpl_switches.h
+++ b/src/modules/cplc/cpl_switches.h
@@ -686,6 +686,9 @@ static inline char *run_time_switch( struct cpl_interpreter 
*intr )
ac_tm_t att;
tmrec_t trt;
 
+   memset(, 0, sizeof(ac_tm_t));
+   memset(, 0, sizeof(tmrec_t));
+
LM_DBG("checking recv. time stamp <%d>\n",
intr->recv_time);
switch (NR_OF_ATTR(intr->ip)) {


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] cores on stop if TLS is enabled using libssl1.1 ( Debian stretch ) (#1189)

2017-07-31 Thread Daniel-Constantin Mierla
Does it happen every time when stopping kamailio?

I guess I have to try to reproduce it in order to dig in more.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1189#issuecomment-319054320___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:98c4f5e8: Revert "pkg/kamailio/centos/7: Remove kamailio-ims module dependency"

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 98c4f5e8c26f41db6b09547312a049293158cd53
URL: 
https://github.com/kamailio/kamailio/commit/98c4f5e8c26f41db6b09547312a049293158cd53

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T15:58:01+02:00

Revert "pkg/kamailio/centos/7: Remove kamailio-ims module dependency"

This reverts commit bc4591f54844b7d7a28fa278fe9ee9ff421ba206.

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  
https://github.com/kamailio/kamailio/commit/98c4f5e8c26f41db6b09547312a049293158cd53.diff
Patch: 
https://github.com/kamailio/kamailio/commit/98c4f5e8c26f41db6b09547312a049293158cd53.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec 
b/pkg/kamailio/centos/7/kamailio.spec
index 17af5e71c8..d6410c7e99 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -807,10 +807,6 @@ fi
 %{_libdir}/kamailio/libtrie.so
 %{_libdir}/kamailio/libtrie.so.1
 %{_libdir}/kamailio/libtrie.so.1.0
-%{_libdir}/kamailio/libkamailio_ims.so
-%{_libdir}/kamailio/libkamailio_ims.so.0
-%{_libdir}/kamailio/libkamailio_ims.so.0.1
-
 
 %dir %{_libdir}/kamailio/modules
 %{_libdir}/kamailio/modules/acc.so
@@ -1038,6 +1034,10 @@ fi
 
 %files  ims
 %defattr(-,root,root)
+%{_libdir}/kamailio/libkamailio_ims.so
+%{_libdir}/kamailio/libkamailio_ims.so.0
+%{_libdir}/kamailio/libkamailio_ims.so.0.1
+
 %doc %{_docdir}/kamailio/modules/README.cdp
 %doc %{_docdir}/kamailio/modules/README.cdp_avp
 %doc %{_docdir}/kamailio/modules/README.cfgt


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:48c942ac: db_text: free order by fields in case of early stage error in dbt_query()

2017-07-31 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 48c942ac4d20e45f8fdf04aaab9779cab51d1813
URL: 
https://github.com/kamailio/kamailio/commit/48c942ac4d20e45f8fdf04aaab9779cab51d1813

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-07-31T20:24:32+02:00

db_text: free order by fields in case of early stage error in dbt_query()

---

Modified: src/modules/db_text/dbt_base.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/48c942ac4d20e45f8fdf04aaab9779cab51d1813.diff
Patch: 
https://github.com/kamailio/kamailio/commit/48c942ac4d20e45f8fdf04aaab9779cab51d1813.patch

---

diff --git a/src/modules/db_text/dbt_base.c b/src/modules/db_text/dbt_base.c
index 860d16e358..e32f0d88ec 100644
--- a/src/modules/db_text/dbt_base.c
+++ b/src/modules/db_text/dbt_base.c
@@ -197,6 +197,7 @@ int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, 
db_val_t* _v,
if(!_tbc_temp)
{
LM_ERR("unable to allocate temp table\n");
+   if(_o_op) pkg_free(_o_op);
return -1;
}
 
@@ -206,6 +207,7 @@ int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, 
db_val_t* _v,
{
LM_ERR("table %.*s does not exist!\n", CON_TABLE(_h)->len, 
CON_TABLE(_h)->s);
dbt_db_del_table(DBT_CON_CONNECTION(_h), &_tbc_temp->name, 0);
+   if(_o_op) pkg_free(_o_op);
return -1;
}
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] pkg/kamailio: Fixed systemd unit failure on server boot (#1148)

2017-08-01 Thread Daniel-Constantin Mierla
Merged #1148.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1148#event-1187231858___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:af30ab2d: pkg/kamailio: Added systemd unit relanch after non null exit code. Fix of ticket 1085

2017-08-01 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: af30ab2dcd6d67bc86f9ce86be0abf9014cbfd8d
URL: 
https://github.com/kamailio/kamailio/commit/af30ab2dcd6d67bc86f9ce86be0abf9014cbfd8d

Author: Sergey Safarov <s.safa...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-01T10:55:25+02:00

pkg/kamailio: Added systemd unit relanch after non null exit code. Fix of 
ticket 1085

---

Modified: pkg/kamailio/centos/7/kamailio.service
Modified: pkg/kamailio/fedora/17/kamailio.service

---

Diff:  
https://github.com/kamailio/kamailio/commit/af30ab2dcd6d67bc86f9ce86be0abf9014cbfd8d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/af30ab2dcd6d67bc86f9ce86be0abf9014cbfd8d.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.service 
b/pkg/kamailio/centos/7/kamailio.service
index bde8608137..1117e41608 100644
--- a/pkg/kamailio/centos/7/kamailio.service
+++ b/pkg/kamailio/centos/7/kamailio.service
@@ -16,7 +16,7 @@ PIDFile=/run/kamailio/kamailio.pid
 # ExecStart requires a full absolute path
 ExecStart=/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f $CFGFILE -m 
$SHM_MEMORY -M $PKG_MEMORY
 ExecStopPost=/usr/bin/rm -f /run/kamailio/kamailio.pid
-Restart=on-abort
+Restart=on-failure
 User=kamailio
 Group=daemon
 ; For each TCP or TLS endpoint connection is requred file descriptor
diff --git a/pkg/kamailio/fedora/17/kamailio.service 
b/pkg/kamailio/fedora/17/kamailio.service
index 4b2039b818..61457e5fd6 100644
--- a/pkg/kamailio/fedora/17/kamailio.service
+++ b/pkg/kamailio/fedora/17/kamailio.service
@@ -10,7 +10,7 @@ EnvironmentFile=/etc/sysconfig/kamailio
 PIDFile=/var/run/kamailio.pid
 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
 ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
-Restart=on-abort
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.4:d447aca2: pkg/kamailio: Added systemd unit relanch after non null exit code. Fix of ticket 1085

2017-08-01 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 4.4
Commit: d447aca24fef404f0ad5449542c3da615498cb2c
URL: 
https://github.com/kamailio/kamailio/commit/d447aca24fef404f0ad5449542c3da615498cb2c

Author: Sergey Safarov <s.safa...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-01T10:56:29+02:00

pkg/kamailio: Added systemd unit relanch after non null exit code. Fix of 
ticket 1085

---

Modified: pkg/kamailio/centos/7/kamailio.service
Modified: pkg/kamailio/fedora/17/kamailio.service

---

Diff:  
https://github.com/kamailio/kamailio/commit/d447aca24fef404f0ad5449542c3da615498cb2c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d447aca24fef404f0ad5449542c3da615498cb2c.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.service 
b/pkg/kamailio/centos/7/kamailio.service
index 5e4e67a660..9de06c43b0 100644
--- a/pkg/kamailio/centos/7/kamailio.service
+++ b/pkg/kamailio/centos/7/kamailio.service
@@ -14,7 +14,7 @@ PIDFile=/run/kamailio/kamailio.pid
 # ExecStart requires a full absolute path
 ExecStart=/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f $CFGFILE -m 
$SHM_MEMORY -M $PKG_MEMORY
 ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
-Restart=on-abort
+Restart=on-failure
 User=kamailio
 Group=daemon
 ; For each TCP or TLS endpoint connection is requred file descriptor
diff --git a/pkg/kamailio/fedora/17/kamailio.service 
b/pkg/kamailio/fedora/17/kamailio.service
index a8d59b0c0c..2f4ac95df5 100644
--- a/pkg/kamailio/fedora/17/kamailio.service
+++ b/pkg/kamailio/fedora/17/kamailio.service
@@ -8,7 +8,7 @@ EnvironmentFile=/etc/sysconfig/kamailio
 PIDFile=/var/run/kamailio.pid
 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
 ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
-Restart=on-abort
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] pkg/kamailio: Added systemd unit relanch after non null exit code. Fix of ticket 1085 (#1198)

2017-08-01 Thread Daniel-Constantin Mierla
Merged #1198.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1198#event-1187228556___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Fix coverity issues in carrierroute module (#1199)

2017-08-01 Thread Daniel-Constantin Mierla
Merged #1199.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1199#event-1187196148___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Fix coverity issues in carrierroute module (#1199)

2017-08-01 Thread Daniel-Constantin Mierla
Thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1199#issuecomment-319305863___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:e5b8066e: pua_xmpp: init printbuf_len and detect when no uri is provided

2017-08-01 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: e5b8066e1e0f4a69a5d1161dd75aea67014314b5
URL: 
https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-01T08:51:57+02:00

pua_xmpp: init printbuf_len and detect when no uri is provided

---

Modified: src/modules/pua_xmpp/request_winfo.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5.patch

---

diff --git a/src/modules/pua_xmpp/request_winfo.c 
b/src/modules/pua_xmpp/request_winfo.c
index 65964350ae..a79bf1b79f 100644
--- a/src/modules/pua_xmpp/request_winfo.c
+++ b/src/modules/pua_xmpp/request_winfo.c
@@ -38,7 +38,7 @@ int request_winfo(struct sip_msg* msg, char* uri, char* 
expires)
 {
subs_info_t subs;
struct sip_uri puri;
-   int printbuf_len;
+   int printbuf_len = 0;
char buffer[PRINTBUF_SIZE];
str uri_str;
 
@@ -55,13 +55,12 @@ int request_winfo(struct sip_msg* msg, char* uri, char* 
expires)
{
LM_ERR("bad owner SIP address!\n");
goto error;
-   } else
-   {
+   } else {
LM_DBG("using user id [%.*s]\n", printbuf_len,
buffer);
}
} 
-   if(puri.user.len<=0 || puri.user.s==NULL
+   if(printbuf_len == 0 || puri.user.len<=0 || puri.user.s==NULL
|| puri.host.len<=0 || puri.host.s==NULL)
{
LM_ERR("bad owner URI!\n");


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] pkg/kamailio: Fix of ticket 1085 (#1087)

2017-08-01 Thread Daniel-Constantin Mierla
Closing, see the comments for #1086.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1087#issuecomment-319287019___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] cores on stop if TLS is enabled using libssl1.1 ( Debian stretch ) (#1189)

2017-08-02 Thread Daniel-Constantin Mierla
Closed #1189.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1189#event-1189055685___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] cores on stop if TLS is enabled using libssl1.1 ( Debian stretch ) (#1189)

2017-08-02 Thread Daniel-Constantin Mierla
Should be fixed by the commit referenced above. Pushed in 5.0 branch as well.

Reopen if still an issue.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1189#issuecomment-319599284___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] kamctl: fix dangerous 'rm -rf' code in case if variables are not defined (#1200)

2017-08-02 Thread Daniel-Constantin Mierla
Merged #1200.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1200#event-1188977995___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:62f573d4: kamctl: fix dangerous 'rm -rf' code in case if variables are not defined

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 62f573d4ecbbebe5f0f2d3b39be7ad4c2b460e65
URL: 
https://github.com/kamailio/kamailio/commit/62f573d4ecbbebe5f0f2d3b39be7ad4c2b460e65

Author: Alexander Lutay <alu...@sipwise.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-02T09:06:05+02:00

kamctl: fix dangerous 'rm -rf' code in case if variables are not defined

---

Modified: utils/kamctl/kamctl

---

Diff:  
https://github.com/kamailio/kamailio/commit/62f573d4ecbbebe5f0f2d3b39be7ad4c2b460e65.diff
Patch: 
https://github.com/kamailio/kamailio/commit/62f573d4ecbbebe5f0f2d3b39be7ad4c2b460e65.patch

---

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 30d5878482..3aaecbd15a 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -2614,7 +2614,7 @@ tls_ca() {
merr "Failed to create root directory $CA_PATH"
exit 1
fi
-   rm -fr $CA_PATH/*
+   rm -fr "${CA_PATH:?}"/*
mkdir $CA_PATH/private
mkdir $CA_PATH/certs
touch $CA_PATH/index.txt
@@ -2685,7 +2685,7 @@ tls_ca() {
merr "Failed to create user directory $USER_DIR "
exit 1
fi
-   rm -fr $USER_DIR/*
+   rm -fr "${USER_DIR:?}"/*
 
mecho "Creating user certificate request"
openssl req  -config $USER_CFG -out 
$USER_DIR/$USER-cert_req.pem \


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:00eb71da: tls: explicit libssl v1.1+ cleanup when module is destroyed

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 00eb71da83347c9d2ea74feacec9c955f7b2a2e6
URL: 
https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955f7b2a2e6

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-02T09:54:18+02:00

tls: explicit libssl v1.1+ cleanup when module is destroyed

- OPENSSL_cleanup() explicitely executed for libssl v1.1+ when tls
  module is destroyed, to avoid being executed again on final exit
  (due to atexit() callback), because at that moment shared memory
  is already destroyed and attempts to access the locals will result
  in cored dump
- retported by Victor Seva, GH #1189

---

Modified: src/modules/tls/tls_init.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955f7b2a2e6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955f7b2a2e6.patch

---

diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c
index 6d78c37551..054d687e9c 100644
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -847,4 +847,10 @@ void destroy_tls_h(void)
tls_destroy_cfg();
tls_destroy_locks();
tls_ct_wq_destroy();
+#if OPENSSL_VERSION_NUMBER >= 0x01010L
+   /* explicit execution of libssl cleanup to avoid being executed again
+* by atexit(), when shm is gone */
+   DBG("executing openssl v1.1+ cleanup\n");
+   OPENSSL_cleanup();
+#endif
 }


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:5.0:071b85f6: tls: explicit libssl v1.1+ cleanup when module is destroyed

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 5.0
Commit: 071b85f66cabaa3a705a014b26b7c1eb31029b26
URL: 
https://github.com/kamailio/kamailio/commit/071b85f66cabaa3a705a014b26b7c1eb31029b26

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-02T10:02:45+02:00

tls: explicit libssl v1.1+ cleanup when module is destroyed

- OPENSSL_cleanup() explicitely executed for libssl v1.1+ when tls
  module is destroyed, to avoid being executed again on final exit
  (due to atexit() callback), because at that moment shared memory
  is already destroyed and attempts to access the locals will result
  in cored dump
- retported by Victor Seva, GH #1189

(cherry picked from commit 00eb71da83347c9d2ea74feacec9c955f7b2a2e6)

---

Modified: src/modules/tls/tls_init.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/071b85f66cabaa3a705a014b26b7c1eb31029b26.diff
Patch: 
https://github.com/kamailio/kamailio/commit/071b85f66cabaa3a705a014b26b7c1eb31029b26.patch

---

diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c
index 5d977fc810..b12209a0cd 100644
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -778,4 +778,10 @@ void destroy_tls_h(void)
tls_destroy_cfg();
tls_destroy_locks();
tls_ct_wq_destroy();
+#if OPENSSL_VERSION_NUMBER >= 0x01010L
+   /* explicit execution of libssl cleanup to avoid being executed again
+* by atexit(), when shm is gone */
+   DBG("executing openssl v1.1+ cleanup\n");
+   OPENSSL_cleanup();
+#endif
 }


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.4:c5657b73: tls: explicit libssl v1.1+ cleanup when module is destroyed

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: 4.4
Commit: c5657b7386f8be722e3d87c70b9e049d2b843c0d
URL: 
https://github.com/kamailio/kamailio/commit/c5657b7386f8be722e3d87c70b9e049d2b843c0d

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-02T12:56:03+02:00

tls: explicit libssl v1.1+ cleanup when module is destroyed

- OPENSSL_cleanup() explicitely executed for libssl v1.1+ when tls
  module is destroyed, to avoid being executed again on final exit
  (due to atexit() callback), because at that moment shared memory
  is already destroyed and attempts to access the locals will result
  in cored dump
- retported by Victor Seva, GH #1189

(cherry picked from commit 00eb71da83347c9d2ea74feacec9c955f7b2a2e6)
(cherry picked from commit 071b85f66cabaa3a705a014b26b7c1eb31029b26)

---

Modified: modules/tls/tls_init.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c5657b7386f8be722e3d87c70b9e049d2b843c0d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c5657b7386f8be722e3d87c70b9e049d2b843c0d.patch

---

diff --git a/modules/tls/tls_init.c b/modules/tls/tls_init.c
index 133bc7fc83..1ce9d716a5 100644
--- a/modules/tls/tls_init.c
+++ b/modules/tls/tls_init.c
@@ -778,4 +778,10 @@ void destroy_tls_h(void)
tls_destroy_cfg();
tls_destroy_locks();
tls_ct_wq_destroy();
+#if OPENSSL_VERSION_NUMBER >= 0x01010L
+   /* explicit execution of libssl cleanup to avoid being executed again
+* by atexit(), when shm is gone */
+   DBG("executing openssl v1.1+ cleanup\n");
+   OPENSSL_cleanup();
+#endif
 }


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] cores on stop if TLS is enabled using libssl1.1 ( Debian stretch ) (#1189)

2017-08-02 Thread Daniel-Constantin Mierla
@apogrebennyk - pushed to 4.4 branch.

@taurus-forever - thanks, I didn't know they are in a separate apt repo.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1189#issuecomment-319639843___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b5bccd0f: db_text: missing breaks in checking db types compatibility

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b5bccd0f4e14909b4a0ba2ab3957b2ea9b28ed0c
URL: 
https://github.com/kamailio/kamailio/commit/b5bccd0f4e14909b4a0ba2ab3957b2ea9b28ed0c

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-03T05:03:24+02:00

db_text: missing breaks in checking db types compatibility

---

Modified: src/modules/db_text/dbt_lib.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/b5bccd0f4e14909b4a0ba2ab3957b2ea9b28ed0c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b5bccd0f4e14909b4a0ba2ab3957b2ea9b28ed0c.patch

---

diff --git a/src/modules/db_text/dbt_lib.c b/src/modules/db_text/dbt_lib.c
index 3a1ec79eb8..0735c04c2e 100644
--- a/src/modules/db_text/dbt_lib.c
+++ b/src/modules/db_text/dbt_lib.c
@@ -442,30 +442,34 @@ int dbt_is_neq_type(db_type_t _t0, db_type_t _t1)
case DB1_INT:
if(_t0==DB1_DATETIME || _t0==DB1_BITMAP)
return 0;
-
+   break;
case DB1_BIGINT:
LM_ERR("BIGINT not supported\n");
return 0;
-
case DB1_DATETIME:
if(_t0==DB1_INT)
return 0;
if(_t0==DB1_BITMAP)
return 0;
+   break;
case DB1_DOUBLE:
break;
case DB1_STRING:
if(_t0==DB1_STR || _t0==DB1_BLOB)
return 0;
+   break;
case DB1_STR:
if(_t0==DB1_STRING || _t0==DB1_BLOB)
return 0;
+   break;
case DB1_BLOB:
if(_t0==DB1_STR || _t0==DB1_STRING)
return 0;
+   break;
case DB1_BITMAP:
if (_t0==DB1_INT)
return 0;
+   break;
default:
LM_ERR("invalid datatype %d\n", _t1);
return 1;
@@ -483,7 +487,6 @@ dbt_table_p dbt_db_get_temp_table(dbt_cache_p _dc)
int hash;
int hashidx;
 
-
if(!_dbt_cachetbl || !_dc) {
LM_ERR("invalid parameter\n");
return NULL;
@@ -500,8 +503,6 @@ dbt_table_p dbt_db_get_temp_table(dbt_cache_p _dc)
 
_tbc = _dbt_cachetbl[hashidx].dtp;
 
-
-
_tbc = dbt_table_new(&_s, &(_dc->name), NULL);
 
_tbc->hash = hash;
@@ -513,7 +514,6 @@ dbt_table_p dbt_db_get_temp_table(dbt_cache_p _dc)
 
dbt_table_update_flags(_tbc, DBT_TBFL_TEMP, DBT_FL_SET, 0);
 
-
lock_release(&_dbt_cachetbl[hashidx].sem);
return _tbc;
 }


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b05f3637: cplc: safety checks for parameters

2017-08-02 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b05f3637f9cc829470d04037f6f5b88e37819706
URL: 
https://github.com/kamailio/kamailio/commit/b05f3637f9cc829470d04037f6f5b88e37819706

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-03T05:02:41+02:00

cplc: safety checks for parameters

---

Modified: src/modules/cplc/cpl_nonsig.c
Modified: src/modules/cplc/cpl_switches.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/b05f3637f9cc829470d04037f6f5b88e37819706.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b05f3637f9cc829470d04037f6f5b88e37819706.patch

---

diff --git a/src/modules/cplc/cpl_nonsig.c b/src/modules/cplc/cpl_nonsig.c
index d87c02d18f..ba53ee0ab6 100644
--- a/src/modules/cplc/cpl_nonsig.c
+++ b/src/modules/cplc/cpl_nonsig.c
@@ -230,11 +230,18 @@ void cpl_aux_process( int cmd_out, char *log_dir)
LM_ERR("cannot set to IGNORE SIGCHLD signal\n");
}
 
+   file[0] = '\0';
+   file_ptr = file;
/* set the path for logging */
if (log_dir) {
-   strcpy( file, log_dir);
-   file_ptr = file + strlen(log_dir);
-   *(file_ptr++) = '/';
+   if(strlen(log_dir)>=MAX_LOG_DIR_SIZE) {
+   /* fallback */
+   LM_ERR("log dir path is too long, ignoring - check 
workdir\n");
+   } else {
+   strcpy(file, log_dir);
+   file_ptr = file + strlen(log_dir);
+   *(file_ptr++) = '/';
+   }
}
 
while(1) {
diff --git a/src/modules/cplc/cpl_switches.h b/src/modules/cplc/cpl_switches.h
index 4a99b2cbe4..2accfd21b9 100644
--- a/src/modules/cplc/cpl_switches.h
+++ b/src/modules/cplc/cpl_switches.h
@@ -873,6 +873,12 @@ inline static int is_lang_tag_matching(str *range,str 
*cpl_tag,str *cpl_subtag)
str tag = {0,0};
str subtag = {0,0};
 
+   if(range==NULL || cpl_tag==NULL || cpl_subtag==NULL) {
+   return -1;
+   }
+   if(range->s==NULL || cpl_tag->s==NULL || cpl_subtag->s==NULL) {
+   return -1;
+   }
c = range->s;
end = range->s + range->len;
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:2ce57c44: dispatcher: new algorithm - parallel dispatching (12)

2017-08-03 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 2ce57c44fee4eef112163e5dd6c712a0c68c79af
URL: 
https://github.com/kamailio/kamailio/commit/2ce57c44fee4eef112163e5dd6c712a0c68c79af

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-03T19:05:59+02:00

dispatcher: new algorithm - parallel dispatching (12)

- send the request to all destinations from the setid at once
- aka parallel forking to all address, so the AVPs are no longer
set, not being needed for a re-routing

---

Modified: src/modules/dispatcher/dispatch.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2ce57c44fee4eef112163e5dd6c712a0c68c79af.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2ce57c44fee4eef112163e5dd6c712a0c68c79af.patch

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index 90d670d8b7..0acf264618 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -75,6 +75,7 @@
 #define DS_ALG_WEIGHT 9
 #define DS_ALG_CALLLOAD 10
 #define DS_ALG_RELWEIGHT 11
+#define DS_ALG_PARALLEL 12
 
 static int _ds_table_version = DS_TABLE_VERSION;
 
@@ -1693,6 +1694,86 @@ static inline int ds_update_dst(
 /**
  *
  */
+int ds_add_branches(sip_msg_t *msg, ds_set_t *idx, unsigned int hash, int mode)
+{
+   unsigned int i = 0;
+   str ruri = STR_NULL;
+   sip_uri_t *puri = NULL;
+   char buri[MAX_URI_SIZE];
+
+   if(hash+1>=idx->nr) {
+   /* nothing to add */
+   return 0;
+   }
+
+   if(mode==1) {
+   /* ruri updates */
+   LM_DBG("adding branches with ruri\n");
+   if(parse_sip_msg_uri(msg)<0) {
+   LM_ERR("failed to parse sip msg uri\n");
+   return -1;
+   }
+   puri = >parsed_uri;
+   } else {
+   /* duri updates */
+   LM_DBG("adding branches with duri\n");
+   }
+   for(i=hash+1; inr; i++) {
+   if(mode==1) {
+   /* ruri updates */
+   if(puri->user.len<=0) {
+   /* no username to preserve */
+   if(append_branch(msg, >dlist[i].uri, NULL, 
NULL,
+   Q_UNSPECIFIED, 0, 
idx->dlist[i].sock, NULL, 0,
+   NULL, NULL)<0) {
+   LM_ERR("failed to add branch with 
ruri\n");
+   return -1;
+   }
+   } else {
+   /* new uri from ruri username and dispatcher 
uri */
+   if(idx->dlist[i].uri.len<6) {
+   LM_WARN("invalid dispatcher uri - 
skipping (%u)\n", i);
+   continue;
+   }
+   if(strncmp(idx->dlist[i].uri.s, "sips:", 5)==0) 
{
+   ruri.len = snprintf(buri, MAX_URI_SIZE, 
"sips:%.*s@%.*s",
+   puri->user.len, 
puri->user.s,
+   
idx->dlist[i].uri.len-5, idx->dlist[i].uri.s+5);
+   } else {
+   if(strncmp(idx->dlist[i].uri.s, "sip:", 
4)==0) {
+   ruri.len = snprintf(buri, 
MAX_URI_SIZE, "sip:%.*s@%.*s",
+   puri->user.len, 
puri->user.s,
+   
idx->dlist[i].uri.len-4, idx->dlist[i].uri.s+4);
+   } else {
+   LM_WARN("unsupported protocol 
schema - ignoring\n");
+   continue;
+   }
+   }
+   ruri.s = buri;
+   if(append_branch(msg, , NULL, NULL,
+   Q_UNSPECIFIED, 0, 
idx->dlist[i].sock, NULL, 0,
+   NULL, NULL)<0) {
+   LM_ERR("failed to add branch with user 
ruri\n");
+   return -1;
+   }
+   }
+   } else {
+   /* duri updates */
+   if(append_branch(msg, GET_RURI(msg), 
>dlist[i].uri, NULL,
+   Q_UNSPECIFIED, 0, idx->dl

[sr-dev] git:master:e84ee3be: dispatcher: documentation for parallel dispatching algorithm

2017-08-03 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: e84ee3becbf59a5afc63510596cd62bae36d1962
URL: 
https://github.com/kamailio/kamailio/commit/e84ee3becbf59a5afc63510596cd62bae36d1962

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-03T19:05:59+02:00

dispatcher: documentation for parallel dispatching algorithm

---

Modified: src/modules/dispatcher/doc/dispatcher_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/e84ee3becbf59a5afc63510596cd62bae36d1962.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e84ee3becbf59a5afc63510596cd62bae36d1962.patch

---

diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml 
b/src/modules/dispatcher/doc/dispatcher_admin.xml
index b5315acc2d..a0d35eec8a 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1040,6 +1040,14 @@ end



+   12 - dispatch to all destination 
in setid at
+   once (parallel forking). Note that the AVPs are 
no longer set
+   with the values of the destination records, no 
re-routing
+   making sense in this case.
+   
+   
+   
+   
X - if the algorithm is not 
implemented, the
first entry in set is chosen.



___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] loose route cannot be completed when kamailio inserts two Record-Route headers (#1215)

2017-08-15 Thread Daniel-Constantin Mierla
@sergey-safarov I need the pcap file so I investigate it here. A wireshark 
screenshot is not that useful.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1215#issuecomment-322531135___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] topos and dialog timeout conflict (#1216)

2017-08-15 Thread Daniel-Constantin Mierla
Can you test with master branch (your config for 5.0.x should work) and use 
debug=3 in kamailio.cfg? Then attach all logs printed by kamailio when the BYEs 
are sent out.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1216#issuecomment-322536708___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] topos and dialog timeout conflict (#1216)

2017-08-15 Thread Daniel-Constantin Mierla
Are you sure you compile a fully fresh cloned master?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1216#issuecomment-322569964___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] loose route cannot be completed when kamailio inserts two Record-Route headers (#1215)

2017-08-15 Thread Daniel-Constantin Mierla
If you refer the zip from first comment, that has only one side of the call.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1215#issuecomment-322572448___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:893c68d5: pv: implemented {uri.scheme} transformation

2017-08-16 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 893c68d5cbbab35d842aa7275c57d692770e0fff
URL: 
https://github.com/kamailio/kamailio/commit/893c68d5cbbab35d842aa7275c57d692770e0fff

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-16T09:15:03+02:00

pv: implemented {uri.scheme} transformation

- GH #592

---

Modified: src/modules/pv/pv_trans.c
Modified: src/modules/pv/pv_trans.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/893c68d5cbbab35d842aa7275c57d692770e0fff.diff
Patch: 
https://github.com/kamailio/kamailio/commit/893c68d5cbbab35d842aa7275c57d692770e0fff.patch

---

diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index 62574c46f5..eccf3b6377 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -1292,6 +1292,16 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int 
subtype,
val->rs = (_tr_parsed_uri.r2_val.s)?
_tr_parsed_uri.r2_val:_tr_empty;
break;
+   case TR_URI_SCHEME:
+   val->rs.s = _tr_uri.s;
+   val->rs.len = 0;
+   while(val->rs.len<_tr_uri.len) {
+   if(_tr_uri.s[val->rs.len]==':') {
+   break;
+   }
+   val->rs.len++;
+   }
+   break;
default:
LM_ERR("unknown subtype %d\n",
subtype);
@@ -2529,6 +2539,9 @@ char* tr_parse_uri(str* in, trans_t *t)
} else if(name.len==2 && strncasecmp(name.s, "r2", 2)==0) {
t->subtype = TR_URI_R2;
goto done;
+   } else if(name.len==6 && strncasecmp(name.s, "scheme", 6)==0) {
+   t->subtype = TR_URI_SCHEME;
+   goto done;
}
 
LM_ERR("unknown transformation: %.*s/%.*s!\n", in->len,
diff --git a/src/modules/pv/pv_trans.h b/src/modules/pv/pv_trans.h
index 7b7b15fb03..764653e5e3 100644
--- a/src/modules/pv/pv_trans.h
+++ b/src/modules/pv/pv_trans.h
@@ -47,7 +47,7 @@ enum _tr_uri_subtype {
TR_URI_NONE=0, TR_URI_USER, TR_URI_HOST, TR_URI_PASSWD, TR_URI_PORT,
TR_URI_PARAMS, TR_URI_PARAM, TR_URI_HEADERS, TR_URI_TRANSPORT, 
TR_URI_TTL,
TR_URI_UPARAM, TR_URI_MADDR, TR_URI_METHOD, TR_URI_LR,
-   TR_URI_R2
+   TR_URI_R2, TR_URI_SCHEME
 };
 enum _tr_param_subtype {
TR_PL_NONE=0, TR_PL_VALUE, TR_PL_VALUEAT, TR_PL_NAME, TR_PL_COUNT


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Wishlist #234: URI transformation to pick up URI scheme (#592)

2017-08-16 Thread Daniel-Constantin Mierla
Closed #592.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/592#event-1207726682___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] make get_hdr_by_name/next_sibling_hdr_by_name case insensitive (#1217)

2017-08-16 Thread Daniel-Constantin Mierla
Closed #1217.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1217#event-1208015340___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] make get_hdr_by_name/next_sibling_hdr_by_name case insensitive (#1217)

2017-08-16 Thread Daniel-Constantin Mierla
The commit message doesn't have the format required by the contributing guide, 
although you have checked that box. Amend the commit message accordingly:

  * 
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md#commit-message-format

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1217#issuecomment-322730410___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] make get_hdr_by_name/next_sibling_hdr_by_name case insensitive (#1217)

2017-08-16 Thread Daniel-Constantin Mierla
Reopened #1217.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1217#event-1208019817___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] make get_hdr_by_name/next_sibling_hdr_by_name case insensitive (#1217)

2017-08-16 Thread Daniel-Constantin Mierla
See the commit message as it appears in the patch:

  * 
https://github.com/kamailio/kamailio/commit/b84d4a1f09b6310522ac83546a7a34b2c52f0ecf.patch

What you had as Description in PR comment is not in the commit message.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1217#issuecomment-322734361___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] topos and dialog timeout conflict (#1216)

2017-08-16 Thread Daniel-Constantin Mierla
>From the logs, topos doesn't do anything for any of the BYEs (as it should, 
>because they are generated by the server). Can you check if the dialog 
>structures are the same with and without topos? You can dump them via rpc 
>command once the call is answered -- important to see if record route headers 
>are saved.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1216#issuecomment-322781468___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] make get_hdr_by_name/next_sibling_hdr_by_name case insensitive (#1217)

2017-08-16 Thread Daniel-Constantin Mierla
The commit message is the one you give when  doing "git commit ...".

The patch is small, so probably is faster to use the diff 
(https://github.com/kamailio/kamailio/commit/b84d4a1f09b6310522ac83546a7a34b2c52f0ecf.diff),
 make a fresh clone of kamailio repo and do the commit again, with a new PR.

Otherwise, you can search on the web how to amend a commit message, but can 
take some time to sort out when the commit was pushed remote.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1217#issuecomment-322779313___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] loose route cannot be completed when kamailio inserts two Record-Route headers (#1215)

2017-08-16 Thread Daniel-Constantin Mierla
Closed #1215.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1215#event-1208483297___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] loose route cannot be completed when kamailio inserts two Record-Route headers (#1215)

2017-08-16 Thread Daniel-Constantin Mierla
For what so ever reason, the sngrep does not show all the packets, using a bare 
ngrep shows more.

Anyhow, the problem is the caller device or the proxy/alg in between.

By RFC, the R-URI in ACK (and the other requests within dialog) has to be the 
URI from the Contact of 200ok. But there is the address of kamailio, making 
everything look like a strict routing and actually breaking the sip routing.

If you cannot fix the problem in the callee side, then you can try to fix it in 
kamailio, one option is to use htable to store the contact uri from 200ok and 
set it into ACK/re-INVITE/BYE/etc. before doing loose_route().

Overall, this is not an issue with kamailio code. If you need further 
assistance to do a fix via kamailio.cfg, the place to discuss is 
sr-us...@lists.kamailio.cfg

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1215#issuecomment-322803247___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:f8c6ece3: rls: removed unused variable

2017-08-15 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: f8c6ece395a9601499c01f368c645d1d441a1789
URL: 
https://github.com/kamailio/kamailio/commit/f8c6ece395a9601499c01f368c645d1d441a1789

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-15T09:01:50+02:00

rls: removed unused variable

- reported by Juha Heinanen

---

Modified: src/modules/rls/subscribe.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f8c6ece395a9601499c01f368c645d1d441a1789.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f8c6ece395a9601499c01f368c645d1d441a1789.patch

---

diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c
index dc76e4fdba..655a9cde94 100644
--- a/src/modules/rls/subscribe.c
+++ b/src/modules/rls/subscribe.c
@@ -337,7 +337,6 @@ int reply_421(struct sip_msg* msg)
 int reply_200(struct sip_msg* msg, str* contact, int expires)
 {
str hdr_append;
-   int len;
 
hdr_append.s = (char *)pkg_malloc( sizeof(char)*(contact->len+70));
if(hdr_append.s == NULL)


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] unused var in rls/subscribe.c

2017-08-15 Thread Daniel-Constantin Mierla
Fixed, thanks!

Daniel


On 15.08.17 09:00, Juha Heinanen wrote:
> CC (gcc) [M rls.so]   subscribe.o
> subscribe.c: In function 'reply_200':
> subscribe.c:340:6: warning: unused variable 'len' [-Wunused-variable]
>   int len;
>   ^~~
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Bug in subst() function

2017-08-15 Thread Daniel-Constantin Mierla
Can you paste to full incoming INVITE as well as full outgoing INVITE
taken with ngrep (use -W byline)?

Provide also the version for kamailio and details of the operating
system you use.

Cheers,
Daniel


On 05.08.17 00:20, Cléviton Mendes de Araújo wrote:
> Hi fulks
>
>
> I try changing info value in PAI header-field by using subst()
> function into route block as below:
>
>
> route[3]
> {
> ...
> $var(fromU) = ;
> ...
>
> 
> subst('/^P-Asserted-Identity:(.*)sip:[^@]*@([a-zA-Z0-9.:]+)(.*)$/P-Asserted-Identity:\1sip:$var(fromU)@\2\3/ig');
> ...
> ...
> forward();
> exit;
> }
>
> But when I read ngrep command output I catch
> P-Asserted-Identity header as below:
>
> +++
> before route[3] processing:
> INVITE sip:@15.113.132.21:5060
> <http://sip:@15.113.132.21:5060> SIP/2.0.
> ...
> P-Asserted-Identity: "Display Name "
> <sip:@101.14.101.245 <mailto:sip%3A@101.14.101.245>>.
> ...
>
> +++
> after route[3] processing:
> INVITE sip:@15.113.132.21:5060
> <http://sip:@15.113.132.21:5060> SIP/2.0.
> ...
> P-Asserted-Identity: "Display Name "
> <sip:@101.14.101.245
> <mailto:sip%3A@101.14.101.245>>.P-Asserted-Identity:
> "Display Name " <sip:@101.14.101.245
> <mailto:sip%3A@101.14.101.245>>.
> ...
> +++
>
> So, is it normal or bug behaviors?
>
>
>
> Regards
> CMA
>
>
>
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] SIP ping, sockets and multi homed

2017-08-15 Thread Daniel-Constantin Mierla
Hello,

what are the sockets kamailio is listening on? See `kamcmd help` for the
command that lists the sockets.

Also, what is the log messages before the first one you pasted, there
should be another one printed from get_out_socket().

It is always important to provide kamailio version (kamailio -v) and the
operating system you are using.

Cheers,
Daniel

On 14.08.17 14:41, Patrick Wakano wrote:
> Hello Kamailio list,
>
> Hope you all doing well!
>
> I am stuck with one problem that should be incredibly easy to be done,
> but apparently it is not I want my dispatcher, LCR and nathelper
> modules to always SIP ping my SIP clients. I have a Kamailio based SBC
> that is separating two networks, and so I am using the 'mhomed' flag,
> but none of these SIP pings are working for now I will only ask
> about the dispatcher
> My dispatcher module has to talk with SIP servers in both networks,
> the thing is when I enable SIP ping for it (modparam("dispatcher",
> "ds_probing_mode", 1)), it gives me this type of error:
> /usr/sbin/kamailio[6164]: ERROR:  [core/forward.c:181]:
> get_out_socket(): no socket found
> /usr/sbin/kamailio[6164]: ERROR:  [core/forward.c:183]:
> get_out_socket(): no corresponding socket found
> for(udp:192.168.33.110:6060 <http://192.168.33.110:6060>)
> /usr/sbin/kamailio[6164]: ERROR: tm [ut.h:317]: uri2dst2(): no
> corresponding socket found for "192.168.33.110" af 2
> (udp:192.168.33.110:6060 <http://192.168.33.110:6060>)
> /usr/sbin/kamailio[6164]: ERROR: tm [uac.c:443]: t_uac_prepare(): no
> socket found
> /usr/sbin/kamailio[6164]: ERROR: dispatcher [dispatch.c:2652]:
> ds_ping_set(): unable to ping [sip:192.168.33.110:6060
> <http://192.168.33.110:6060>]
>
> After research it seems I need to manually set a "socket" attribute
> for each of my GWs in dispatcher list. After putting the socket
> parameter for the GW, I got another error:
> /usr/sbin/kamailio[14190]: ERROR:  [core/socket_info.c:2046]:
> parse_protohostport(): bad port number in udp:192.168.33.100:5060
> <http://192.168.33.100:5060>
> /usr/sbin/kamailio[14190]: ERROR:  [core/forward.c:181]:
> get_out_socket(): no socket found
> /usr/sbin/kamailio[14190]: ERROR:  [core/forward.c:183]:
> get_out_socket(): no corresponding socket found
> for(udp:192.168.33.110:6060 <http://192.168.33.110:6060>)
> /usr/sbin/kamailio[14190]: ERROR: tm [ut.h:317]: uri2dst2(): no
> corresponding socket found for "192.168.33.110" af 2
> (udp:192.168.33.110:6060 <http://192.168.33.110:6060>)
> /usr/sbin/kamailio[14190]: ERROR: tm [uac.c:443]: t_uac_prepare(): no
> socket found
> /usr/sbin/kamailio[14190]: ERROR: dispatcher [dispatch.c:2652]:
> ds_ping_set(): unable to ping [sip:192.168.33.110:6060
> <http://192.168.33.110:6060>]
>
> What can be wrong in my port info in the socket config? (I tried the
> socket with and without quotes but had no luck...)
> select * from dispatcher where id=2;
>  id | setid |   destination   | flags | priority
> |attrs| description
> +---+-+---+--+-+-
>   2 | 2 | sip:192.168.33.110:6060 <http://192.168.33.110:6060>
> | 0 |0 | socket="udp:192.168.33.100:5060
> <http://192.168.33.100:5060>";rweight=50 |
> (1 row)
>
> Anyhow, I was expecting the 'mhomed' parameter to do the socket
> selection for me. Regular call routing either by the dispatcher or by
> LCR, also seems to require me to explicitly set the socket otherwise
> Kamailio (or the OS) may end up using the wrong socket. So, another
> question is why 'mhomed' does not dictate the whole socket selection
> Kamailio has to do regardless the module it is using to send SIP requests?
>
> Sorry for the long e-mail
> Best regards,
> Patrick Wakano
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b3b95b5b: topos: use INVITE transaction record to route BYE if dlg has no B-contact

2017-08-15 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b3b95b5b701a7f7ebf9532a172cd31b6dca699ff
URL: 
https://github.com/kamailio/kamailio/commit/b3b95b5b701a7f7ebf9532a172cd31b6dca699ff

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-15T09:50:35+02:00

topos: use INVITE transaction record to route BYE if dlg has no B-contact

---

Modified: src/modules/topos/tps_msg.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/b3b95b5b701a7f7ebf9532a172cd31b6dca699ff.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b3b95b5b701a7f7ebf9532a172cd31b6dca699ff.patch

---

diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 22441b5fa9..75b6d02078 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -773,12 +773,25 @@ int tps_request_received(sip_msg_t *msg, int dialog)
}
use_branch = 1;
} else {
-   if(tps_storage_load_dialog(msg, , )<0) {
+   if(tps_storage_load_dialog(msg, , ) < 0) {
goto error;
}
-   /* detect direction - via from-tag */
-   if(tps_dlg_detect_direction(msg, , ) < 0) {
-   goto error;
+   if(((get_cseq(msg)->method_id) & (METHOD_BYE))
+   && stsd.b_contact.len <= 0) {
+   /* BYE but not B-side contact, look for INVITE 
transaction record */
+   memset(, 0, sizeof(tps_data_t));
+   if(tps_storage_link_msg(msg, , TPS_DIR_DOWNSTREAM) 
< 0) {
+   goto error;
+   }
+   if(tps_storage_load_branch(msg, , , 1) < 0) {
+   goto error;
+   }
+   use_branch = 1;
+   } else {
+   /* detect direction - via from-tag */
+   if(tps_dlg_detect_direction(msg, , ) < 
0) {
+   goto error;
+   }
}
}
 


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:219ddbb5: uac: use kam_rand() instead of rand()

2017-08-15 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 219ddbb54bb787a8f0673014c16e749eef40bdf4
URL: 
https://github.com/kamailio/kamailio/commit/219ddbb54bb787a8f0673014c16e749eef40bdf4

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-15T15:48:50+02:00

uac: use kam_rand() instead of rand()

- do kam_srand() when module is initialized

---

Modified: src/modules/uac/uac.c
Modified: src/modules/uac/uac_reg.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/219ddbb54bb787a8f0673014c16e749eef40bdf4.diff
Patch: 
https://github.com/kamailio/kamailio/commit/219ddbb54bb787a8f0673014c16e749eef40bdf4.patch

---

diff --git a/src/modules/uac/uac.c b/src/modules/uac/uac.c
index d5ac59201d..844b6025ff 100644
--- a/src/modules/uac/uac.c
+++ b/src/modules/uac/uac.c
@@ -50,6 +50,7 @@
 #include "../../core/kemi.h"
 #include "../../core/rpc.h"
 #include "../../core/rpc_lookup.h"
+#include "../../core/rand/kam_rand.h"
 #include "../../core/cfg/cfg_struct.h"
 #include "../dialog/dlg_load.h"
 
@@ -305,6 +306,7 @@ static int mod_init(void)
 
if(reg_db_url.s && reg_db_url.len>=0)
{
+   kam_srand(17 * getpid() + time(0));
if(!reg_contact_addr.s || reg_contact_addr.len<=0)
{
LM_ERR("contact address parameter not set\n");
@@ -343,6 +345,9 @@ static int mod_init(void)
 static int child_init(int rank)
 {
int pid;
+
+   kam_srand((11 + rank) * getpid() * 17 +  time(0));
+
if (rank!=PROC_MAIN)
return 0;
 
@@ -361,6 +366,7 @@ static int child_init(int rank)
if (cfg_child_init())
return -1;
 
+   kam_srand(getpid() * 17 +  time(0));
uac_reg_load_db();
uac_reg_timer(0);
for(;;){
diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c
index cb7e4786af..d85d51c6a0 100644
--- a/src/modules/uac/uac_reg.c
+++ b/src/modules/uac/uac_reg.c
@@ -43,6 +43,7 @@
 #include "../../core/parser/contact/parse_contact.h"
 #include "../../core/rpc.h"
 #include "../../core/rpc_lookup.h"
+#include "../../core/rand/kam_rand.h"
 
 #include "../../modules/tm/tm_load.h"
 
@@ -538,7 +539,7 @@ int reg_ht_add(reg_uac_t *reg)
if (reg->reg_delay)
nr->reg_delay = reg->reg_delay;
else if (reg_random_delay>0)
-   nr->reg_delay = rand() % reg_random_delay;
+   nr->reg_delay = kam_rand() % reg_random_delay;
nr->reg_init  = time(NULL);
nr->h_uuid = reg_compute_hash(>l_uuid);
nr->h_user = reg_compute_hash(>l_username);


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master:539a6eef: app_sqlang:

2017-08-15 Thread Daniel-Constantin Mierla
Hello Henning,

for the records, it is no longer required to generate the README when
the xml doc files are updated. Not an issue if done, though, just to
have in mind for the future...

Now there is a job running on kamailio.org server that generates the
READMEs and pushes them to git repository. The commit notification will
be like:

  - https://lists.kamailio.org/pipermail/sr-dev/2017-August/042261.html

This makes the READMEs to have same formatting, and regenerating will
reflect only the content changes, without changing quotes, indentation
styles, etc... that seem to be specific for each OS installation of
docbook tools.

Cheers,
Daniel


On 15.08.17 15:38, Henning Westerholt wrote:
> Module: kamailio
> Branch: master
> Commit: 539a6eefa469a4394f4e6dfbe6a9affba3e2f440
> URL: 
> https://github.com/kamailio/kamailio/commit/539a6eefa469a4394f4e6dfbe6a9affba3e2f440
>
> Author: Henning Westerholt <h...@kamailio.org>
> Committer: Henning Westerholt <h...@kamailio.org>
> Date: 2017-08-15T15:28:02+02:00
>
> app_sqlang:
>
> - fix a few copy and paste errors in the docs (probably from app_jsdt)
> - regenerate README
>
> ---
>
> Modified: src/modules/app_sqlang/README
> Modified: src/modules/app_sqlang/doc/app_sqlang_admin.xml
>
> ---
>
> Diff:  
> https://github.com/kamailio/kamailio/commit/539a6eefa469a4394f4e6dfbe6a9affba3e2f440.diff
> Patch: 
> https://github.com/kamailio/kamailio/commit/539a6eefa469a4394f4e6dfbe6a9affba3e2f440.patch
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

2017-08-15 Thread Daniel-Constantin Mierla
Closed #1098.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1098#event-1206398224___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b44fc529: core: forward - coherent indentation and whitespacing

2017-08-15 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: b44fc5293e343077db0bdea27501fd3aec3dfa11
URL: 
https://github.com/kamailio/kamailio/commit/b44fc5293e343077db0bdea27501fd3aec3dfa11

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-08-15T14:46:48+02:00

core: forward - coherent indentation and whitespacing

---

Modified: src/core/forward.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/b44fc5293e343077db0bdea27501fd3aec3dfa11.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b44fc5293e343077db0bdea27501fd3aec3dfa11.patch


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


  1   2   3   4   5   6   7   8   9   10   >