Re: [OpenSIPS-Users] accounting problem after failover
Hi Edwin, There is no need to set DB_FLAG as missed calls - I was just investigating some possibilities of conflict ... The acc flags must be set before the t_relay(), so that acc module can install some callbacks when the transaction is created. So, everything solved at this point ? Best regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 05.02.2014 20:41, Edwin wrote: Bogdan, I did not set the DB_FLAG for triggering missed calls (tried without any luck), should I do this? I came up with this peace of routing (simplified), strange thing is I can clear the DB_FLAG in the reply route after a t_relay, but I can not set the DB_FLAG after a t_relay. Does this make any sense?: loadmodule acc.so modparam(acc, db_url, mysql://opensips:***@***/opensips) modparam(acc, db_flag, DB_FLAG) modparam(acc, cdr_flag, DB_FLAG) .. routing ... route[1] # inbound call { ... routing logic ... set_dlg_flag(2); # this is a inbound call setflag(DB_FLAG); # db_flag and cdr_flag t_on_reply(1); t_on_failure(1); # if offline goto failure route : mobile t_relay(0x05);# relay call to registered client } route [2] # goto mobile phone and do account call { ... routing logic ... $rU = { mobile number } t_relay(0x05); # route call to mobile } onreply_route[1] { if(is_dlg_flag_set(2)) # if it was an inbound call { resetflag(DB_FLAG); # we got a reply, so it's an inbound call : no accounting } } failure_route[1] { reset_dlg_flag(2); # inbound call forwared to mobile, clear flag route(2); # goto mobile phone and do account call } -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422p7589464.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] accounting problem after failover
After more testing I found out that is I put setflag(DB_FLAG) before t_relay in route[1] CDR accounting is working. But I (of course) only want to account outgoing calls so I want to set the flag in route[2] -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422p7589442.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] accounting problem after failover
Hello, Are you, by any chances, using the DB_FLAG flag for triggering missed calls too (in acc module) ?? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 05.02.2014 13:37, Edwin wrote: After more testing I found out that is I put setflag(DB_FLAG) before t_relay in route[1] CDR accounting is working. But I (of course) only want to account outgoing calls so I want to set the flag in route[2] -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422p7589442.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] accounting problem after failover
Bogdan, I did not set the DB_FLAG for triggering missed calls (tried without any luck), should I do this? I came up with this peace of routing (simplified), strange thing is I can clear the DB_FLAG in the reply route after a t_relay, but I can not set the DB_FLAG after a t_relay. Does this make any sense?: loadmodule acc.so modparam(acc, db_url, mysql://opensips:***@***/opensips) modparam(acc, db_flag, DB_FLAG) modparam(acc, cdr_flag, DB_FLAG) .. routing ... route[1] # inbound call { ... routing logic ... set_dlg_flag(2); # this is a inbound call setflag(DB_FLAG); # db_flag and cdr_flag t_on_reply(1); t_on_failure(1);# if offline goto failure route : mobile t_relay(0x05);# relay call to registered client } route [2] # goto mobile phone and do account call { ... routing logic ... $rU = { mobile number } t_relay(0x05); # route call to mobile } onreply_route[1] { if(is_dlg_flag_set(2)) # if it was an inbound call { resetflag(DB_FLAG); # we got a reply, so it's an inbound call : no accounting } } failure_route[1] { reset_dlg_flag(2); # inbound call forwared to mobile, clear flag route(2); # goto mobile phone and do account call } -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422p7589464.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] accounting problem after failover
I need a little (lot of) help with an accounting problem. I try to deliver an inbound call to the ip of a client. If the transactions times out I route the call outbound to his mobile. (Of course) the outbound call should be accounted (in mysql CDR database). I tried to show routing down here in a simplified way. I put the uac_replace_from in a branch route because I can not use the function twice. If I route the call straight to route 2 everythings works fine and the call shows up in the accountingdatabase. If I route the call to route 1 and the route times out it is pushed throught the failure route to route 2. The call is delivered but I don't get the accounting working. I hope I put enought information down here, any help is appreciated! loadmodule acc.so modparam(acc, db_url, mysql://opensips:xxx@localhost/yyy) modparam(acc, db_flag, DB_FLAG) modparam(acc, cdr_flag, DB_FLAG) route[0] { if(is_method(INVITE) is_from_gw()) { route(1); # from trusted route } } # from trusted route route[1] { create_dialog(B); if(lookup(location)) # route to local user { t_on_branch(0); t_on_failure(1); t_relay(0x05); } } branch_route[0] { uac_replace_from(,sip:anonymous-at-invalid); append_hf(Privacy: id\r\n); } # to mobiel number route[2] { $rU = $avp(mobile_number); setflag(DB_FLAG); # account successful transactions t_on_branch(1); create_dialog(B); t_relay(0x05); } branch_route[1] { uac_replace_from(,sip:1234-at-xyz); append_hf(Privacy: full\r\n); } # timeout on t_relay, goto mobile number failure_route[1] { route(2); } -- View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Accounting problem
El Jueves, 27 de Noviembre de 2008, Tseveendorj Ochirlantuu escribió: (Shared secret is incorrect.) -- Iñaki Baz Castillo ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Accounting problem
Hello I have problem for radius accounting on opensips 1.4.2-tls. Environment: Debian Linux 2.6.18-6-amd64 Opensips 1.4.2 FreeRADIUS 1.1.3 MYSQL 5.0.32 Tue Nov 25 18:07:23 2008 : Info: rlm_sql_mysql: Starting connect to MySQL server for #21 Tue Nov 25 18:07:23 2008 : Info: rlm_sql_mysql: Starting connect to MySQL server for #22 Tue Nov 25 18:07:23 2008 : Info: rlm_sql_mysql: Starting connect to MySQL server for #23 Tue Nov 25 18:07:23 2008 : Info: rlm_sql_mysql: Starting connect to MySQL server for #24 Tue Nov 25 18:07:23 2008 : Info: Ready to process requests. Tue Nov 25 18:08:07 2008 : Error: Received Accounting-Request packet from 127.0.0.1 with invalid signature! (Shared secret is incorrect.) Dropping packet without response. Tue Nov 25 18:08:07 2008 : Error: Received Accounting-Request packet from 127.0.0.1 with invalid signature! (Shared secret is incorrect.) Dropping packet without response. Tue Nov 25 18:08:17 2008 : Error: Received Accounting-Request packet from 127.0.0.1 with invalid signature! (Shared secret is incorrect.) Dropping packet without response. Tue Nov 25 18:08:27 2008 : Error: Received Accounting-Request packet from 127.0.0.1 with invalid signature! (Shared secret is incorrect.) Dropping packet without response. Tue Nov 25 18:08:27 2008 : Error: Received Accounting-Request packet from 127.0.0.1 with invalid signature! (Shared secret is incorrect.) Dropping packet without response. Can OpenSIPs work on 64bit OS ? How to solve this? Sincerely, Tseveen ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Accounting Problem
Hello Everybody, I am using freeradius+Openser for the accounting purpose. I explain using example. 1) This is working perfectly. A===call to= B Accounting is starting When A hangup the call then Accounting is stop and it makes the Entry in the db. Accounting stop message is generated and total session time is calculated. 2) This scenario is not working. A===call to= B Accounting is starting . When B hangup the call then Accounting is not happening and didnt get any msg at radius server side. So that the TotalSession time is becomes zero. For that i have attached my openser.cfg here. #openser version 1.1 # --- global configuration parameters debug=9 # debug level (cmd line: -dd fork=yes log_stderror=yes # (cmd line: -E) #log_facility=LOG_LOCAL5 check_via=no# (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) #listen=0.0.0.0 listen=udp:192.168.1.1 port=3300 children=8 #fifo=/tmp/openser_fifo #unix_sock_children=2 # -- module loading -- mpath=/usr/local/lib/openser/modules loadmodule mysql.so loadmodule sl.so loadmodule tm.so loadmodule rr.so loadmodule maxfwd.so loadmodule usrloc.so loadmodule registrar.so loadmodule textops.so loadmodule xlog.so loadmodule uri.so loadmodule acc.so loadmodule auth.so loadmodule auth_radius.so loadmodule dispatcher.so loadmodule nathelper.so loadmodule enum.so #loadmodule mediaproxy.so #loadmodule uri_db.so # - setting module-specific parameters --- #-- registrar testing- modparam(registrar, default_expires, 225) #--Dialog Module-- # -- usrloc params -- modparam(dispatcher, list_file, /usr/local/etc/openser/dispatcher.list) modparam(usrloc,db_url,mysql://openser:[EMAIL PROTECTED]/openser) modparam(usrloc,db_mode, 3) modparam(usrloc, timer_interval, 30) #modparam(usrloc, expires_column, 225000) #modparam(usrloc, cseq_delay, 60) #modparam(usrloc, timer_interval, 30) #modparam(usrloc,desc_time_order, 1) #modparam(usrloc, matching_mode, 1) #modparam(registrar, desc_time_order, 1) modparam(usrloc, desc_time_order, 0) #modparam(registrar, max_contacts, 1) # -- acc params -- # #modparam(acc, failed_transaction_flag, 1) #modparam(acc, report_cancels, 0) #modparam(acc, report_ack, 0) #modparam(acc, early_media,0) #modparam(acc, log_level, 1) modparam(acc, log_flag, 1) modparam(acc, log_missed_flag,2) modparam(acc, service_type, 15) modparam(acc|auth_radius, radius_config,/etc/radiusclient-ng/radiusclient.conf) modparam(acc, radius_flag,1) modparam(acc, radius_missed_flag, 1) modparam(acc, radius_extra, Called-Station-Id=$tu; Calling-Station-Id=$fu; Canonical-URI=$tu; User-Name=$au; Sip-User-Realm=$ar; Source-IP=$si; Source-Port=$sp; From-Header=$hdr(from); User-Agent=$hdr(user-agent); Contact=$hdr(contact); ENUM-TLD=$avp(s:enum_tld); Event=$hdr(event)) # -- rr params -- # add value to ;lr param to make some broken UAs happy modparam(rr, enable_full_lr, 1) #modparam(nathelper, rtpproxy_disable_tout, 1) #modparam(nathelper, received_avp, $avp(i:42)) # - request routing logic --- # main routing logic route{ xdbg(\n\n Start -\n\n); if (!mf_process_maxfwd_header(10)) { sl_send_reply(483,Too Many Hops); exit; }; if (msg:len = 2048 ) { sl_send_reply(513, Message too big); exit; }; if (!method==REGISTER){ record_route(); }; xdbg(\n\n Before Loose route \n\n); if (loose_route()){ xdbg(\n\n Loose route \n\n); xdbg(\n\n Stop Accounting \n\n); setflag(1); #Stop accounting route(1); exit; }; if ((src_ip==192.168.1.5) ) { xdbg(\n\n From sip proxy server urmi -\n\n); route(2); exit; }; if (method==REGISTER){ xdbg(\n\n
Re: [OpenSIPS-Users] Accounting Problem
Hi Dilip, Try not to use the same flag for accounting flag and for missed_call flag - this may lead to unpredictable behaviour . Use different flags and see if the problem still persists. Regards, Bogdan Dilip wrote: Hello Everybody, I am using freeradius+Openser for the accounting purpose. I explain using example. 1) This is working perfectly. A===call to= B Accounting is starting When A hangup the call then Accounting is stop and it makes the Entry in the db. Accounting stop message is generated and total session time is calculated. 2) This scenario is not working. A===call to= B Accounting is starting . When B hangup the call then Accounting is not happening and didnt get any msg at radius server side. So that the TotalSession time is becomes zero. For that i have attached my openser.cfg here. #openser version 1.1 # --- global configuration parameters debug=9 # debug level (cmd line: -dd fork=yes log_stderror=yes # (cmd line: -E) #log_facility=LOG_LOCAL5 check_via=no# (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) #listen=0.0.0.0 listen=udp:192.168.1.1 port=3300 children=8 #fifo=/tmp/openser_fifo #unix_sock_children=2 # -- module loading -- mpath=/usr/local/lib/openser/modules loadmodule mysql.so loadmodule sl.so loadmodule tm.so loadmodule rr.so loadmodule maxfwd.so loadmodule usrloc.so loadmodule registrar.so loadmodule textops.so loadmodule xlog.so loadmodule uri.so loadmodule acc.so loadmodule auth.so loadmodule auth_radius.so loadmodule dispatcher.so loadmodule nathelper.so loadmodule enum.so #loadmodule mediaproxy.so #loadmodule uri_db.so # - setting module-specific parameters --- #-- registrar testing- modparam(registrar, default_expires, 225) #--Dialog Module-- # -- usrloc params -- modparam(dispatcher, list_file, /usr/local/etc/openser/dispatcher.list) modparam(usrloc,db_url,mysql://openser:[EMAIL PROTECTED]/openser) modparam(usrloc,db_mode, 3) modparam(usrloc, timer_interval, 30) #modparam(usrloc, expires_column, 225000) #modparam(usrloc, cseq_delay, 60) #modparam(usrloc, timer_interval, 30) #modparam(usrloc,desc_time_order, 1) #modparam(usrloc, matching_mode, 1) #modparam(registrar, desc_time_order, 1) modparam(usrloc, desc_time_order, 0) #modparam(registrar, max_contacts, 1) # -- acc params -- # #modparam(acc, failed_transaction_flag, 1) #modparam(acc, report_cancels, 0) #modparam(acc, report_ack, 0) #modparam(acc, early_media,0) #modparam(acc, log_level, 1) modparam(acc, log_flag, 1) modparam(acc, log_missed_flag,2) modparam(acc, service_type, 15) modparam(acc|auth_radius, radius_config,/etc/radiusclient-ng/radiusclient.conf) modparam(acc, radius_flag,1) modparam(acc, radius_missed_flag, 1) modparam(acc, radius_extra, Called-Station-Id=$tu; Calling-Station-Id=$fu; Canonical-URI=$tu; User-Name=$au; Sip-User-Realm=$ar; Source-IP=$si; Source-Port=$sp; From-Header=$hdr(from); User-Agent=$hdr(user-agent); Contact=$hdr(contact); ENUM-TLD=$avp(s:enum_tld); Event=$hdr(event)) # -- rr params -- # add value to ;lr param to make some broken UAs happy modparam(rr, enable_full_lr, 1) #modparam(nathelper, rtpproxy_disable_tout, 1) #modparam(nathelper, received_avp, $avp(i:42)) # - request routing logic --- # main routing logic route{ xdbg(\n\n Start -\n\n); if (!mf_process_maxfwd_header(10)) { sl_send_reply(483,Too Many Hops); exit; }; if (msg:len = 2048 ) { sl_send_reply(513, Message too big); exit; }; if (!method==REGISTER){ record_route(); }; xdbg(\n\n Before Loose route \n\n); if (loose_route()){ xdbg(\n\n Loose route \n\n); xdbg(\n\n Stop Accounting \n\n);