Hello.
I’m trying to count the calls to a specific gateway. So I’m using the dialog module. This route is done before the final relay.
route[CHANNELS] {
if( is_method("INVITE") ) {
if(!isflagset(31) ) {
# user has max channel limit set as preference
if(is_avp_set("$avp(s:channels)") && avp_check("$avp(s:channels)", "gt/s:0")) {
# get current calls for uuid
xlog("L_INFO","[$ci] : avp_channels existe y es mayor que 0 ?");
if (get_profile_size("gws","$rd","$var(calls)")) {
xlog("L_INFO","Actualmente el gateway $rd tiene $var(calls) llamadas simultaneas\n");
}
# check within limit
if($avp(s:channels) > $var(calls)) {
xlog("L_INFO", "CHANNELS : terminador '$rd' tiene '$var(calls)' de '$avp(s:channels)' active
calls before this one\n");
$var(setprofile) = 1;
} else {
xlog("L_INFO", "Call crtl: user channel limit exceeded [$var(calls)/$avp(s:channels)]\n");
send_reply("487", "Request Terminated: Channel limit exceeded");
exit;
}
} else {
xlog("L_INFO","[$ci] : the value if channels is $avp(s:channels)");
if( !is_avp_set("$avp(s:channels)") ) {
xlog("L_INFO","[$ci] : avp_channel not set");
};
if(!avp_check("$avp(s:channels)", "gt/s:0") ) {
xlog("L_INFO","[$ci] : avp_channel menor que 0?");
};
$var(setprofile) = 0;
}
}
if($var(setprofile) > 0) {
* if ( set_dlg_profile("gws","$rd") ) {*
* xlog("L_INFO","set_dlg_profile exitoso");*
}
}
When i made the call and try to see the profile with this command :
[root@sipvoiss kamailio]# kamctl fifo profile_get_size gws 10.0.0.220
profile:: name=gws value=10.0.0.220 count=0
I’m not seeing the call added to the profile, despite the fact I using the * set_dlg_profile("gws","$rd")*
What could be happening?
This is part of the debug :
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] INVITE dominio:10.0.0.208 LOCAL DOMAIN
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:212]: success
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:133]: AVP 'tranum'/0=' sip:02444444444@10.0.0.208 sip%3A02444444444@10.0.0.208'/0 has been added
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:133]: AVP 'channels'/0='2'/0 has been added
Jan 11 18:07:03 .: DEBUG: avpops [avpops_impl.c:1047]: 1 avps were processed
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] INVITE con dominio:10.0.0.208 checks de usuario via avp_radius OK
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] CHECKS SECTION :: INVITE:sip:02444444444@10.0.0.208 INVITE%3Asip%3A02444444444@10.0.0.208checks ok...
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1748]: added matched_gws[0]=[1, 4, 1, 8207736]
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1645]: added gw_uri_avp <1|1|4|550|3700771904||5060||1|0> with weight <8207736>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1911]: r_uri < sip:5504444444@10.0.0.220:5060>, dst_uri <>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2015]: added ruri_user_avp <02444444444>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2050]: added flags_avp <0>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2057]: added defunct_gw_avp <3700771904>
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] Ruta LCR : cambiando sip:02444444444@10.0.0.208 sip%3A02444444444@10.0.0.208 por sip:5504444444@10.0.0.220:5060
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] : entro en ruta 39 de call control
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] : no esta seteado el flag 31
Jan 11 18:07:03 .: DEBUG: avpops [avpops_impl.c:1180]: check <2> against <0> as str /16
Jan 11 18:07:03 .: INFO: <script>: [ 71492292-34f2-a3ed-814e-0002a400d53d@10.0.0.214] : avp_channels existe y es mayor que 0 ?
Jan 11 18:07:03 .: INFO: <script>: Actualmente el gateway 10.0.0.220 tiene 0 llamadas simultaneas
Jan 11 18:07:03 .: INFO: <script>: CHANNELS : terminador '10.0.0.220' tiene '0' de '2' active calls before this one
Jan 11 18:07:03 .: INFO: <script>: set_dlg_profile exitoso
Thanks in advance,
*Regards,*
*Ricardo.-*
Hi Ricardo,
first of all: What version of Kamailio are you using?
On 11.01.2011 22:17, Ricardo Martinez wrote:
I’m trying to count the calls to a specific gateway. So I’m using the dialog module. This route is done before the final relay.
if ( set_dlg_profile("gws","$rd") ) {*
xlog("L_INFO","set_dlg_profile exitoso");*
What could be happening?
Have you set up the profile named "gws" using modparam and "profiles_with_values"?
Have you enabled dialog tracking, either by specifying "dlg_flag" generally or calling dlg_manage() specifically on calls that matter?
Cheers,
--Timo
Hi Timo. I'm using the kamailio versión 3.1.0.
kamailio -V version: kamailio 3.1.0 (x86_64/linux) f2ab4d flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: f2ab4d compiled on 12:57:14 Nov 25 2010 with gcc 4.5.1
The profile gws is a "profile with_values"
# ---- dialog params ------ modparam("dialog", "dlg_flag", 4) modparam("dialog", "profiles_with_value", "gws")
I'm not using the last two parameters that you mention. Could you guide me on how to use them?
Regards, Ricardo.-
-----Mensaje original----- De: Timo Reimann [mailto:timo.reimann@1und1.de] Enviado el: miércoles, 12 de enero de 2011 7:41 Para: Ricardo Martinez CC: sr-users@lists.sip-router.org Asunto: Re: [SR-Users] set_dlg_profile not working?
Hi Ricardo,
first of all: What version of Kamailio are you using?
On 11.01.2011 22:17, Ricardo Martinez wrote:
I’m trying to count the calls to a specific gateway. So I’m using the dialog module. This route is done before the final relay.
if ( set_dlg_profile("gws","$rd") ) {*
xlog("L_INFO","set_dlg_profile
exitoso");*
What could be happening?
Have you set up the profile named "gws" using modparam and "profiles_with_values"?
Have you enabled dialog tracking, either by specifying "dlg_flag" generally or calling dlg_manage() specifically on calls that matter?
Cheers,
--Timo
Hi Ricardo,
On 12.01.2011 13:38, Ricardo Martinez wrote:
I'm using the kamailio versión 3.1.0.
The profile gws is a "profile with_values"
# ---- dialog params ------ modparam("dialog", "dlg_flag", 4) modparam("dialog", "profiles_with_value", "gws")
I'm not using the last two parameters that you mention. Could you guide me on how to use them?
dlg_manage() allows you to track the dialog currently being processed, i.e., on-demand dialog tacking. However, since you have already defined flag 4 as dialog flag, you don't need dlg_manage(): It's supposed to happen automatically for all calls.
This requires enabling the configured flag (4 in your case) though. Have you done so prior to assigning the call to the profile?
Cheers,
--Timo
Timo. I'm asking, because in a previous test with Kamailio 1.5 I never used dlg_manage() and I was sure it was working that time. So.. anyway.. I used dlg_manage() before the "set_dlg_profile("gws","$rd")" and now it is working ok.
If I wanted to do the same but with the flags, how can this be done?
Thanks Ricardo.-
-----Mensaje original----- De: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] En nombre de Timo Reimann Enviado el: miércoles, 12 de enero de 2011 11:11 Para: Ricardo Martinez CC: sr-users@lists.sip-router.org Asunto: Re: [SR-Users] set_dlg_profile not working?
Hi Ricardo,
On 12.01.2011 13:38, Ricardo Martinez wrote:
I'm using the kamailio versión 3.1.0.
The profile gws is a "profile with_values"
# ---- dialog params ------ modparam("dialog", "dlg_flag", 4) modparam("dialog", "profiles_with_value", "gws")
I'm not using the last two parameters that you mention. Could you guide me on how to use them?
dlg_manage() allows you to track the dialog currently being processed, i.e., on-demand dialog tacking. However, since you have already defined flag 4 as dialog flag, you don't need dlg_manage(): It's supposed to happen automatically for all calls.
This requires enabling the configured flag (4 in your case) though. Have you done so prior to assigning the call to the profile?
Cheers,
--Timo
_______________________________________________ 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
Hey,
On 12.01.2011 15:45, Ricardo Martinez wrote:
Timo. I'm asking, because in a previous test with Kamailio 1.5 I never used dlg_manage() and I was sure it was working that time.
It may have worked before because you enabled the dialog flag back then (see below on how to do that).
So.. anyway.. I used dlg_manage() before the "set_dlg_profile("gws","$rd")" and now it is working ok.
If I wanted to do the same but with the flags, how can this be done?
Simply enable the flag that you have specified in the dialog module parameter labeled "dlg_flag" like this:
setflag(4); (It's 4 here because you assigned flag 4 to "dlg_flag").
See also the first paragraph of section 2 in the module documentation
http://sip-router.org/docbook/sip-router/branch/3.1/modules_k/dialog/dialog....
and the description on dlg_manage():
http://sip-router.org/docbook/sip-router/branch/3.1/modules_k/dialog/dialog....
Cheers,
--Timo
-----Mensaje original----- De: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] En nombre de Timo Reimann Enviado el: miércoles, 12 de enero de 2011 11:11 Para: Ricardo Martinez CC: sr-users@lists.sip-router.org Asunto: Re: [SR-Users] set_dlg_profile not working?
Hi Ricardo,
On 12.01.2011 13:38, Ricardo Martinez wrote:
I'm using the kamailio versión 3.1.0.
The profile gws is a "profile with_values"
# ---- dialog params ------ modparam("dialog", "dlg_flag", 4) modparam("dialog", "profiles_with_value", "gws")
I'm not using the last two parameters that you mention. Could you guide me on how to use them?
dlg_manage() allows you to track the dialog currently being processed, i.e., on-demand dialog tacking. However, since you have already defined flag 4 as dialog flag, you don't need dlg_manage(): It's supposed to happen automatically for all calls.
This requires enabling the configured flag (4 in your case) though. Have you done so prior to assigning the call to the profile?
Cheers,
--Timo