[Serusers] Re: Problems with accounting - can't get stop records

Jiri Kuthan jiri at iptel.org
Tue Sep 30 21:51:22 CEST 2003


Indeed, Daniel hit the nail, thanks.

Turning off record-routing as someone proposed previously is not advicable.
Not only subsequent requests, such as BYE, skip the proxy server. Getting
the server out of loop may cause for example failed signaling if both
parties use different signaling protocols and can't speak directly to
each other.

-jiri

At 04:43 PM 9/30/2003, Daniel-Constantin Mierla wrote:
>Hello,
>the BYEs were not accounted because the next piece of configuration file:
>
>   if (loose_route()) {
>        t_relay();
>        break;
>   };
>
>
>BYEs are subsequent requests within a dialog and they include at least a Route header and loose_route() returns true if no error occurs during processing the top most. In the above piece of configuration after the loose routing processing the request is forwarded to the next hope -- the one from Route header -- without setting any flag for accounting. You have to set it before t_relay(), e.g.,:
>
>   if (loose_route()) {
>        if (method=="BYE" | ...){
>            log (1, "Accounting flag on\n");
>            setflag(1);
>        };
>        t_relay();
>        break;
>   };
>
>
>Daniel
>
>
>
>On 9/30/2003 4:19 PM, Steven R. Bunin wrote:
>
>>Jaime,
>>
>>Thanks for the config. I managed to get it working yesterday by playing with it
>>quite a bit. What I ended up doing was moving my if (method=="bye") {}  statements
>>to be the first thing after route { . I don't know what this worked but it works
>>even with loose_route() enabled. If you want a copy of my config just let me know
>>and I will send it out.
>>
>>Steve
>>
>>jaime.gil at orange.co.uk wrote:
>>
>> 
>>
>>>Steven,
>>>
>>>This was the config used:
>>>
>>>#
>>># $Id: ser.cfg,v 1.21 2003/06/04 13:47:36 jiri Exp $
>>>#
>>># simple quick-start config script
>>>#
>>>
>>># ----------- global configuration parameters ------------------------
>>>
>>>debug=3         # debug level (cmd line: -dddddddddd)
>>>fork=no
>>>log_stderror=yes    # (cmd line: -E)
>>>
>>>/* Uncomment these lines to enter debugging mode
>>>debug=7
>>>fork=no
>>>log_stderror=yes
>>>*/
>>>
>>>check_via=no   # (cmd. line: -v)
>>>dns=no           # (cmd. line: -r)
>>>rev_dns=no      # (cmd. line: -R)
>>>port=5060
>>>children=4
>>>fifo="/tmp/ser_fifo"
>>>
>>># ------------------ module loading ----------------------------------
>>>
>>># Uncomment this if you want to use SQL database
>>>loadmodule "./modules/mysql/mysql.so"
>>>
>>>loadmodule "./modules/sl/sl.so"
>>>loadmodule "./modules/tm/tm.so"
>>>loadmodule "./modules/rr/rr.so"
>>>loadmodule "./modules/maxfwd/maxfwd.so"
>>>loadmodule "./modules/usrloc/usrloc.so"
>>>loadmodule "./modules/registrar/registrar.so"
>>>loadmodule "./modules/uri/uri.so"
>>>
>>># Uncomment this if you want digest authentication
>>># mysql.so must be loaded !
>>>loadmodule "./modules/auth/auth.so"
>>>loadmodule "./modules/auth_db/auth_db.so"
>>>
>>>loadmodule "modules/acc/acc.so"
>>>
>>>loadmodule "./modules/auth_radius/auth_radius.so"
>>>
>>># ----------------- setting module-specific parameters ---------------
>>>
>>># -- usrloc params --
>>>
>>>modparam("usrloc", "db_mode",   2)
>>>
>>>modparam("auth_radius", "radius_config",
>>>"/usr/local/etc/radiusclient/radiusclient.conf")
>>>
>>># -- rr params --
>>># add value to ;lr param to make some broken UAs happy
>>>modparam("rr", "enable_full_lr", 1)
>>>
>>>modparam("acc", "log_level", 1)
>>>modparam("acc", "radius_flag", 1)
>>>
>>># -------------------------  request routing logic -------------------
>>>
>>>alias=xxxxx.orange.co.uk
>>>
>>># main routing logic
>>>
>>>route{
>>>
>>>    # initial sanity checks -- messages with
>>>    # max_forwards==0, or excessively long requests
>>>    if (!mf_process_maxfwd_header("10")) {
>>>         sl_send_reply("483","Too Many Hops");
>>>         break;
>>>    };
>>>    if (len_gt( max_len )) {
>>>         sl_send_reply("513", "Message too big");
>>>         break;
>>>    };
>>>
>>>    # we record-route all messages -- to make sure that
>>>    # subsequent messages will go through our proxy; that's
>>>    # particularly good if upstream and downstream entities
>>>    # use different transport protocol
>>>    record_route();
>>>    # loose-route processing
>>>#    if (loose_route()) {
>>>#         t_relay();
>>>#         break;
>>>#    };
>>>
>>>    # if the request is for other domain use UsrLoc
>>>    # (in case, it does not work, use the following command
>>>    # with proper names and addresses in it)
>>>
>>>    if (method=="REGISTER") {
>>>
>>>         log(1, "REGISTER: Authenticating user\n");
>>>
>>>         if (!radius_www_authorize("")) {
>>>              log(1, "REGISTER: challenging user\n");
>>>              www_challenge("", "0");
>>>              break;
>>>         };
>>>         save("location");
>>>         break;
>>>    };
>>>
>>>    if (method=="INVITE") {
>>>
>>>         log(1, "INVITE\n");
>>>
>>>         setflag(1); /* set for accounting (the same value as in log_flag!) */
>>>    };
>>>
>>>    if (method=="MESSAGE") {
>>>         log(1, "MESSAGE\n");
>>>         setflag(1); /* set for accounting (the same value as in log_flag!) */
>>>    };
>>>
>>>    if (method=="BYE" || method=="CANCEL") {
>>>         log (1, "BYE or CANCEL\n");
>>>         setflag(1);
>>>    };
>>>
>>>    # native SIP destinations are handled using our USRLOC DB
>>>    if (!lookup("location")) {
>>>         sl_send_reply("404", "Not Found");
>>>         break;
>>>    };
>>>    if (!t_relay()) {
>>>         sl_reply_error();
>>>         break;
>>>    };
>>>
>>>}
>>>
>>>"Steven R. Bunin" <steve at solaas.com> on 29/09/2003 19:01:55
>>>
>>>To:   Jaime GIL/EN/HTLUK at HTLUK
>>>cc:   serusers at lists.iptel.org
>>>
>>>Subject:  re: Problems with accounting - can't get stop records
>>>
>>>Jaime,
>>>
>>>Thanks for the resposne.. I have my loose_route shut off. I think the problem
>>>may
>>>have to do with an error message I am receiving which is "ERROR: reply cannot be
>>>parsed" from my stderr.
>>>
>>>Do you have a working version of a script that works with 0.8.11 and gets stop
>>>records I could look at? It should give me a hand.. I know I am so close to
>>>solving
>>>this but it is a struggle.
>>>
>>>Steve
>>>
>>>jaime.gil at orange.co.uk wrote:
>>>
>>>   
>>>
>>>>Steven,
>>>>
>>>>I remember having the same problem. In my case, the problem seemed to be in
>>>>     
>>>the
>>>   
>>>
>>>>loose_route processing. I don't know what it has to do with the accounting
>>>>module, but commenting out this part made the trick in my case.
>>>>
>>>>Jaime
>>>>
>>>>"Steven R. Bunin" <steve at solaas.com> on 26/09/2003 17:11:41
>>>>
>>>>To:   serusers at lists.iptel.org
>>>>cc:    (bcc: Jaime GIL/EN/HTLUK)
>>>>
>>>>Subject:  [Serusers] Re: Serusers Digest, Vol 5, Issue 63
>>>>
>>>>Hi all,
>>>>
>>>>I have successfully gotten radius authentication working and I started getting
>>>>Radius Start records for accounting but I am not sure what I am doing wrong in
>>>>regards to getting radius Stop records.
>>>>
>>>>Below is the area I believe has the most affect on Radius Acccounting from my
>>>>Log File. Any suggestions would be appreciated and if it would help to see the
>>>>full Config file I will send it as well.
>>>>
>>>>record_route();
>>>>
>>>> if (method=="REGISTER") {
>>>>
>>>># Uncomment this if you want to use digest authentication
>>>>  if (!radius_www_authorize("")) {
>>>>   www_challenge("", "0");
>>>>   break;
>>>>  };
>>>>
>>>>  save("location");
>>>>  break;
>>>> };
>>>>
>>>>if (method =="INVITE")
>>>>{
>>>>log(1,"INVITE\n");
>>>>setflag(1);
>>>>};
>>>>if (method=="MESSAGE") {
>>>>log(1,"MESSAGE\n");
>>>>setflag(1);
>>>>};
>>>>if (method=="BYE"){
>>>>log (1, "BYE or CANCEL\n");
>>>>setflag(1);
>>>>};
>>>>if (method=="CANCEL"){
>>>>log (1, "BYE or CANCEL\n");
>>>>setflag(1);
>>>>};
>>>>
>>>>Thanks in advance,
>>>>
>>>>Steve
>>>>
>>>>_______________________________________________
>>>>Serusers mailing list
>>>>serusers at lists.iptel.org
>>>>http://lists.iptel.org/mailman/listinfo/serusers
>>>>
>>>> ------------------------------------------------------------------------
>>>>              Name: att1.eml
>>>>  att1.eml    Type: Internet E-Mail Message (message/rfc822)
>>>>          Encoding: base64
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>     
>>>*******************************************************************************
>>>   
>>>
>>>>Important.
>>>>Confidentiality: This communication is intended for the above-named person and
>>>>may be confidential and/or legally privileged. Any opinions expressed in this
>>>>communication are not necessarily those of the company. If it has come to you
>>>>in error you must take no action based on it, nor must you copy or show it to
>>>>anyone; please delete/destroy and inform the sender immediately.
>>>>
>>>>Monitoring/Viruses
>>>>Orange may monitor all incoming and outgoing emails in line with current
>>>>legislation.  Although we have taken steps to ensure that this email and
>>>>attachments are free from any virus, we advise that in keeping with good
>>>>computing practice the recipient should ensure they are actually virus free.
>>>>
>>>>Orange PCS Limited is a subsidiary of Orange SA and is registered in England
>>>>     
>>>No
>>>   
>>>
>>>>2178917, with its address at St James Court, Great Park Road, Almondsbury
>>>>     
>>>Park,
>>>   
>>>
>>>>Bradley Stoke, Bristol BS32 4QJ.
>>>>
>>>>     
>>>*******************************************************************************
>>>
>>>--
>>>Steven R. Bunin - Managing Partner
>>>
>>>SOLAAS LLC
>>>10 East 39th Street
>>>Suite 1125
>>>New York, NY 10016
>>>(+001) 212-532-6700
>>>Cellular: 646-739-7000
>>>Fax (+001) 212-532-6776
>>>
>>>http://www.solaas.com
>>>
>>>--
>>>
>>>This e-mail may contain confidential and/or privileged information. If you are
>>>not
>>>the intended recipient (or have received this e-mail in error) please notify the
>>>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure
>>>or
>>>distribution of the material in this e-mail is strictly forbidden.
>>>
>>> ------------------------------------------------------------------------
>>>              Name: att1.eml
>>>  att1.eml    Type: Internet E-Mail Message (message/rfc822)
>>>          Encoding: base64
>>>
>>> ------------------------------------------------------------------------
>>>
>>>*******************************************************************************
>>>Important.
>>>Confidentiality: This communication is intended for the above-named person and
>>>may be confidential and/or legally privileged. Any opinions expressed in this
>>>communication are not necessarily those of the company. If it has come to you
>>>in error you must take no action based on it, nor must you copy or show it to
>>>anyone; please delete/destroy and inform the sender immediately.
>>>
>>>Monitoring/Viruses
>>>Orange may monitor all incoming and outgoing emails in line with current
>>>legislation.  Although we have taken steps to ensure that this email and
>>>attachments are free from any virus, we advise that in keeping with good
>>>computing practice the recipient should ensure they are actually virus free.
>>>
>>>Orange PCS Limited is a subsidiary of Orange SA and is registered in England No
>>>2178917, with its address at St James Court, Great Park Road, Almondsbury Park,
>>>Bradley Stoke, Bristol BS32 4QJ.
>>>*******************************************************************************
>>>   
>>
>>--
>>Steven R. Bunin - Managing Partner
>>
>>SOLAAS LLC
>>10 East 39th Street
>>Suite 1125
>>New York, NY 10016
>>(+001) 212-532-6700
>>Cellular: 646-739-7000
>>Fax (+001) 212-532-6776
>>
>>http://www.solaas.com
>>
>>--
>>
>>This e-mail may contain confidential and/or privileged information. If you are not
>>the intended recipient (or have received this e-mail in error) please notify the
>>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or
>>distribution of the material in this e-mail is strictly forbidden.
>>
>>
>>_______________________________________________
>>Serusers mailing list
>>serusers at lists.iptel.org
>>http://lists.iptel.org/mailman/listinfo/serusers
>>
>> 
>
>
>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers

--
Jiri Kuthan            http://iptel.org/~jiri/ 




More information about the sr-users mailing list