<DIV>Hello:</DIV>
<DIV>I need to accounting the message "invite"and "bye",now the radius can get response when the call is established,but when the call is terminated,the radius has no response,my opensips.cfg is as followed, can anyone tell me what is the matter?</DIV>
<DIV>####### Global Parameters #########</DIV>
<DIV>debug=3<BR>log_stderror=no<BR>log_facility=LOG_LOCAL0</DIV>
<DIV>fork=yes<BR>children=4</DIV>
<DIV>/* uncomment the following lines to enable debugging */<BR>#debug=6<BR>#fork=no<BR>#log_stderror=yes</DIV>
<DIV>/* uncomment the next line to disable TCP (default on) */<BR>#disable_tcp=yes</DIV>
<DIV>/* uncomment the next line to enable the auto temporary blacklisting of <BR>&nbsp;&nbsp; not available destinations (default disabled) */<BR>#disable_dns_blacklist=no</DIV>
<DIV>/* uncomment the next line to enable IPv6 lookup after IPv4 dns <BR>&nbsp;&nbsp; lookup failures (default disabled) */<BR>#dns_try_ipv6=yes</DIV>
<DIV>/* uncomment the next line to disable the auto discovery of local aliases<BR>&nbsp;&nbsp; based on revers DNS on IPs (default on) */<BR>#auto_aliases=no</DIV>
<DIV>/* uncomment the following lines to enable TLS support&nbsp; (default off) */<BR>#disable_tls = no<BR>#listen = tls:your_IP:5061<BR>#tls_verify_server = 1<BR>#tls_verify_client = 1<BR>#tls_require_client_certificate = 0<BR>#tls_method = TLSv1<BR>#tls_certificate = "/usr/local/etc/opensips/tls/user/user-cert.pem"<BR>#tls_private_key = "/usr/local/etc/opensips/tls/user/user-privkey.pem"<BR>#tls_ca_list = "/usr/local/etc/opensips/tls/user/user-calist.pem"</DIV>
<DIV><BR>port=5060</DIV>
<DIV>/* uncomment and configure the following line if you want opensips to <BR>&nbsp;&nbsp; bind on a specific interface/port/proto (default bind on all available) */<BR>listen=udp:192.168.118.39:5060</DIV>
<DIV><BR>####### Modules Section ########</DIV>
<DIV>#set module path<BR>mpath="/usr/local/lib/opensips/modules/"</DIV>
<DIV>/* uncomment next line for MySQL DB support */</DIV>
<DIV>loadmodule "db_mysql.so"<BR>loadmodule "signaling.so"<BR>loadmodule "sl.so"<BR>loadmodule "tm.so"<BR>loadmodule "rr.so"<BR>loadmodule "maxfwd.so"<BR>loadmodule "usrloc.so"<BR>loadmodule "registrar.so"<BR>loadmodule "textops.so"<BR>loadmodule "mi_fifo.so"<BR>loadmodule "uri.so"<BR>loadmodule "acc.so"<BR>#loadmodule "uri_db.so"<BR>/* uncomment next lines for MySQL based authentication support <BR>&nbsp;&nbsp; NOTE: a DB (like db_mysql) module must be also loaded */<BR>loadmodule "auth.so"<BR>loadmodule "auth_db.so"<BR>/* uncomment next line for aliases support<BR>&nbsp;&nbsp; NOTE: a DB (like db_mysql) module must be also loaded */<BR>#loadmodule "alias_db.so"<BR>/* uncomment next line for multi-domain support<BR>&nbsp;&nbsp; NOTE: a DB (like db_mysql) module must be also loaded<BR>&nbsp;&nbsp; NOTE: be sure and enable multi-domain support in all used modules<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (see "multi-module params" section ) */<BR>#loadmodule "domain.so"<BR>/* uncomment the next two lines for presence server support<BR>&nbsp;&nbsp; NOTE: a DB (like db_mysql) module must be also loaded */<BR>#loadmodule "presence.so"<BR>#loadmodule "presence_xml.so"<BR>loadmodule "aaa_radius.so"</DIV>
<DIV># ----------------- setting module-specific parameters ---------------</DIV>
<DIV># ----- mi_fifo params -----<BR>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")</DIV>
<DIV><BR># ----- rr params -----<BR># add value to ;lr param to cope with most of the UAs<BR>modparam("rr", "enable_full_lr", 1)<BR># do not append from tag to the RR (no need for this script)<BR>modparam("rr", "append_fromtag", 0)</DIV>
<DIV><BR># ----- registrar params -----<BR>/* uncomment the next line not to allow more than 10 contacts per AOR */<BR>#modparam("registrar", "max_contacts", 10)</DIV>
<DIV><BR># ----- usrloc params -----<BR>modparam("usrloc", "db_mode",&nbsp;&nbsp; 0)<BR>/* uncomment the following lines if you want to enable DB persistency<BR>&nbsp;&nbsp; for location entries */<BR>#modparam("usrloc", "db_mode",&nbsp;&nbsp; 2)<BR>#modparam("usrloc", "db_url",<BR>#&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")</DIV>
<DIV><BR># ----- uri params -----<BR>modparam("uri", "use_uri_table", 0)</DIV>
<DIV><BR># ----- acc params -----<BR>/* what sepcial events should be accounted ? */<BR>#modparam("acc", "early_media", 0)<BR>modparam("acc", "report_ack", 1)<BR>modparam("acc", "report_cancels", 1)<BR>/* by default ww do not adjust the direct of the sequential requests.<BR>&nbsp;&nbsp; if you enable this parameter, be sure the enable "append_fromtag"<BR>&nbsp;&nbsp; in "rr" module */<BR>modparam("acc", "detect_direction", 0)<BR>/* account triggers (flags) */<BR>modparam("acc", "failed_transaction_flag", 3)<BR>modparam("acc", "log_flag", 1)<BR>modparam("acc", "log_missed_flag", 2)<BR>/* uncomment the following lines to enable DB accounting also */<BR>#modparam("acc", "db_flag", 1)<BR>#modparam("acc", "db_missed_flag", 2)<BR>modparam("acc","aaa_flag",2)<BR>modparam("acc","aaa_missed_flag",3)<BR>modparam("acc","service_type",15)<BR>#modparam("aaa_radius", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf") <BR>modparam("acc","aaa_url","radius:/usr/local/etc/radiusclient-ng/radiusclient.conf")<BR>modparam("acc", "aaa_extra",&nbsp;&nbsp;&nbsp; "User-Name=$Au ;\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Calling-Station-Id=$from;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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENUM-TLD=$avp(s:enum_tld)")&nbsp;<BR># ----- auth_db params -----<BR>/* uncomment the following lines if you want to enable the DB based<BR>&nbsp;&nbsp; authentication */<BR>#modparam("auth_db", "calculate_ha1", yes)<BR>#modparam("auth_db", "password_column", "password")<BR>#modparam("auth_db", "db_url",<BR>#&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")<BR>#modparam("auth_db", "load_credentials", "")</DIV>
<DIV><BR># ----- alias_db params -----<BR>/* uncomment the following lines if you want to enable the DB based<BR>&nbsp;&nbsp; aliases */<BR>#modparam("alias_db", "db_url",<BR>#&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")</DIV>
<DIV><BR># ----- domain params -----<BR>/* uncomment the following lines to enable multi-domain detection<BR>&nbsp;&nbsp; support */<BR>#modparam("domain", "db_url",<BR>#&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")<BR>#modparam("domain", "db_mode", 1)&nbsp;&nbsp; # Use caching</DIV>
<DIV><BR># ----- multi-module params -----<BR>/* uncomment the following line if you want to enable multi-domain support<BR>&nbsp;&nbsp; in the modules (dafault off) */<BR>#modparam("auth_db|usrloc|uri", "use_domain", 1)</DIV>
<DIV><BR># ----- presence params -----<BR>/* uncomment the following lines if you want to enable presence */<BR>#modparam("presence|presence_xml", "db_url",<BR>#&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")<BR>#modparam("presence_xml", "force_active", 1)<BR>#modparam("presence", "server_address", "sip:192.168.1.2:5060")</DIV>
<DIV><BR>####### Routing Logic ########</DIV>
<DIV><BR># main request routing logic</DIV>
<DIV>route{<BR>&nbsp;if (!mf_process_maxfwd_header("10")) {<BR>&nbsp;&nbsp;sl_send_reply("483","Too Many Hops");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;if (has_totag()) {<BR>&nbsp;&nbsp;# sequential request withing a dialog should<BR>&nbsp;&nbsp;# take the path determined by record-routing<BR>&nbsp;&nbsp;if (loose_route()) {<BR>&nbsp;&nbsp;&nbsp;if (is_method("BYE")) {<BR>&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp; acc_rad_request("BYE"); #// This is sending an Bye to the radius server to create the stop time.<BR>&nbsp;&nbsp;&nbsp;&nbsp;setflag(1); # do accounting ...<BR>&nbsp;&nbsp;&nbsp;&nbsp;#setflag(3); # ... even if the transaction fails<BR>&nbsp;&nbsp;&nbsp;} else if (is_method("INVITE")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;# even if in most of the cases is useless, do RR for<BR>&nbsp;&nbsp;&nbsp;&nbsp;# re-INVITEs alos, as some buggy clients do change route set<BR>&nbsp;&nbsp;&nbsp;&nbsp;# during the dialog.<BR>&nbsp;&nbsp;&nbsp;&nbsp;record_route();<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;# route it out to whatever destination was set by loose_route()<BR>&nbsp;&nbsp;&nbsp;# in $du (destination URI).<BR>&nbsp;&nbsp;&nbsp;route(1);<BR>&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;/* uncomment the following lines if you want to enable presence */<BR>&nbsp;&nbsp;&nbsp;##if (is_method("SUBSCRIBE") &amp;&amp; $rd == "your.server.ip.address") {<BR>&nbsp;&nbsp;&nbsp;##&nbsp;# in-dialog subscribe requests<BR>&nbsp;&nbsp;&nbsp;##&nbsp;route(2);<BR>&nbsp;&nbsp;&nbsp;##&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;##}<BR>&nbsp;&nbsp;&nbsp;if ( is_method("ACK") ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if ( t_check_trans() ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# non loose-route, but stateful ACK; must be an ACK after <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# a 487 or e.g. 404 from upstream server<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_relay();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ACK without matching transaction -&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ignore and discard<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;sl_send_reply("404","Not here");<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;#initial requests</DIV>
<DIV>&nbsp;# CANCEL processing<BR>&nbsp;if (is_method("CANCEL"))<BR>&nbsp;{<BR>&nbsp;&nbsp;if (t_check_trans())<BR>&nbsp;&nbsp;&nbsp;t_relay();<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;t_check_trans();</DIV>
<DIV>&nbsp;# authenticate if from local subscriber (uncomment to enable auth)<BR>&nbsp;# authenticate all initial non-REGISTER request that pretend to be<BR>&nbsp;# generated by local subscriber (domain from FROM URI is local)<BR>&nbsp;##if (!(method=="REGISTER") &amp;&amp; from_uri==myself) /*no multidomain version*/<BR>&nbsp;##if (!(method=="REGISTER") &amp;&amp; is_from_local())&nbsp; /*multidomain version*/<BR>&nbsp;##{<BR>&nbsp;##&nbsp;if (!proxy_authorize("", "subscriber")) {<BR>&nbsp;##&nbsp;&nbsp;proxy_challenge("", "0");<BR>&nbsp;##&nbsp;&nbsp;exit;<BR>&nbsp;##&nbsp;}<BR>&nbsp;##&nbsp;if (!db_check_from()) {<BR>&nbsp;##&nbsp;&nbsp;sl_send_reply("403","Forbidden auth ID");<BR>&nbsp;##&nbsp;&nbsp;exit;<BR>&nbsp;##&nbsp;}<BR>&nbsp;##<BR>&nbsp;##&nbsp;consume_credentials();<BR>&nbsp;##&nbsp;# caller authenticated<BR>&nbsp;##}</DIV>
<DIV>&nbsp;# preloaded route checking<BR>&nbsp;if (loose_route()) {<BR>&nbsp;&nbsp;xlog("L_ERR",<BR>&nbsp;&nbsp;"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");<BR>&nbsp;&nbsp;if (!is_method("ACK"))<BR>&nbsp;&nbsp;&nbsp;sl_send_reply("403","Preload Route denied");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;# record routing<BR>&nbsp;if (!is_method("REGISTER|MESSAGE"))<BR>&nbsp;&nbsp;record_route();</DIV>
<DIV>&nbsp;# account only INVITEs<BR>&nbsp;if (is_method("INVITE")) {<BR>&nbsp;&nbsp;setflag(1); # do accounting<BR>&nbsp;}<BR>&nbsp;if (!uri==myself)<BR>&nbsp;## replace with following line if multi-domain support is used<BR>&nbsp;##if (!is_uri_host_local())<BR>&nbsp;{<BR>&nbsp;&nbsp;append_hf("P-hint: outbound\r\n"); <BR>&nbsp;&nbsp;# if you have some interdomain connections via TLS<BR>&nbsp;&nbsp;##if($rd=="tls_domain1.net") {<BR>&nbsp;&nbsp;##&nbsp;t_relay("tls:domain1.net");<BR>&nbsp;&nbsp;##&nbsp;exit;<BR>&nbsp;&nbsp;##} else if($rd=="tls_domain2.net") {<BR>&nbsp;&nbsp;##&nbsp;t_relay("tls:domain2.net");<BR>&nbsp;&nbsp;##&nbsp;exit;<BR>&nbsp;&nbsp;##}<BR>&nbsp;&nbsp;route(1);<BR>&nbsp;}</DIV>
<DIV>&nbsp;# requests for my domain</DIV>
<DIV>&nbsp;## uncomment this if you want to enable presence server <BR>&nbsp;##&nbsp;&nbsp; and comment the next 'if' block<BR>&nbsp;##&nbsp;&nbsp; NOTE: uncomment also the definition of route[2] from&nbsp; below<BR>&nbsp;##if( is_method("PUBLISH|SUBSCRIBE"))<BR>&nbsp;##&nbsp;&nbsp;route(2);</DIV>
<DIV>&nbsp;if (is_method("PUBLISH"))<BR>&nbsp;{<BR>&nbsp;&nbsp;sl_send_reply("503", "Service Unavailable");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}<BR>&nbsp;</DIV>
<DIV>&nbsp;if (is_method("REGISTER"))<BR>&nbsp;{<BR>&nbsp;&nbsp;# authenticate the REGISTER requests (uncomment to enable auth)<BR>&nbsp;&nbsp;#if (!www_authorize("", "subscriber"))&nbsp;&nbsp;<BR>&nbsp;&nbsp;#{<BR>&nbsp;&nbsp;#&nbsp;www_challenge("", "0");<BR>&nbsp;&nbsp;#&nbsp;exit;<BR>&nbsp;&nbsp;#}<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;##if (!db_check_to()) <BR>&nbsp;&nbsp;##{<BR>&nbsp;&nbsp;##&nbsp;sl_send_reply("403","Forbidden auth ID");<BR>&nbsp;&nbsp;##&nbsp;exit;<BR>&nbsp;&nbsp;##}</DIV>
<DIV>&nbsp;&nbsp;if (!save("location"))<BR>&nbsp;&nbsp;&nbsp;sl_reply_error();</DIV>
<DIV>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;if ($rU==NULL) {<BR>&nbsp;&nbsp;# request with no Username in RURI<BR>&nbsp;&nbsp;sl_send_reply("484","Address Incomplete");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;# apply DB based aliases (uncomment to enable)<BR>&nbsp;##alias_db_lookup("dbaliases");</DIV>
<DIV>&nbsp;# do lookup with method filtering<BR>&nbsp;if (!lookup("location","m")) {<BR>&nbsp;&nbsp;switch ($retcode) {<BR>&nbsp;&nbsp;&nbsp;case -1:<BR>&nbsp;&nbsp;&nbsp;case -3:<BR>&nbsp;&nbsp;&nbsp;&nbsp;t_newtran();<BR>&nbsp;&nbsp;&nbsp;&nbsp;t_reply("404", "Not Found");<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;case -2:<BR>&nbsp;&nbsp;&nbsp;&nbsp;sl_send_reply("405", "Method Not Allowed");<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;}<BR>&nbsp;}</DIV>
<DIV>&nbsp;# when routing via usrloc, log the missed calls also<BR>&nbsp;setflag(2);</DIV>
<DIV>&nbsp;route(1);<BR>}</DIV>
<DIV><BR>route[1] {<BR>&nbsp;# for INVITEs enable some additional helper routes<BR>&nbsp;if (is_method("INVITE")) {<BR>&nbsp;&nbsp;t_on_branch("2");<BR>&nbsp;&nbsp;t_on_reply("2");<BR>&nbsp;&nbsp;t_on_failure("1");<BR>&nbsp;}</DIV>
<DIV>&nbsp;if (!t_relay()) {<BR>&nbsp;&nbsp;sl_reply_error();<BR>&nbsp;};<BR>&nbsp;exit;<BR>}</DIV>
<DIV><BR># Presence route<BR>/* uncomment the whole following route for enabling presence<BR>&nbsp;&nbsp; NOTE: do not forget to enable the call of this route from the main<BR>&nbsp;&nbsp;&nbsp;&nbsp; route */<BR>##route[2]<BR>##{<BR>##&nbsp;if (!t_newtran())<BR>##&nbsp;{<BR>##&nbsp;&nbsp;sl_reply_error();<BR>##&nbsp;&nbsp;exit;<BR>##&nbsp;};<BR>##<BR>##&nbsp;if(is_method("PUBLISH"))<BR>##&nbsp;{<BR>##&nbsp;&nbsp;handle_publish();<BR>##&nbsp;}<BR>##&nbsp;else<BR>##&nbsp;if( is_method("SUBSCRIBE"))<BR>##&nbsp;{<BR>##&nbsp;&nbsp;handle_subscribe();<BR>##&nbsp;}<BR>##<BR>##&nbsp;exit;<BR>##}</DIV>
<DIV><BR>branch_route[2] {<BR>&nbsp;xlog("new branch at $ru\n");<BR>}</DIV>
<DIV><BR>onreply_route[2] {<BR>&nbsp;xlog("incoming reply\n");<BR>}</DIV>
<DIV><BR>failure_route[1] {<BR>&nbsp;if (t_was_cancelled()) {<BR>&nbsp;&nbsp;exit;<BR>&nbsp;}</DIV>
<DIV>&nbsp;# uncomment the following lines if you want to block client <BR>&nbsp;# redirect based on 3xx replies.<BR>&nbsp;##if (t_check_status("3[0-9][0-9]")) {<BR>&nbsp;##t_reply("404","Not found");<BR>&nbsp;##&nbsp;exit;<BR>&nbsp;##}</DIV>
<DIV>&nbsp;# uncomment the following lines if you want to redirect the failed <BR>&nbsp;# calls to a different new destination<BR>&nbsp;##if (t_check_status("486|408")) {<BR>&nbsp;##&nbsp;sethostport("192.168.2.100:5060");<BR>&nbsp;##&nbsp;# do not set the missed call flag again<BR>&nbsp;##&nbsp;t_relay();<BR>&nbsp;##}<BR>}</DIV>
<DIV>&nbsp;</DIV><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>