<!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 Friends,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>A friend of me is writing Basic Billing for SER :)
in PHP. I'm gonna place it somewhere so anyone can add remove features to it and
repost it. Will let all of you know and download it. But for now i need to
create a dial plan. I do not want to make accounting for numbers beginning with
833 prefix, is there a way for it ? Another thing is , i've tried with so many
things but always give errors in config. I have 2 x 4 Port Analog GSM
Gateways, first IP is 192.168.1.10 and second IP is 192.168.1.20, SER
Server has two ethernets, one is for Public IP 212.154.XXX.YYY for general use
and the second ethernet is 192.168.1.5 connected to HUB where Gateways's LAN is.
All ports of FXO's are registered with SER like 1111,2222,3333,4444 (Gateway A)
and 5555,6666,7777,8888 (Gateway B). I want SER to send some calls to that
numbers depending on Prefix :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Before i worked with Ondo SIP Proxy a little and
was successful with dial plan. Ex: a user dials 05353490056, proxys adds 1111
prefix, route to registered SIP client 1111 and send the call as <A
href="mailto:111105353490056@IP.of.Proxy">111105353490056@IP.of.Proxy</A> to
Gateway, prefix 1111 is stripped from SIP and the gateway connects to GSM like
<A
href="mailto:05353490056@IP.of.Gateway">05353490056@IP.of.Gateway</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Ex for Gateways:</FONT></DIV>
<DIV><FONT face=Arial size=2>* for 1111,2222,3333 and 4444 : i want to use 053
prefix, so when a user dial a number like 05353490056, SER has to route it
to 1111, if it's busy then route to 2222 so on till 4444.</FONT></DIV>
<DIV><FONT face=Arial size=2>* for 5555 and 6666 : i want to use 050 and
055 prefix, again same as above.</FONT></DIV>
<DIV><FONT face=Arial size=2>* for 7777 and 8888 : i want to use 054
prefix.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>* for prefixes apart from above and 833, i want to
route all calls to 85.96.XXX.YYY , important thing is the clients are registered
on SER but i want to route calls over from SER and by keeping their
username/password combination since the clients are created on
85.96.XXX.YYY and that Gateway does auth for users, but SER also has to do
accounting for this calls.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do i need so many things ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Ozan Blotter</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>*ps : I'm using SER 0.9.2 from CVS :)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>current SER.CFG as follows :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>[root@localhost ser]# cat
ser.cfg<BR>debug=3<BR>fork=yes<BR>log_stderror=no</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>listen=192.168.1.9
# put your server IP address here<BR>port=5060<BR>children=4</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>dns=no<BR>rev_dns=no</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>fifo="/tmp/ser_fifo"<BR>fifo_db_url="mysql://ser:heslo@localhost/ser"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>loadmodule
"/usr/local/lib/ser/modules/mysql.so"<BR>loadmodule
"/usr/local/lib/ser/modules/sl.so"<BR>loadmodule
"/usr/local/lib/ser/modules/tm.so"<BR>loadmodule
"/usr/local/lib/ser/modules/rr.so"<BR>loadmodule
"/usr/local/lib/ser/modules/maxfwd.so"<BR>loadmodule
"/usr/local/lib/ser/modules/usrloc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/registrar.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth_db.so"<BR>loadmodule
"/usr/local/lib/ser/modules/acc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/uri_db.so"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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("usrloc",
"db_mode", 1)<BR>modparam("rr", "enable_full_lr", 1)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>modparam("acc", "log_level", 1)<BR>modparam("acc",
"db_flag", 1)<BR>modparam("acc", "log_missed_flag", 3)<BR>modparam("acc",
"log_fmt", "fimos")<BR>modparam("acc", "db_url",
"mysql://ser:heslo@localhost/ser")<BR>modparam("acc", "db_missed_flag",
2)<BR>modparam("acc", "early_media", 1)<BR>modparam("acc",
"failed_transactions", 1)<BR>modparam("acc", "log_flag", 1)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>route {</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>setflag(1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# Sanity Check Section<BR> #
-----------------------------------------------------------------<BR>
if (!mf_process_maxfwd_header("10"))
{<BR>
sl_send_reply("483", "Too Many
Hops");<BR>
break;<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> if
(msg:len > max_len)
{<BR>
sl_send_reply("513", "Message
Overflow");<BR>
break;<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# Record Route Section<BR> #
-----------------------------------------------------------------<BR>
if (method!="REGISTER")
{<BR>
record_route();<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# Loose Route Section<BR> #
-----------------------------------------------------------------<BR>
if (loose_route())
{<BR>
route(1);<BR>
break;<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# Call Type Processing Section<BR> #
-----------------------------------------------------------------<BR>
if (uri!=myself)
{<BR>
route(1);<BR>
break;<BR> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if
(uri==myself)
{<BR>
if (method=="INVITE" || method=="BYE" || method=="CANCEL")
{<BR>
setflag(1);<BR>
route(3);<BR>
break;<BR>
} else if (method=="REGISTER")
{<BR>
route(2);<BR>
break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
lookup("aliases");<BR>
if (uri!=myself)
{<BR>
route(1);<BR>
break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
if (!lookup("location"))
{<BR>
if (uri=~"^sip:053[0-9]*@")
{<BR>
prefix("1111");<BR>
rewritehost
("192.168.1.10");<BR>
break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
sl_send_reply("404", "User Not
Found");<BR>
break;<BR>
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
route(1);<BR> };<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>route[1] {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# Default Message Handler<BR> #
-----------------------------------------------------------------<BR>
if (!t_relay())
{<BR>
sl_reply_error();<BR>
};<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>route[2] {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> #
-----------------------------------------------------------------<BR>
# REGISTER Message Handler<BR> #
----------------------------------------------------------------<BR>
sl_send_reply("100", "Trying");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR> 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] {<BR> #
-----------------------------------------------------------------<BR>
# INVITE Message Handler<BR> #
-----------------------------------------------------------------<BR>
if (!proxy_authorize("localhost","subscriber"))
{<BR>
proxy_challenge("localhost","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>
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> };</DIV>
<DIV> </DIV>
<DIV> route(1);<BR>}</DIV>
<DIV> </DIV>
<DIV>[root@localhost ser]#</FONT></DIV></BODY></HTML>