Re: [sr-dev] acc to db has stopped working

2017-11-09 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> This needs to be fixed to match the docs, but I am not sure where it
> would a better place, inside acc (test if async workers is not set and
> do db sync insert, so a solution specific for acc) or do it inside db
> mysql async insert function (a global behaviour across modules when db
> mysql is used) ... any preference by people here?

If async workers have not been configured for a module feature that
would need them, then Kamailio should fail to start and produce an error
message,

-- Juha

___
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 & dmq_usrloc : let server_address & notification_address use the same IP and port (#1109)

2017-11-09 Thread 张顺通
Closed #1109.

-- 
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/1109#event-1335441719___
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: let server_address & notification_address can use the same IP and port (#1308)

2017-11-09 Thread 张顺通
already set multi_notify modparam.

In four nodes case, ka.ns.com is not resolve to four ip at once.
ka.ns.com resolve to ip1 in first visit, and resolve to ip2 in second visit, 
and so on.
This is DNS action. not kamailio.
Maybe it is not a general usage, DNS should resolve to all four ip.

I realized my problem,  DNS should resolve to all four ip. 
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/1308#issuecomment-343380235___
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: let server_address & notification_address can use the same IP and port (#1308)

2017-11-09 Thread 张顺通
Closed #1308.

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


[sr-dev] Jenkins build is still unstable: kamailiodev-nightly-binaries » amd64,buster,slave #955

2017-11-09 Thread jenkins
See 



___
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:c94fbc25: dmq_usrloc: include server_id in replicated contacts

2017-11-09 Thread Charles Chance
Module: kamailio
Branch: 5.0
Commit: c94fbc25cb5394114611b3360c306387f082fcf1
URL: 
https://github.com/kamailio/kamailio/commit/c94fbc25cb5394114611b3360c306387f082fcf1

Author: Charles Chance 
Committer: Charles Chance 
Date: 2017-11-09T15:28:02Z

dmq_usrloc: include server_id in replicated contacts

---

Modified: src/modules/dmq_usrloc/usrloc_sync.c

---

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

---

diff --git a/src/modules/dmq_usrloc/usrloc_sync.c 
b/src/modules/dmq_usrloc/usrloc_sync.c
index 1ef1382cc5..96000ccafc 100644
--- a/src/modules/dmq_usrloc/usrloc_sync.c
+++ b/src/modules/dmq_usrloc/usrloc_sync.c
@@ -318,12 +318,12 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
static ucontact_info_t ci;
 
unsigned int action, expires, cseq, flags, cflags, q, last_modified,
-methods, reg_id;
+methods, reg_id, server_id;
str aor=STR_NULL, ruid=STR_NULL, c=STR_NULL, received=STR_NULL,
path=STR_NULL, callid=STR_NULL, user_agent=STR_NULL, 
instance=STR_NULL;
 
action = expires = cseq = flags = cflags = q = last_modified
-   = methods = reg_id = 0;
+   = methods = reg_id = server_id = 0;
 
srjson_InitDoc(&jdoc, NULL);
if(parse_from_header(msg)<0) {
@@ -412,6 +412,8 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
methods = SRJSON_GET_UINT(it);
} else if (strcmp(it->string, "reg_id")==0) {
reg_id = SRJSON_GET_UINT(it);
+   } else if (strcmp(it->string, "server_id")==0) {
+   server_id = SRJSON_GET_UINT(it);
} else {
LM_ERR("unrecognized field in json object\n");
}
@@ -432,6 +434,7 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
ci.methods = methods;
ci.instance = instance;
ci.reg_id = reg_id;
+   ci.server_id = server_id;
ci.tcpconn_id = -1;
ci.last_modified = last_modified;
 
@@ -548,6 +551,7 @@ int usrloc_dmq_send_contact(ucontact_t* ptr, str aor, int 
action, dmq_node_t* no
srjson_AddNumberToObject(&jdoc, jdoc.root, "last_modified", 
ptr->last_modified);
srjson_AddNumberToObject(&jdoc, jdoc.root, "methods", ptr->methods);
srjson_AddNumberToObject(&jdoc, jdoc.root, "reg_id", ptr->reg_id);
+   srjson_AddNumberToObject(&jdoc, jdoc.root, "server_id", ptr->server_id);
 
jdoc.buf.s = srjson_PrintUnformatted(&jdoc, jdoc.root);
if(jdoc.buf.s==NULL) {


___
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:93d063ba: usrloc: add more attributes to the result of ul.dump

2017-11-09 Thread Charles Chance
Module: kamailio
Branch: 5.0
Commit: 93d063ba0d278a609c714a62ddbeec33162099b4
URL: 
https://github.com/kamailio/kamailio/commit/93d063ba0d278a609c714a62ddbeec33162099b4

Author: shuntongzhang 
Committer: Charles Chance 
Date: 2017-11-09T15:16:01Z

usrloc: add more attributes to the result of ul.dump

(cherry picked from commit a57465ff47d46fb5d64c692a72f42767598adbb4)

---

Modified: src/modules/usrloc/ul_rpc.c

---

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

---

diff --git a/src/modules/usrloc/ul_rpc.c b/src/modules/usrloc/ul_rpc.c
index 7411be6b93..6133db8acd 100644
--- a/src/modules/usrloc/ul_rpc.c
+++ b/src/modules/usrloc/ul_rpc.c
@@ -180,14 +180,29 @@ int rpc_dump_contact(rpc_t* rpc, void* ctx, void *ih, 
ucontact_t* c)
rpc->fault(ctx, 500, "Internal error adding reg_id");
return -1;
}
+if(rpc->struct_add(vh, "d", "Server-Id", c->server_id)<0)
+   {
+   rpc->fault(ctx, 500, "Internal error adding server_id");
+   return -1;
+   }
+if(rpc->struct_add(vh, "d", "Tcpconn-Id", c->tcpconn_id)<0)
+   {
+   rpc->fault(ctx, 500, "Internal error adding tcpconn_id");
+   return -1;
+   }
+if(rpc->struct_add(vh, "d", "Keepalive", c->keepalive)<0)
+   {
+   rpc->fault(ctx, 500, "Internal error adding keepalive");
+   return -1;
+   }
if(rpc->struct_add(vh, "d", "Last-Keepalive", (int)c->last_keepalive)<0)
{
-   rpc->fault(ctx, 500, "Internal error adding reg_id");
+   rpc->fault(ctx, 500, "Internal error adding last_keepalive");
return -1;
}
if(rpc->struct_add(vh, "d", "Last-Modified", (int)c->last_modified)<0)
{
-   rpc->fault(ctx, 500, "Internal error adding reg_id");
+   rpc->fault(ctx, 500, "Internal error adding last_modified");
return -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] [kamailio/kamailio] usrloc: copy server_id when updating contact in memory (#1309)

2017-11-09 Thread Charles Chance

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

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

-- Commit Summary --

  * usrloc: copy server_id when updating contact in memory

-- File Changes --

M src/modules/usrloc/ucontact.c (1)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1309.patch
https://github.com/kamailio/kamailio/pull/1309.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/1309
___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
Charles thanks, I'll apply the patch and come back to you.

-- 
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/1299#issuecomment-343185320___
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] usrloc: add more attributes to the result of ul.dump (a57465f)

2017-11-09 Thread Charles Chance
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/commit/a57465ff47d46fb5d64c692a72f42767598adbb4#commitcomment-25509582___
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] usrloc: add more attributes to the result of ul.dump (a57465f)

2017-11-09 Thread Daniel-Constantin Mierla
Yes.

-- 
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/commit/a57465ff47d46fb5d64c692a72f42767598adbb4#commitcomment-25509428___
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] usrloc: add more attributes to the result of ul.dump (a57465f)

2017-11-09 Thread Charles Chance
@miconda - am I ok to backport this?

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


[sr-dev] git:master:785a3ccc: tm: run TMCB_RESPONSE_OUT callback only if the response code is still the active one

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2017-11-09T15:54:46+01:00

tm: run TMCB_RESPONSE_OUT callback only if the response code is still the 
active one

---

Modified: src/modules/tm/t_reply.c

---

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

---

diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c
index 7cac44ede2..e6bc4dbff1 100644
--- a/src/modules/tm/t_reply.c
+++ b/src/modules/tm/t_reply.c
@@ -1978,8 +1978,10 @@ enum rps relay_reply( struct cell *t, struct sip_msg 
*p_msg, int branch,
if (unlikely(!totag_retr
&& has_tran_tmcbs(t, 
TMCB_RESPONSE_OUT))){
LOCK_REPLIES( t );
-   run_trans_callbacks_with_buf( 
TMCB_RESPONSE_OUT, uas_rb,
-   t->uas.request, 
relayed_msg, TMCB_NONE_F);
+   
if(relayed_msg->REPLY_STATUS==uas_rb->activ_type) {
+   run_trans_callbacks_with_buf( 
TMCB_RESPONSE_OUT, uas_rb,
+   t->uas.request, 
relayed_msg, TMCB_NONE_F);
+   }
UNLOCK_REPLIES( t );
}
if (unlikely(has_tran_tmcbs(t, 
TMCB_RESPONSE_SENT))){


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


[sr-dev] git:master:33302f87: tm: use define for unset flags of run_trans_callbacks_with_buf()

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2017-11-09T14:55:47+01:00

tm: use define for unset flags of run_trans_callbacks_with_buf()

---

Modified: src/modules/tm/t_append_branches.c
Modified: src/modules/tm/t_fwd.c
Modified: src/modules/tm/t_hooks.h
Modified: src/modules/tm/t_reply.c

---

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

---

diff --git a/src/modules/tm/t_append_branches.c 
b/src/modules/tm/t_append_branches.c
index 9477f8f6b0..7ec2008ffa 100644
--- a/src/modules/tm/t_append_branches.c
+++ b/src/modules/tm/t_append_branches.c
@@ -189,7 +189,7 @@ int t_append_branches(void) {
if (unlikely(has_tran_tmcbs(t, 
TMCB_REQUEST_OUT)))
run_trans_callbacks_with_buf( 
TMCB_REQUEST_OUT,

&t->uac[nr_branches].request,
-   faked_req, 0, 
-orig_msg->REQ_METHOD);
+   faked_req, 0, 
TMCB_NONE_F);
}
else /* new branch added */
added_branches |= 1request )!=0){
LM_CRIT("BUG: retransmission already started for: %p\n",
@@ -1754,7 +1754,7 @@ int t_forward_nonack( struct cell *t, struct sip_msg* 
p_msg,
if (unlikely(has_tran_tmcbs(t, 
TMCB_REQUEST_OUT)))
run_trans_callbacks_with_buf( 
TMCB_REQUEST_OUT,

&t->uac[i].request,
-   p_msg, 0, 
-p_msg->REQ_METHOD);
+   p_msg, 0, 
TMCB_NONE_F);
}
else /* new branch added */
added_branches |= 1uas.request, FAKED_REPLY, 
TMCB_NONE_F);
}
}
cleanup_uac_timers( trans );
@@ -532,7 +532,7 @@ static int _reply_light( struct cell *trans, char* buf, 
unsigned int len,
if (code==100) {
if(unlikely(has_tran_tmcbs(trans, TMCB_REQUEST_PENDING)))
run_trans_callbacks_with_buf(TMCB_REQUEST_PENDING, rb,
-   trans->uas.request, FAKED_REPLY, code);
+   trans->uas.request, FAKED_REPLY, 
TMCB_NONE_F);
}
 
/* send it out */
@@ -1946,7 +1946,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg 
*p_msg, int branch,
if (relay >= 0) {
if (unlikely(!totag_retr && has_tran_tmcbs(t, 
TMCB_RESPONSE_READY))){
run_trans_callbacks_with_buf(TMCB_RESPONSE_READY, 
uas_rb,
-   t->uas.request, relayed_msg, 
relayed_code);
+   t->uas.request, relayed_msg, 
TMCB_NONE_F);
}
/* Set retransmission timer before the reply is sent out to 
avoid
* race conditions
@@ -1979,7 +1979,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg 
*p_msg, int branch,
&& has_tran_tmcbs(t, 
TMCB_RESPONSE_OUT))){
LOCK_REPLIES( t );
run_trans_callbacks_with_buf( 
TMCB_RESPONSE_OUT, uas_rb,
-   t->uas.request, 
relayed_msg, relayed_code);
+   t->uas.request, 
relayed_msg, TMCB_NONE_F);
UNLOCK_REPLIES( t );
}
if (unlikely(has_tran_tmcbs(t, 
TMCB_RESPONSE_SENT))){


___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread Charles Chance
This is because usrloc only stores the server_id on initial insert of a 
contact, not on subsequent updates/refreshes.

The following patch should fix:

[usrloc_5_0_patch.txt](https://github.com/kamailio/kamailio/files/1457907/usrloc_5_0_patch.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/1299#issuecomment-343171972___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
Hmm, just seen one happen now.
```
U 2017/11/09 13:25:56.263541 10.6.0.189:5060 -> 10.7.0.186:5062

OPTIONS sip:example_user@78.143.152.30:59947 SIP/2.0.
Via: SIP/2.0/UDP 10.6.0.189:5060;branch=z9hG4bK5844925.
Route: .
From: sip:keepal...@example.com;tag=uloc-1-5a042966-4d55-1-6821c98a-af4da324.
To: sip:example_user@78.143.152.30:59947.
Call-ID: 8ad70ab7-8e92721-ffcfa07@10.6.0.189.
CSeq: 1 OPTIONS.
Content-Length: 0.
.
```

What looks like happened here is that the server_id is set to 1, but the socket 
is not set, so nathelper is getting the default interface from the os and 
sending the ping on the wrong interface.

Here's the aor on registrar_1:
```
{
  "jsonrpc":  "2.0",
  "result": {
"AoR":  "example_u...@example.com",
"Contacts": [{
"Contact":  {
  "Address":  "sip:example_user@78.143.152.30:59947",
  "Expires":  58,
  "Q":  -1,
  "Call-ID":  "1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X",
  "CSeq": 1288,
  "User-Agent": "BF/IE/KX-HDV430X/06.001/BCC3422AAF2C",
  "Received": "sip:78.143.152.30:59947",
  "Path": "",
  "State":  "CS_NEW",
  "Flags":  2,
  "CFlags": 64,
  "Socket": "[not set]",
  "Methods":  8095,
  "Ruid": "uloc-1-5a042966-4d55-1",
  "Instance": "[not set]",
  "Reg-Id": 0,
  "Server-Id":  1,
  "Tcpconn-Id": -1,
  "Keepalive":  1,
  "Last-Keepalive": 1510233939,
  "Last-Modified":  1510233939
}
  }]
  },
  "id": 20508
}
```

This contact is serviced by registrar_2 and it looks like it has its socket set 
to its local interface, but the server_id is still that of registrar_1 so 
registrar_1 is trying to ping it.

here's the aor on registrar_2 (this one "saved" the location, why is it's 
server_id still 1?).
```
{
  "jsonrpc":  "2.0",
  "result": {
"AoR":  "example_u...@example.com",
"Contacts": [{
"Contact":  {
  "Address":  "sip:example_user@78.143.152.30:59947",
  "Expires":  68,
  "Q":  -1,
  "Call-ID":  "1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X",
  "CSeq": 1290,
  "User-Agent": "BF/IE/KX-HDV430X/06.001/BCC3422AAF2C",
  "Received": "sip:78.143.152.30:59947",
  "Path": "",
  "State":  "CS_NEW",
  "Flags":  0,
  "CFlags": 64,
  "Socket": "udp:10.7.0.190:5060",
  "Methods":  8095,
  "Ruid": "uloc-1-5a042966-4d55-1",
  "Instance": "[not set]",
  "Reg-Id": 0,
  "Server-Id":  1,
  "Tcpconn-Id": -1,
  "Keepalive":  1,
  "Last-Keepalive": 1510234052,
  "Last-Modified":  1510234052
}
  }]
  },
  "id": 20758
}
```

-- 
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/1299#issuecomment-343155712___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
ok, now I can see the server_id in the usrloc dump.

```
{
"Info": {
  "AoR":  "example_u...@example.com",
  "HashID": -1389656423,
  "Contacts": [{
  "Contact":  {
"Address":  
"sip:example_user@212.2.172.228:43356;rinstance=4dc262b9af47682f;transport=UDP",
"Expires":  111,
"Q":  -1,
"Call-ID":  "4HEiFls2hkky2XR6hL8Nrg..",
"CSeq": 86,
"User-Agent": "Z 3.15.40006 rv2.8.20",
"Received": "sip:212.2.172.228:43356",
"Path": 
"",
"State":  "CS_NEW",
"Flags":  2,
"CFlags": 64,
"Socket": "[not set]",
"Methods":  -1,
"Ruid": "uloc-2-5a04296d-4ed0-e1",
"Instance": "[not set]",
"Reg-Id": 0,
"Server-Id":  2,
"Tcpconn-Id": -1,
"Keepalive":  1,
"Last-Keepalive": 1510231303,
"Last-Modified":  1510231303
  }
}]
}
}
```

Let me run this for a while longer and see if I can see any options messages 
being sent on the "wrong" registrar(s). After the update and restart, I 
currently don't see any "incorrect" options messages being sent, which 
indicates, for now, that nathelpers filtering is working as expected.

On a side note, is the aor server_id attribute exposed to $ulc pseudo variable? 
So if I wanted to see which server_id an aor was loaded on I could do a 
reg_fetch_contacts and check the server_id attribute, and if an aor expired, I 
should be able to see the server_id in the "usrloc:contact-expired" event route 
when calling, for example "aor: $ulc(exp=>aor), server_id: $ulc(exp=>server_id)"

-- 
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/1299#issuecomment-343153522___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
ok, i'll re-build with the patch and come back here to update.

-- 
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/1299#issuecomment-343139712___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread Charles Chance
Ok - there were some attributes missing in the usrloc rpc output in 5.0 - 
updated in master, here: 
https://github.com/kamailio/kamailio/commit/a57465ff47d46fb5d64c692a72f42767598adbb4

I have tested and it is fine to apply this patch to 5.0 - please apply and post 
again the output afterwards.


-- 
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/1299#issuecomment-343133562___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
Sure, here is an example of an aor replicated to registrars_1:
```
{
  "jsonrpc":  "2.0",
  "result": {
"AoR":  "example_u...@example.com",
"Contacts": [{
"Contact":  {
  "Address":  
"sip:example_user@212.2.172.228:43356;rinstance=4dc262b9af47682f;transport=UDP",
  "Expires":  98,
  "Q":  -1,
  "Call-ID":  "4HEiFls2hkky2XR6hL8Nrg..",
  "CSeq": 30,
  "User-Agent": "Z 3.15.40006 rv2.8.20",
  "Received": "sip:212.2.172.228:43356",
  "Path": "",
  "State":  "CS_NEW",
  "Flags":  2,
  "CFlags": 64,
  "Socket": "[not set]",
  "Methods":  -1,
  "Ruid": "uloc-2-5a04296d-4ed0-e1",
  "Instance": "[not set]",
  "Reg-Id": 0,
  "Last-Keepalive": 1510227057,
  "Last-Modified":  1510227057
}
  }]
  },
  "id": 20184
}
```
This aor is being serviced by registrar_2 and I can see the server_id being 
sent in the kdmq message to registrar_1, server_id is clearly set to 2:
```
KDMQ sip:usrloc@10.6.0.189:5060 SIP/2.0.
Via: SIP/2.0/UDP 
10.6.0.190;branch=z9hG4bK5568.b7ee8e11.0.
To: .
From: ;tag=21afb82da9b0dd18e43e09ed8956ffc8-9f49.
CSeq: 10 KDMQ.
Call-ID: 1a806e9948d055d0-20402@10.6.0.190.
Content-Length: 514.
User-Agent: kamailio (Registrar 2).
Max-Forwards: 1.
Content-Type: application/json.
.
{"action":1,"aor":"example_u...@example.com","ruid":"uloc-2-5a04296d-4ed0-e1","c":"sip:example_user@212.2.172.228:43356;rinstance=4dc262b9af47682f;transport=UDP","received":"sip:212.2.172.228:43356","path":"","callid":"4HEiFls2hkky2XR6hL8Nrg..","user_agent":"Z
 3.15.40006 
rv2.8.20","instance":"","expires":1510227474,"cseq":34,"flags":0,"cflags":64,"q":-1,"last_modified":1510227361,"methods":4294967295,"reg_id":0,"server_id":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/1299#issuecomment-343129653___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread Charles Chance
I suspect, given that the server_id is not showing in the usrloc dump, this is 
exactly why the server_id filtering is not working.

We need to understand first why server_id is not present, before moving on to 
the keepalives.

I have run a test locally with two registrar nodes (server_ids 1 and 2) and two 
subscribers, each registering to a different node.

Output of ul.dump on one of the nodes:

```
{
Domains: {
Domain: {
Domain: location
Size: 1024
AoRs: {
Info: {
AoR: 123456
HashID: 924664970
Contacts: {
Contact: {
Address: 
sip:123456@10.8.0.151:5066
Expires: 33
Q: -1.00
Call-ID: 
863771482-506...@ba.i.a.bfb
CSeq: 21177
User-Agent: Grandstream 
GXP2160 1.0.5.33
Received: [not set]
Path: [not set]
State: CS_NEW
Flags: 0
CFlags: 0
Socket: [not set]
Methods: 7135
Ruid: 
uloc-1-5a007f47-206b-11
Instance: 

Reg-Id: 4
Server-Id: 1
Tcpconn-Id: -1
Keepalive: 0
Last-Keepalive: 
1510225981
Last-Modified: 
1510225981
}
}
}
Info: {
AoR: 123457
HashID: 924664971
Contacts: {
Contact: {
Address: 
sip:123457@10.8.0.135:5066
Expires: 37
Q: -1.00
Call-ID: 
1296753078-506...@ba.i.a.bdf
CSeq: 2000
User-Agent: Grandstream 
GXP2100 1.0.8.4
Received: [not set]
Path: [not set]
State: CS_NEW
Flags: 0
CFlags: 0
Socket: 
udp:10.28.0.21:5060
Methods: 7135
Ruid: 
uloc-2-5a007f22-17c4-1
Instance: 

Reg-Id: 4
Server-Id: 2
Tcpconn-Id: -1
Keepalive: 0
Last-Keepalive: 
1510225985
Last-Modified: 
1510225985
}
}
}
}
Stats: {
Records: 2
Max-Slots: 1
}
}
}
}
```

As you can see, server_id is present in both contacts and showing the correct 
value(s).

Can you paste the output (or a snippet) of the same command on one of your 
nodes?
 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it o

Re: [sr-dev] [kamailio/kamailio] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
hmm, running this for a while longer and I still see some pings on registrars 
that were replicated to, I have the nathelper server_id filtering enabled now 
too. So there is still something amiss:
nathelper parameter
```
modparam("nathelper", "filter_server_id",   1)
```

Ping being sent from registrar that was replicated to:
```
U 2017/11/09 10:16:50.143477 10.6.0.189:5060 -> 10.7.0.186:5062

OPTIONS sip:example_user@78.143.152.30:59947 SIP/2.0.
Via: SIP/2.0/UDP 10.6.0.189:5060;branch=z9hG4bK1016964.
Route: .
From: sip:keepal...@example.com;tag=uloc-1-5a042966-4d55-1-6821c98a-e1450563.
To: sip:example_user@78.143.152.30:59947.
Call-ID: ad921322-9fd17d71-2782516@10.6.0.189.
CSeq: 1 OPTIONS.
Content-Length: 0.
.
```

Could this be down to the srv_id not showing up in the usrloc database?

-- 
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/1299#issuecomment-343111548___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
No I did not, let me try that quick


-- 
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/1299#issuecomment-343107462___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread Charles Chance
Did you clear the records after setting server_id? It seems usrloc only stores 
server_id on initial insert of a contact, not on subsequent updates/refreshes.

-- 
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/1299#issuecomment-343107285___
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: let server_address & notification_address can use the same IP and port (#1308)

2017-11-09 Thread Charles Chance
Do you have the multi_notify modparam set?

In the special case you mention, why set the notification address at all if 
it’s pointing to itself and you already know this will not be added as a peer?


-- 
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/1308#issuecomment-343106488___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
I'm using memory mode only with dmq/dmq_usrloc replication. I dont see the 
server_id in the AOR dump using either kamctl or kamcmd.

-- 
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/1299#issuecomment-343106370___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread Charles Chance
Which DB mode are you using? Can you see the server_id using `kamcmd ul.dump`?

-- 
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/1299#issuecomment-343104020___
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] v5.0.4: nathelper: dont ping replicated aor's (#1299)

2017-11-09 Thread 00Asgaroth00
I've just updated my test registrars with 5.0.4 with the above patch, I've not 
enabled server_id_filetering in nathelper yet. Is there a way I can see if the 
server_id is being replicated with the aor? Will I be able to see it in the 
usrloc database (kamctl ul show)?

-- 
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/1299#issuecomment-343097779___
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: let server_address & notification_address can use the same IP and port (#1308)

2017-11-09 Thread 张顺通
yes,domain only reolve to itself.

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


Re: [sr-dev] acc to db has stopped working

2017-11-09 Thread Daniel-Constantin Mierla
Indeed, the docs are misleading. The test is on advertised async insert
in db driver and if yes, it is used. If async workers is not set, then
nothing happens in this case (I added a warning in the code for this case).

Sync insert is done if async insert is wanted but not available in the
db driver and this is done in the acc module.

This needs to be fixed to match the docs, but I am not sure where it
would a better place, inside acc (test if async workers is not set and
do db sync insert, so a solution specific for acc) or do it inside db
mysql async insert function (a global behaviour across modules when db
mysql is used) ... any preference by people here?

Cheers,
Daniel


On 08.11.17 12:19, Juha Heinanen wrote:
> Found the reason why db acc had stopped working: I had removed
> async_workers parameter.  Looks like acc module does not insert anything
> if db_insert_mode=2 and there is no async workers.  From README, I get
> the impression that it should be doing standard insert in that case:
>
>   6.28. db_insert_mode (integer)
>
>   If set to 2, async insert is used if the db driver module has support
>   for it and if async_workers core parameter value is greater than 0. If
>   not, then standard INSERT is used.
>
> -- Juha
>
> ___
> 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, Nov 13-15, 2017, in Berlin - 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:4b19cda7: db_mysql: coherent indentation and whitespacing

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2017-11-09T07:03:02+01:00

db_mysql: coherent indentation and whitespacing

---

Modified: src/modules/db_mysql/db_mysql.c
Modified: src/modules/db_mysql/db_mysql.h
Modified: src/modules/db_mysql/km_db_mysql.c
Modified: src/modules/db_mysql/km_db_mysql.h
Modified: src/modules/db_mysql/km_dbase.c
Modified: src/modules/db_mysql/km_dbase.h
Modified: src/modules/db_mysql/km_my_con.h
Modified: src/modules/db_mysql/km_res.c
Modified: src/modules/db_mysql/km_res.h
Modified: src/modules/db_mysql/km_row.c
Modified: src/modules/db_mysql/km_row.h
Modified: src/modules/db_mysql/km_val.c
Modified: src/modules/db_mysql/km_val.h
Modified: src/modules/db_mysql/my_cmd.c
Modified: src/modules/db_mysql/my_cmd.h
Modified: src/modules/db_mysql/my_con.c
Modified: src/modules/db_mysql/my_con.h
Modified: src/modules/db_mysql/my_fld.c
Modified: src/modules/db_mysql/my_fld.h
Modified: src/modules/db_mysql/my_res.c
Modified: src/modules/db_mysql/my_res.h
Modified: src/modules/db_mysql/my_uri.c
Modified: src/modules/db_mysql/my_uri.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/4b19cda766732adc7788b7a5ebcf256c58a35c32.diff
Patch: 
https://github.com/kamailio/kamailio/commit/4b19cda766732adc7788b7a5ebcf256c58a35c32.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:60db119b: core: warning when a task is pushed but no workers

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2017-11-09T06:42:49+01:00

core: warning when a task is pushed but no workers

- helper functions to get the number of workers

---

Modified: src/core/async_task.c
Modified: src/core/async_task.h

---

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

---

diff --git a/src/core/async_task.c b/src/core/async_task.c
index 956bd9ae8b..ab2376a446 100644
--- a/src/core/async_task.c
+++ b/src/core/async_task.c
@@ -53,6 +53,25 @@ int async_task_run(int idx);
 /**
  *
  */
+int async_task_workers_get(void)
+{
+   return _async_task_workers;
+}
+
+/**
+ *
+ */
+int async_task_workers_active(void)
+{
+   if(_async_task_workers<=0)
+   return 0;
+
+   return 1;
+}
+
+/**
+ *
+ */
 int async_task_init_sockets(void)
 {
if (socketpair(PF_UNIX, SOCK_DGRAM, 0, _async_task_sockets) < 0) {
@@ -195,8 +214,10 @@ int async_task_push(async_task_t *task)
 {
int len;
 
-   if(_async_task_workers<=0)
+   if(_async_task_workers<=0) {
+   LM_WARN("async task pushed, but no async workers - ignoring\n");
return 0;
+   }
 
len = write(_async_task_sockets[1], &task, sizeof(async_task_t*));
if(len<=0) {
diff --git a/src/core/async_task.h b/src/core/async_task.h
index 620009b4f6..55c558c30d 100644
--- a/src/core/async_task.h
+++ b/src/core/async_task.h
@@ -37,5 +37,7 @@ int async_task_initialized(void);
 int async_task_set_workers(int n);
 int async_task_push(async_task_t *task);
 int async_task_set_usleep(int n);
+int async_task_workers_get(void);
+int async_task_workers_active(void);
 
 #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] dmq: let server_address & notification_address can use the same IP and port (#1308)

2017-11-09 Thread Charles Chance
‘’’
modparam("dmq", "server_address", "sip:10.6.1.200:5260")
modparam("dmq", "notification_address", "sip:ka.ns.com:5260")
‘’’

^^ this will work just fine as it is, provided ka.ns.com resolves to all four 
nodes - or at least one other than itself.

Why, in your second example, does it only resolve to itself?

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