Re: [sr-dev] [kamailio/kamailio] Segmentation fault when using USRLOC with db_mode=2 (#1231)

2017-09-12 Thread JohnJanke
It may also be worth noting that the same configuration works without issue 
using MySQL, on db_mode = 2.

-- 
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/1231#issuecomment-329002002___
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] Incorrect translation of tel: uri to sip: uri in tel2sip() (#1173)

2017-09-12 Thread Donald Carr
Hey, thank you VERY much Carsten, that is really appreciated. Sorry that I
did not have time to take care of it. Don

On Tue, Sep 12, 2017 at 9:27 AM, ng-voice GmbH 
wrote:

> Hi,
>
> i've reviewed the code and made some minor improvements. I will commit a
> slightly modified version later this week.
>
> Thanks,
> Carsten
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> ,
> or mute the thread
> 
> .
>



-- 
Don W. Carr
5137 Bartlett Dr
The Colony, TX 75056
Mobile: +1-719-424-8504


-- 
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1173#issuecomment-328886336___
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] Segmentation fault when using USRLOC with db_mode=2 (#1231)

2017-09-12 Thread JohnJanke
So I tried db_mode 3 and it worked the first time.  Phones registered and 
USRLOC wrote to the location table successfully.  

Stopped the service and then attempted to start again, and the time-out crash 
occurred.  Tried once more, and it still crashed (however, the segfaults are 
different). 


Crash 1:

Sep 12 09:52:20 vpsl32n011 kernel: [836803.080856] kamailio[8116]: segfault at 
0 ip   (null) sp 7fff1030aa68 error 14 in kamailio[40+42e000]

Crash 2:

Sep 12 09:58:21 vpsl32n011 kernel: [837164.256390] kamailio[8220]: segfault at 
7fdc518b1000 ip 7fdc5740ce3e sp 7fff40f0e118 error 4 in 
libc-2.19.so[7fdc572c5000+1a1000]


Here is syslog for both crashes and core dump for the last one (accidentally 
overwrote the corefile from first). 

[Crash1_Syslog.txt](https://github.com/kamailio/kamailio/files/1296451/Crash1_Syslog.txt)
[Crash2_Core.txt](https://github.com/kamailio/kamailio/files/1296452/Crash2_Core.txt)
[Crash2_Syslog.txt](https://github.com/kamailio/kamailio/files/1296453/Crash2_Syslog.txt)


-- 
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/1231#issuecomment-328885888___
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] Incorrect translation of tel: uri to sip: uri in tel2sip() (#1173)

2017-09-12 Thread ng-voice GmbH
Hi,

i've reviewed the code and made some minor improvements. I will commit a 
slightly modified version later this week.

Thanks,
Carsten

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


[sr-dev] [kamailio/kamailio] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1233)

2017-09-12 Thread hdikme




 Pre-Submission Checklist



- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:

- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description

  While starting kamailio or reloading the routes, if the same carrier/domain 
pairs do not have
  any route with a probability other than 0 (zero) then an error log will be 
printed on the screen.
  Besides, the log "invalid dice_max value" in the cr_func.c has been made more 
clear.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * carrierroute: warning for the same carrier/domain having routes with only 0 
probability

-- File Changes --

M src/modules/carrierroute/cr_db.c (34)
M src/modules/carrierroute/cr_db.h (5)
M src/modules/carrierroute/cr_func.c (2)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1233.patch
https://github.com/kamailio/kamailio/pull/1233.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/1233
___
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] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1233)

2017-09-12 Thread Lucian Balaceanu
Merged #1233.

-- 
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/1233#event-1245345074___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:e04716f4: seas: added guards to several include files

2017-09-12 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: e04716f4f9325fa5290555823132455ea599daac
URL: 
https://github.com/kamailio/kamailio/commit/e04716f4f9325fa5290555823132455ea599daac

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2017-09-12T16:19:36+02:00

seas: added guards to several include files

- bits of formating and removal of inline history

---

Modified: src/modules/seas/cluster.h
Modified: src/modules/seas/encode_allow.h
Modified: src/modules/seas/encode_content_disposition.h
Modified: src/modules/seas/encode_content_length.h
Modified: src/modules/seas/encode_content_type.h
Modified: src/modules/seas/encode_cseq.h
Modified: src/modules/seas/encode_digest.h
Modified: src/modules/seas/seas.c
Modified: src/modules/seas/seas.h
Modified: src/modules/seas/seas_action.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/e04716f4f9325fa5290555823132455ea599daac.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e04716f4f9325fa5290555823132455ea599daac.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] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread Daniel-Constantin Mierla
@hdikme - the comment of @lbalaceanu was on the code of the patch and github 
hides it, you need to press `Show outdated` in the right side of @lbalaceanu's 
comment above here.

-- 
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/1232#issuecomment-328859577___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:81ad6adb: Merge pull request #1233 from hdikme/master

2017-09-12 Thread GitHub
Module: kamailio
Branch: master
Commit: 81ad6adb6456490bce9dfe019c22857713669a52
URL: 
https://github.com/kamailio/kamailio/commit/81ad6adb6456490bce9dfe019c22857713669a52

Author: Lucian Balaceanu 
Committer: GitHub 
Date: 2017-09-12T17:00:38+03:00

Merge pull request #1233 from hdikme/master

carrierroute: warning for the same carrier/domain having routes with only 0 
probability

---

Modified: src/modules/carrierroute/cr_db.c
Modified: src/modules/carrierroute/cr_db.h
Modified: src/modules/carrierroute/cr_func.c

---

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

---

diff --git a/src/modules/carrierroute/cr_db.c b/src/modules/carrierroute/cr_db.c
index d651db1b49..010f99d715 100644
--- a/src/modules/carrierroute/cr_db.c
+++ b/src/modules/carrierroute/cr_db.c
@@ -265,6 +265,7 @@ int load_user_carrier(str * user, str * domain) {
  */
 int load_route_data_db(struct route_data_t * rd) {
db1_res_t * res = NULL;
+   db1_res_t * prob_res = NULL;
db_row_t * row = NULL;
int i, ret;
struct carrier_data_t * tmp_carrier_data;
@@ -352,6 +353,7 @@ int load_route_data_db(struct route_data_t * rd) {
}
}
int n = 0;
+   boolean query_done = false;
do {
LM_DBG("loading, cycle %d", n++);
for (i = 0; i < RES_ROW_N(res); ++i) {
@@ -396,6 +398,35 @@ int load_route_data_db(struct route_data_t * rd) {
p_tmp_comment) == -1) {
goto errout;
}
+   if (row->values[COL_PROB].val.double_val == 0 && 
!query_done) {
+   int ret_tmp;
+   char query_tmp[QUERY_LEN];
+   str query_tmp_str;
+
+   memset(query_tmp, 0, QUERY_LEN);
+   ret_tmp = snprintf(query_tmp, QUERY_LEN, 
"SELECT * FROM %.*s WHERE %.*s=%d and %.*s=%d and %.*s>%d",
+   carrierroute_table.len, 
carrierroute_table.s, columns[COL_CARRIER]->len, columns[COL_CARRIER]->s, 
row->values[COL_CARRIER].val.int_val,
+   columns[COL_DOMAIN]->len, 
columns[COL_DOMAIN]->s, row->values[COL_DOMAIN].val.int_val, 
columns[COL_PROB]->len, columns[COL_PROB]->s, 0);
+
+   if (ret_tmp < 0) {
+   LM_ERR("error in snprintf while 
querying prob column");
+   goto errout;
+   }
+   query_tmp_str.s = query_tmp;
+   query_tmp_str.len = ret_tmp;
+
+   if 
(carrierroute_dbf.raw_query(carrierroute_dbh, &query_tmp_str, &prob_res) < 0) {
+   LM_ERR("Failed to query carrierroute db 
table based on prob column.\n");
+   goto errout;
+   }
+   if(RES_ROW_N(prob_res) == 0) {
+   LM_ERR("Carrierroute db table contains 
route(s) with only 0 probability.\n");
+   query_done = true;
+   }
+   carrierroute_dbf.free_result(carrierroute_dbh, 
prob_res);
+   prob_res = NULL;
+   }
+
}
if (DB_CAPABILITY(carrierroute_dbf, DB_CAP_FETCH)) {
if(carrierroute_dbf.fetch_result(carrierroute_dbh, 
&res,  cfg_get(carrierroute, carrierroute_cfg, fetch_rows)) < 0) {
@@ -462,5 +493,8 @@ int load_route_data_db(struct route_data_t * rd) {
if (res) {
carrierroute_dbf.free_result(carrierroute_dbh, res);
}
+   if (prob_res) {
+   carrierroute_dbf.free_result(carrierroute_dbh, prob_res);
+   }
return -1;
 }
diff --git a/src/modules/carrierroute/cr_db.h b/src/modules/carrierroute/cr_db.h
index 1f53c9307b..ffea731192 100644
--- a/src/modules/carrierroute/cr_db.h
+++ b/src/modules/carrierroute/cr_db.h
@@ -88,4 +88,9 @@ int load_route_data_db (struct route_data_t * rd);
 
 int load_user_carrier(str * user, str * domain);
 
+typedef enum {
+   false = 0,
+   true = 1
+} boolean;
+
 #endif
diff --git a/src/modules/carrierroute/cr_func.c 
b/src/modules/carrierroute/cr_func.c
index 6b6db1387b..c4ce4d52a0 100644
--- a/src/modules/carrierroute/cr_func.c
+++ b/src/modules/carrierroute/cr_func.c
@@ -471,7 +471,7 @@ static int rewrite_on_rule(struct route_flags *rf_head, 
flag_t flags, str * dest
avp_value_t cr_new_uri;
 
if(rf->dice_max == 0) {
-   L

Re: [sr-dev] [kamailio/kamailio] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread hdikme
Closed #1232.

-- 
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/1232#event-1245286133___
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] Incorrect translation of tel: uri to sip: uri in tel2sip() (#1173)

2017-09-12 Thread Donald Carr
Hey, very sorry, I got assigned another project and have not been able to
get back to this. Hopefully I will have some time soon. I think it will be
a good update that will avoid future problems. Don.

On Sun, Sep 3, 2017 at 3:51 AM, Daniel-Constantin Mierla <
notificati...@github.com> wrote:

> Any chance for a PR sometime soon, so this item can be closed here?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> ,
> or mute the thread
> 
> .
>



-- 
Don W. Carr
5137 Bartlett Dr
The Colony, TX 75056
Mobile: +1-719-424-8504


-- 
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1173#issuecomment-328852246___
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] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread hdikme
Following the commit based on your comment, your comment "Please change 
query_done to false here and adapt the code accordingly. The name of the 
variable should reflect the value it holds." disappeared but i have done the 
requested changes.


-- 
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/1232#issuecomment-328848085___
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] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread hdikme
@hdikme pushed 2 commits.

4aaa0af  carrierroute: warning for the same carrier/domain having routes with 
only 0 probability
c275210  Merge branch 'master' of https://github.com/hdikme/kamailio


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/1232/files/0d2a7161454ef36ca3a23083eca1b4245c133e57..c275210836476cd4f94059b26ddf625e89a3d856
___
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] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread Lucian Balaceanu
lbalaceanu commented on this pull request.



> @@ -352,6 +353,7 @@ int load_route_data_db(struct route_data_t * rd) {
}
}
int n = 0;
+   boolean query_done = true;

Please change query_done to false here and adapt the code accordingly. The name 
of the variable should reflect the value it holds.

-- 
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/1232#pullrequestreview-62101949___
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] t_replicate transaction failures keeps transaction in memory forever (#1220)

2017-09-12 Thread Daniel-Constantin Mierla
I couldn't find a reason after looking around, likely something is triggered at 
some point, in certain conditions.

As a workaround, I am considering to add a hard cleanup on timer to the 
transactions that leave too long after lifetime, with a log message to gather 
some useful information for troubleshooting.

If you can still get the output for gdb script on such transactions is still 
useful.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1220#issuecomment-328803937___
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] Segmentation fault when using USRLOC with db_mode=2 (#1231)

2017-09-12 Thread Daniel-Constantin Mierla
db_mode=0 makes usrloc to run without connecting to database. Can you try with 
db_mode=3 to see if there is same crash?

-- 
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/1231#issuecomment-328803278___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] carrierroute: warning for the same carrier/domain having routes with only 0 probability (#1232)

2017-09-12 Thread hdikme




 Pre-Submission Checklist



- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:

- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description

While starting kamailio or reloading the routes, if the same carrier/domain 
pairs do not have
any route with a probability other than 0 (zero) then an error log will be 
printed on the screen.
Besides, the log "invalid dice_max value" in the cr_func.c has been made more 
clear.


You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * carrierroute: warning for the same carrier/domain having routes with only 0 
probability

-- File Changes --

M src/modules/carrierroute/cr_db.c (34)
M src/modules/carrierroute/cr_db.h (5)
M src/modules/carrierroute/cr_func.c (2)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1232.patch
https://github.com/kamailio/kamailio/pull/1232.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/1232
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev