Hi all. We use kamailio v.3.3.3 with dispatcher and some nodes:
#pstn gw group
1 sip:10.189.19.1:5060 0 2 weight=80;limit=120,node=sv6 # SV6
1 sip:10.189.19.29:5060 0 1 weight=20;limit=120;node=mr64 # MR64
I use ds_is_from_list:
if (ds_is_from_list("1")) {
route(FROM_PSTN);
};
route[FROM_PSTN] {
xlog("L_INFO","dsattrs: $avp(dsattrs) $avp(i:271) $avp(i:272) $avp(i:273)");
:..
};
Result: INFO: <script>: dsattrs: <null> <null> <null> <null>
My question - Is it possible to get attrs on incoming request from GW ?
Hello,
the feature was implemented in the development version: - http://kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.p....
You will have to backport the patch to your local copy or find another solution (e.g., store ip/port/attrs in address table and use permissions) until the next major release.
Cheers, Daniel
On 8/27/13 9:23 AM, I.Pavlov wrote:
Hi all. We use kamailio v.3.3.3 with dispatcher and some nodes:
#pstn gw group
1 sip:10.189.19.1:5060 0 2 weight=80;limit=120,node=sv6 # SV6
1 sip:10.189.19.29:5060 0 1 weight=20;limit=120;node=mr64 # MR64
I use *ds_is_from_list*:
if (ds_is_from_list("1")) {
route(FROM_PSTN);
};
route[FROM_PSTN] {
xlog("L_INFO","dsattrs: $avp(dsattrs) $avp(i:271) $avp(i:272) $avp(i:273)");
.....
};
Result: *INFO: <script>: dsattrs: <null> <null> <null> <null>*
My question - Is it possible to get attrs on incoming request from GW ?
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks for answer. Could you explain how to backport the patch to my local copy? I want to try.
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla Sent: Tuesday, August 27, 2013 11:38 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] dispatcher, get attrs on incoming request from nodes
Hello,
the feature was implemented in the development version: - http://kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.p. attrs_pvname
You will have to backport the patch to your local copy or find another solution (e.g., store ip/port/attrs in address table and use permissions) until the next major release.
Cheers, Daniel
On 8/27/13 9:23 AM, I.Pavlov wrote:
Hi all. We use kamailio v.3.3.3 with dispatcher and some nodes:
#pstn gw group
1 sip:10.189.19.1:5060 0 2 weight=80;limit=120,node=sv6 # SV6
1 sip:10.189.19.29:5060 0 1 weight=20;limit=120;node=mr64 # MR64
I use ds_is_from_list:
if (ds_is_from_list("1")) {
route(FROM_PSTN);
};
route[FROM_PSTN] {
xlog("L_INFO","dsattrs: $avp(dsattrs) $avp(i:271) $avp(i:272) $avp(i:273)");
...
};
Result: INFO: <script>: dsattrs: <null> <null> <null> <null>
My question - Is it possible to get attrs on incoming request from GW ?
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi,
On 08/27/2013 04:02 AM, I.Pavlov wrote:
Thanks for answer. Could you explain how to backport the patch to my local copy? I want to try.
That depends on how you installed Kamailio. If you cloned the git repository (-b 4.0), that would offer the easiest way to backport the patch. The patch is here:
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commit;h=09a7a4c...
So, on your cloned repo, you just cherry-pick that commit ID from the 'master' branch into your '4.0' branch:
git cherry-pick -x 09a7a4cd718c0e26d3a948515ec4f6f6a68c64c4
Otherwise, you can take the raw diff and apply it to your source tree:
wget -O ~/dispatcher.patch 'http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=patch;h=09a7a4cd...'
cd sip-router/modules/dispatcher
patch -p3 < ~/dispatcher.patch
If successful, that should produce this output:
diminuendo-1:~/sip-router/modules/dispatcher# patch -p3 < ~/dispatcher.patch patching file dispatch.c patching file dispatch.h patching file dispatcher.c
-- Alex
Thanks for answer. As I understand - this patch only for branch 4.0, but we use 3.3.3 now. I will try to find another solution.
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Tuesday, August 27, 2013 12:08 PM To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] dispatcher, get attrs on incoming request from nodes
Hi,
On 08/27/2013 04:02 AM, I.Pavlov wrote:
Thanks for answer. Could you explain how to backport the patch to my local copy? I want to try.
That depends on how you installed Kamailio. If you cloned the git repository (-b 4.0), that would offer the easiest way to backport the patch. The patch is here:
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commit;h=09a7a4c d718c0e26d3a948515ec4f6f6a68c64c4
So, on your cloned repo, you just cherry-pick that commit ID from the 'master' branch into your '4.0' branch:
git cherry-pick -x 09a7a4cd718c0e26d3a948515ec4f6f6a68c64c4
Otherwise, you can take the raw diff and apply it to your source tree:
wget -O ~/dispatcher.patch 'http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=patch;h=09a7a4c d718c0e26d3a948515ec4f6f6a68c64c4'
cd sip-router/modules/dispatcher
patch -p3 < ~/dispatcher.patch
If successful, that should produce this output:
diminuendo-1:~/sip-router/modules/dispatcher# patch -p3 < ~/dispatcher.patch patching file dispatch.c patching file dispatch.h patching file dispatcher.c
-- Alex
Hi,
On 08/27/2013 03:23 AM, I.Pavlov wrote:
route[FROM_PSTN] {
xlog("L_INFO","dsattrs: $avp(dsattrs) $avp(i:271) $avp(i:272) $avp(i:273)");
…..
};
Result: *INFO: <script>: dsattrs: <null> <null> <null> <null>*
My question - Is it possible to get attrs on incoming request from GW ?
This was implemented in the development version, but not in the 4.0 branch. Otherwise, I have the firm impression that these attributes are only accessed when iterating over the gateway using the ds_select_*() functions and a round-robin algorithm.
However, there's nothing stopping you from doing exactly that. Just store the original RURI prior to the loop so that you can revert to it, and the iteration will have no impact (all ds_select_domain() and ds_next_domain() do is change the RURI):
$var(old_ruri) = $ru; $var(found) = 0;
ds_select_domain("1", "4");
if($rd == $si && $rp == $sp) { $var(found) = 1; } else { while(ds_next_domain()) { if($rd == $si && $rp == $sp) { $var(found) = 1; break; } } }
if($var(found) == 1) { xlog("L_INFO","dsattrs: $avp(dsattrs) $avp(i:271) $avp(i:272) $avp(i:273)"); }
$ru = $var(old_ruri);
-- Alex