Module: kamailio
Branch: master
Commit: 27bed654dcc4e9dd543a7f2f92e2174478bf7f26
URL: https://github.com/kamailio/kamailio/commit/27bed654dcc4e9dd543a7f2f92e2174…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2015-09-04T15:12:29+02:00
tm: check all the outgoing branches when appending a new branch
---
Modified: modules/tm/t_append_branches.c
---
Diff: https://github.com/kamailio/kamailio/commit/27bed654dcc4e9dd543a7f2f92e2174…
Patch: https://github.com/kamailio/kamailio/commit/27bed654dcc4e9dd543a7f2f92e2174…
---
diff --git a/modules/tm/t_append_branches.c b/modules/tm/t_append_branches.c
index 8060021..f16c672 100644
--- a/modules/tm/t_append_branches.c
+++ b/modules/tm/t_append_branches.c
@@ -23,6 +23,9 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
+ * History:
+ * -------
+ * 2014-09-09 first release of t_append_branches
*
*/
@@ -106,8 +109,6 @@ int t_append_branches(void) {
set_branch_route(t->on_branch_delayed);
}
- outgoings = t->nr_of_outgoings;
-
/* not really sure that the following is needed */
set_branch_iterator(nr_branches-1);
@@ -116,7 +117,7 @@ int t_append_branches(void) {
&bflags, &si, &ruid, &instance, &location_ua))) {
LM_DBG("Current uri %.*s\n",current_uri.len, current_uri.s);
- for (i=0; i<=nr_branches; i++) {
+ for (i=0; i<outgoings; i++) {
if (t->uac[i].ruid.len == ruid.len
&& !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) {
LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s);
@@ -133,6 +134,8 @@ int t_append_branches(void) {
&path, 0, si, orig_msg->fwd_send_flags,
orig_msg->rcv.proto, (dst_uri.len)?-1:UAC_SKIP_BR_DST_F, &instance,
&ruid, &location_ua);
+
+ LM_DBG("added branch [%.*s] with ruid [%.*s]\n", current_uri.len, current_uri.s, ruid.len, ruid.s);
/* test if cancel was received meanwhile */
if (t->flags & T_CANCELED) goto canceled;
Module: kamailio
Branch: 4.3
Commit: 340c40ac4b282c57f20009e987aec26c5877d62e
URL: https://github.com/kamailio/kamailio/commit/340c40ac4b282c57f20009e987aec26…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2015-09-04T15:14:12+02:00
tm: check all the outgoing branches when appending a new branch
(cherry picked from commit 27bed654dcc4e9dd543a7f2f92e2174478bf7f26)
---
Modified: modules/tm/t_append_branches.c
---
Diff: https://github.com/kamailio/kamailio/commit/340c40ac4b282c57f20009e987aec26…
Patch: https://github.com/kamailio/kamailio/commit/340c40ac4b282c57f20009e987aec26…
---
diff --git a/modules/tm/t_append_branches.c b/modules/tm/t_append_branches.c
index 8060021..f16c672 100644
--- a/modules/tm/t_append_branches.c
+++ b/modules/tm/t_append_branches.c
@@ -23,6 +23,9 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
+ * History:
+ * -------
+ * 2014-09-09 first release of t_append_branches
*
*/
@@ -106,8 +109,6 @@ int t_append_branches(void) {
set_branch_route(t->on_branch_delayed);
}
- outgoings = t->nr_of_outgoings;
-
/* not really sure that the following is needed */
set_branch_iterator(nr_branches-1);
@@ -116,7 +117,7 @@ int t_append_branches(void) {
&bflags, &si, &ruid, &instance, &location_ua))) {
LM_DBG("Current uri %.*s\n",current_uri.len, current_uri.s);
- for (i=0; i<=nr_branches; i++) {
+ for (i=0; i<outgoings; i++) {
if (t->uac[i].ruid.len == ruid.len
&& !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) {
LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s);
@@ -133,6 +134,8 @@ int t_append_branches(void) {
&path, 0, si, orig_msg->fwd_send_flags,
orig_msg->rcv.proto, (dst_uri.len)?-1:UAC_SKIP_BR_DST_F, &instance,
&ruid, &location_ua);
+
+ LM_DBG("added branch [%.*s] with ruid [%.*s]\n", current_uri.len, current_uri.s, ruid.len, ruid.s);
/* test if cancel was received meanwhile */
if (t->flags & T_CANCELED) goto canceled;
For some registered users the kamctl ul show subscriber@domain does not find the AOR, however in a full listing it shows up, the ul.lookup rpc method has the same issue.
Kamailio version is 4.3.1
For example, here is a full listing:
```
Domain:: location table=1024 records=4 max_slot=1
AOR:: subscriber1(a)domain.com
Contact:: sip:subscriber1@192.168.1.238:32989;alias=212.2.160.202~37476~1;rinstance=5e040b71a89dace0;transport=UDP Q=
Expires:: 45
Callid:: Q9tQDalSnHzw78gSlpDC6g..
Cseq:: 783
User-agent:: Z 3.7.30891 r30851
Received:: sip:212.2.160.202:37476
Path:: <sip:10.7.0.109;lr;received=sip:212.2.160.202:37476>
State:: CS_NEW
Flags:: 0
Cflag:: 64
Socket:: udp:10.7.0.175:5060
Methods:: 5087
Ruid:: uloc-55b11002-2df0-82a2
Reg-Id:: 0
Last-Keepalive:: 1437721166
Last-Modified:: 1437721166
AOR:: subscriber2(a)domain.com
Contact:: sip:subscriber2@172.16.0.110:5060;alias=78.143.152.30~21183~1 Q=
Expires:: 107
Callid:: 7c5fd25f-c2583f1d63761b4f099e0080f0d14465(a)172.16.0.110
Cseq:: 7
User-agent:: BFH_IE_Panasonic_KX-UT133X/01.278 (0080F0D14465)
Received:: sip:78.143.152.30:21183
Path:: <sip:10.7.0.109;lr;received=sip:78.143.152.30:21183>
State:: CS_NEW
Flags:: 2
Cflag:: 64
Methods:: 6815
Ruid:: uloc-55b10ff9-1f87-45
Reg-Id:: 0
Last-Keepalive:: 1437721228
Last-Modified:: 1437721228
```
if I lookup subscriber1, then kamctl ul show works:
```
# kamctl ul show subscriber1(a)domain.com
Contact:: <sip:subscriber1@192.168.1.238:32989;alias=212.2.160.202~37476~1;rinstance=5e040b71a89dace0;transport=UDP>;q=;expires=21;flags=0x0;cflags=0x40;state=0;socket=<udp:10.7.0.175:5060>;methods=0x13DF;received=<sip:212.2.160.202:37476>;user_agent=<Z 3.7.30891 r30851>;path=<<sip:10.7.0.109;lr;received=sip:212.2.160.202:37476>>;reg-id=0
```
However, if I lookup sibscriber2, then it cannot find it:
```
# kamctl ul show subscriber2(a)domain.com
404 AOR not found
```
I have masked the subscriber information, but if it is of use for you, I can send the actual data directly to you.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/264
Hi,
I was trying to use registered("location", "$ru", 0, 1)
Last parameter is the flag according to
http://kamailio.org/docs/modules/stable/modules/registrar.html#registrar.f.…
flag values is as follows:
1 - set xavp_rcd with value from matched contact
But I'm getting NULL instead of ruid.. While the same works after
lookup("location").
So I took a quick look into the code and that confirms that registered4
does not add the xavp with details of the record (ruid), i.e. it does
not do what the lookup_helper does.
Is this done on purpose or an oversight? While fixing this it might be
reasonable to introduce a new function for setting the XAVPs and call it
from lookup and registered4 functions, especially since we are going to
extend the attributes list beyond just ruid, but right now I'm
struggling just to understanding how the XAVP should be built.. Ideas?
Thanks,
Andrew