<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-9">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear List,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV>I'm making a call to PSTN, it's okay i can talk with the other party via
ATA, but suddenly i unplug power from it, and in accounting module it does not
write line with BYE message so i cannot understand whether the call is finished
or not. only INVITE and ACK are written, no BYE :(</DIV>
<DIV> </DIV>
<DIV>This may be a security hole for customers, because they talk for a long
time and they may unplug their units or cut power so it does not tell SER it's
over. How i can prevent this, also what i need to add as a line for telling ACC
module not to write calls from 833 to 833 into database, which are free SIP2SIP
calls ?</DIV>
<DIV> </DIV>
<DIV>Btw, a Postpaid Billing System is on the way for OpenSER built in PHP,
later i will need OpenSER group's help to place it onto hosting site. Shortly it
will have features:</DIV>
<DIV> </DIV>
<DIV>* Nothing extra from package, default MySql Database which comes with
OpenSER Release is being used,</DIV>
<DIV>* All routing is done via OpenSER's ser.cfg ,</DIV>
<DIV>* Initial Rate, Initial Time, Increment Rate, Increment Time will be user
variable ,</DIV>
<DIV>* Account Creation/Deletion done in PHP ,</DIV>
<DIV>* Invoice Generation and CDR will include many variables ,</DIV>
<DIV>* Rating will be in PHP,</DIV>
<DIV>* And everything is totaly free :)</DIV>
<DIV> </DIV>
<DIV>If you have ideas and/or suggestion please write back to me so i can work
for it too.</DIV>
<DIV>Reqs: OpenSER & PHP & MySql & Apache</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Ozan</DIV>
<DIV> </DIV>
<DIV><BR>debug=3<BR>fork=yes<BR>log_stderror=no</DIV>
<DIV> </DIV>
<DIV>listen=212.XXX.104.XXX<BR>port=5060<BR>children=4</DIV>
<DIV> </DIV>
<DIV>alias=212.XXX.104.XXX</DIV>
<DIV> </DIV>
<DIV>dns=no<BR>rev_dns=no</DIV>
<DIV> </DIV>
<DIV>fifo="/tmp/openser_fifo"<BR>fifo_db_url="mysql://openser:openserrw@localhost/openser"</DIV>
<DIV> </DIV>
<DIV>loadmodule "/usr/local/lib/openser/modules/mysql.so"<BR>loadmodule
"/usr/local/lib/openser/modules/sl.so"<BR>loadmodule
"/usr/local/lib/openser/modules/tm.so"<BR>loadmodule
"/usr/local/lib/openser/modules/rr.so"<BR>loadmodule
"/usr/local/lib/openser/modules/maxfwd.so"<BR>loadmodule
"/usr/local/lib/openser/modules/usrloc.so"<BR>loadmodule
"/usr/local/lib/openser/modules/registrar.so"<BR>loadmodule
"/usr/local/lib/openser/modules/auth.so"<BR>loadmodule
"/usr/local/lib/openser/modules/auth_db.so"<BR>loadmodule
"/usr/local/lib/openser/modules/uri.so"<BR>loadmodule
"/usr/local/lib/openser/modules/uri_db.so"<BR>loadmodule
"/usr/local/lib/openser/modules/mediaproxy.so"<BR>loadmodule
"/usr/local/lib/openser/modules/nathelper.so"<BR>loadmodule
"/usr/local/lib/openser/modules/textops.so"<BR>loadmodule
"/usr/local/lib/openser/modules/domain.so"<BR>loadmodule
"/usr/local/lib/openser/modules/acc.so"</DIV>
<DIV> </DIV>
<DIV>#modparam("auth_db|uri_db|usrloc", "db_url",
"mysql://ser:heslo@localhost/ser")<BR>modparam("auth_db", "calculate_ha1",
1)<BR>modparam("auth_db", "password_column", "password")<BR>modparam("auth_db",
"use_domain", 1)</DIV>
<DIV> </DIV>
<DIV>modparam("domain", "db_mode", 1)</DIV>
<DIV> </DIV>
<DIV>modparam("nathelper", "rtpproxy_disable", 1)<BR>modparam("nathelper",
"natping_interval", 0)</DIV>
<DIV> </DIV>
<DIV>modparam("mediaproxy","natping_interval",
30)<BR>modparam("mediaproxy","mediaproxy_socket",
"/var/run/mediaproxy.sock")<BR>modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/openser/sip-asymmetric-clients")<BR>modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/openser/rtp-asymmetric-clients")</DIV>
<DIV> </DIV>
<DIV>modparam("usrloc", "db_mode", 2)<BR>modparam("usrloc", "use_domain",
1)</DIV>
<DIV> </DIV>
<DIV>modparam("registrar", "default_expires", 60)<BR>modparam("registrar",
"min_expires", 30)<BR>modparam("registrar", "nat_flag",
6)<BR>modparam("registrar", "use_domain", 1)</DIV>
<DIV> </DIV>
<DIV>modparam("rr", "enable_full_lr", 1)</DIV>
<DIV> </DIV>
<DIV>modparam("acc", "db_url",
"mysql://openser:openserrw@localhost/openser")<BR>modparam("acc", "log_level",
1)<BR>modparam("acc", "log_flag", 1)<BR>modparam("acc", "db_flag", 1)</DIV>
<DIV> </DIV>
<DIV>route {</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Sanity Check Section<BR> #
-----------------------------------------------------------------<BR>
if (!mf_process_maxfwd_header("10"))
{<BR>
sl_send_reply("483", "Too Many
Hops");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (msg:len > max_len)
{<BR>
sl_send_reply("513", "Message
Overflow");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Record Route Section and Acc
section<BR> #
-----------------------------------------------------------------<BR>
if (method=="INVITE" && client_nat_test("3"))
{<BR>
# INSERT YOUR IP ADDRESS
HERE<BR>
record_route_preset("212.XXX.104.XXX:5060;nat=yes");<BR>
} else if (method!="REGISTER")
{<BR>
record_route();<BR>
setflag(1);<BR> };</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Call Tear Down Section<BR> #
-----------------------------------------------------------------<BR>
if (method=="BYE" || method=="CANCEL")
{<BR>
end_media_session();<BR> };</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Loose Route Section<BR> #
-----------------------------------------------------------------<BR>
if (loose_route()) {</DIV>
<DIV> </DIV>
<DIV>
if (has_totag() && (method=="INVITE" || method=="ACK")) {</DIV>
<DIV> </DIV>
<DIV>
if (client_nat_test("3") || search("^Route:.*;nat=yes"))
{<BR>
setflag(6);<BR>
use_media_proxy();<BR>
};<BR>
};</DIV>
<DIV> </DIV>
<DIV>
route(1);<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Call Type Processing Section<BR> #
-----------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV> if (uri!=myself)
{<BR>
route(1);<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (uri==myself) {</DIV>
<DIV> </DIV>
<DIV>
if (method=="CANCEL")
{<BR>
route(3);<BR>
break;<BR>
} else if (method=="INVITE")
{<BR>
route(3);<BR>
break;<BR>
} else if (method=="REGISTER")
{<BR>
route(2);<BR>
break;<BR>
};</DIV>
<DIV> </DIV>
<DIV>
lookup("aliases");<BR>
if (uri!=myself)
{<BR>
route(1);<BR>
break;<BR>
};</DIV>
<DIV> </DIV>
<DIV>
if (!lookup("location"))
{<BR>
sl_send_reply("404", "User Not
Found");<BR>
break;<BR>
};<BR> };</DIV>
<DIV> </DIV>
<DIV> route(1);<BR>}</DIV>
<DIV> </DIV>
<DIV>route[1] {</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# Default Message Handler<BR> #
-----------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV> t_on_reply("1");</DIV>
<DIV> </DIV>
<DIV> if (!t_relay()) {</DIV>
<DIV> </DIV>
<DIV>
if (method=="INVITE" || method=="ACK")
{<BR>
end_media_session();<BR>
};</DIV>
<DIV> </DIV>
<DIV>
sl_reply_error();<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV>route[2] {</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# REGISTER Message Handler<BR> #
----------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV> if (!search("^Contact:\ +\*")
&& client_nat_test("7"))
{<BR>
setflag(6);<BR>
fix_nated_register();<BR>
force_rport();<BR> };</DIV>
<DIV> </DIV>
<DIV> sl_send_reply("100",
"Trying");</DIV>
<DIV> </DIV>
<DIV> if
(!www_authorize("","subscriber"))
{<BR>
www_challenge("","0");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (!check_to())
{<BR>
sl_send_reply("401",
"Unauthorized");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> consume_credentials();</DIV>
<DIV> </DIV>
<DIV> if (!save("location"))
{<BR>
sl_reply_error();<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV>route[3] {</DIV>
<DIV> </DIV>
<DIV> #
-----------------------------------------------------------------<BR>
# CANCEL and INVITE Message
Handler<BR> #
-----------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV> if (client_nat_test("3"))
{<BR>
setflag(7);<BR>
force_rport();<BR>
fix_nated_contact();<BR> };</DIV>
<DIV> </DIV>
<DIV>
lookup("aliases");<BR> if
(uri!=myself)
{<BR>
route(1);<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (uri=~"^sip:0[0-9]*@*")
{<BR>
rewritehost("212.XXX.59.XXX");<BR>
route(1);<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (!lookup("location"))
{<BR>
sl_send_reply("404", "User Not
Found");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (method=="CANCEL")
{<BR>
route(1);<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if
(!proxy_authorize("","subscriber"))
{<BR>
proxy_challenge("","0");<BR>
break;<BR> } else if (!check_from())
{<BR>
sl_send_reply("403", "Use
From=ID");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> consume_credentials();</DIV>
<DIV> </DIV>
<DIV> if (isflagset(6) ||
isflagset(7))
{<BR>
use_media_proxy();<BR> };</DIV>
<DIV> </DIV>
<DIV> route(1);<BR>}</DIV>
<DIV> </DIV>
<DIV>onreply_route[1] {</DIV>
<DIV> </DIV>
<DIV> if ((isflagset(6) ||
isflagset(7)) && (status=~"(180)|(183)|2[0-9][0-9]")) {</DIV>
<DIV> </DIV>
<DIV>
if (!search("^Content-Length:\ +0"))
{<BR>
use_media_proxy();<BR>
};<BR> };</DIV>
<DIV> </DIV>
<DIV> if (client_nat_test("1"))
{<BR>
fix_nated_contact();<BR>
};<BR>}</FONT></DIV></BODY></HTML>