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

Laszlo laszlo at voipfreak.net
Thu Apr 15 16:06:42 CEST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100415/70bbe63f/attachment.htm>


More information about the sr-users mailing list