[SR-Users] call not being accounted when rejected by global blacklist

Panagiotis Skoulikaritis pskoul at algonet.gr
Thu Apr 15 19:05:44 CEST 2010


Dear Ovidiu

It worked thanks

Panagiotis

Panagiotis Skoulikaritis wrote:
> Dear Ovidiu
>
> Thanks, I will give it a try
>
> Regards
>
> Panagiotis
>
> Ovidiu Sas wrote:
>> You are sending a reply via the sl module and no tm transaction was 
>> created.
>> Accounting is bind to tm (a tm transaction must be created in order to
>> have an acc log).
>>
>> Try to do manual accounting:
>> http://sip-router.org/docbook/sip-router/branch/master/modules_s/acc_syslog/acc_syslog.html#acc_log_request1 
>>
>> http://kamailio.org/docs/modules/stable/modules_k/acc.html#id2850646
>>
>>
>> Regards,
>> Ovidiu Sas
>>
>> 2010/4/15 Panagiotis Skoulikaritis <pskoul at algonet.gr>:
>>  
>>> Dear Lazlo
>>>
>>> I did set a flag for it, in fact I set all flags but it does not write
>>> anything on the mysql or on a log file.
>>>
>>>        if(!check_blacklist("globalblacklist")){
>>>                 xlog("----- The number is blacklisted globaly! -----");
>>>                 sl_send_reply("403", "Forbidden");
>>>                 setflag(1);
>>>                 setflag(2);
>>>                 setflag(3);
>>>                 exit;
>>>        }
>>>
>>> Thanks
>>>
>>> Panagiotis
>>>
>>> Laszlo wrote:
>>>
>>> 2010/4/15 Panagiotis Skoulikaritis <pskoul at algonet.gr>
>>>    
>>>> Dear list members
>>>>
>>>> I'm using kamailio 3
>>>> and the problem that I'm facing is that when a call is rejected by 
>>>> global
>>>> blacklist, kamailio does not generate an accounting record.
>>>> Is this normal behavior or I need to configure something somewhere ?
>>>>
>>>>
>>>> Below are parts of the config file
>>>>
>>>>
>>>> # ----- acc params -----
>>>> modparam("acc", "early_media", 1)
>>>> modparam("acc", "report_ack", 1)
>>>> modparam("acc", "report_cancels", 1)
>>>> modparam("acc", "detect_direction", 0)
>>>> modparam("acc", "failed_transaction_flag", 3)
>>>> #!ifdef WITH_ACCDB
>>>> modparam("acc", "db_flag", 1)
>>>> modparam("acc", "db_missed_flag", 2)
>>>> modparam("acc", "db_url",
>>>>       "mysql://username:password@localhost/openser")
>>>> modparam("acc", "db_extra",
>>>>
>>>> "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd") 
>>>>
>>>> #!endif
>>>>
>>>>
>>>> ----------------------
>>>> if (has_totag()) {
>>>>               # sequential request withing a dialog should
>>>>               # take the path determined by record-routing
>>>>               if (loose_route()) {
>>>>                       if (is_method("BYE")) {
>>>>                               setflag(1); # do accounting ...
>>>>                               setflag(3); # ... even if the 
>>>> transaction
>>>> fails
>>>>                       }
>>>>
>>>> -------------------------
>>>> if (is_method("INVITE")) {
>>>>               setflag(1); # do accounting
>>>>               setflag(2); # log missed calls
>>>>               setflag(3); # log failed calls
>>>>               setflag(4); # do siptrace
>>>>               setflag(5); # log dialog
>>>>
>>>> -------------
>>>> route[name] {
>>>>
>>>> # --- Remove # or %23 from rU ---
>>>>       bm_start_timer("hash_remove");
>>>>       if($rU =~ "^.*%+")            {
>>>> xlog("------- The number contains %23 ---- ");
>>>>               $rU = $(rU{re.subst,/^(.*)%23(.*)/\1\2/});
>>>>               xlog(" ------- The perl  $rU ------- ");
>>>>       }
>>>>       if($rU =~ "^.*#+")            {
>>>> xlog("------- The number contains # ----");
>>>>               $rU = $(rU{re.subst,/^(.*)#(.*)/\1\2/});
>>>>               xlog("------- The perl  $rU ------- ");
>>>>       }         bm_log_timer("hash_remove");
>>>>       # --- PDT section ------ get service prefix to be appended 
>>>> before is
>>>> send  out
>>>>       bm_start_timer("pdt_lookup");
>>>>       if(!prefix2domain("2", "0"))
>>>>       {
>>>>               sl_send_reply("404", "Prefix not found");
>>>>               exit;
>>>>       }
>>>>       $var(dstgrp) = 0;
>>>>       $var(dstgrp) = $(rd{s.int});
>>>>       if($var(dstgrp)==0)
>>>>       {
>>>>               sl_send_reply("404", "Service not found");
>>>>               exit;
>>>>       }
>>>>       $avp(s:service_prefix) = $var(dstgrp);
>>>>       xlog("--$rU----------- $avp(s:service_prefix) --- PDT 
>>>> ---------\n");
>>>>
>>>>       bm_log_timer("pdt_lookup");
>>>>
>>>>       # --- DialPlan section --- get the routing group id
>>>>
>>>>       xlog("----- The rU is $rU before DP -----\n");
>>>>       bm_start_timer("dialplan_lookup");
>>>>       if(dp_translate("1", "$rU/$rU"))
>>>>       {
>>>>               $avp(s:dstgrp) = $(var(dpattrs){s.int});
>>>>               xlog("----- The destination Drouting GroupID is
>>>> $avp(s:dstgrp)  -----\n ");
>>>>       }
>>>>
>>>>       bm_log_timer("dialplan_lookup");
>>>>       xlog("----- The rU is $rU after DP -----\n");
>>>>             # --- Global Blacklist section ---
>>>>       bm_start_timer("blacklist_lookup");
>>>>      if(!check_blacklist("globalblacklist")){
>>>>               xlog("----- The number is blacklisted globaly! -----");
>>>>               sl_send_reply("403", "Forbidden");
>>>>               exit;
>>>>      }
>>>>
>>>>       
>>> ... set a flag for that, as it's just sending the 403 and then exit
>>>
>>> -Laszlo
>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>     
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list