[Serusers] ser.cfg for VRRP protocol => using t_replicate for 2 proxies
Steve Blair
blairs at isc.upenn.edu
Thu Jun 15 11:00:49 CEST 2006
Shenen Shenen wrote:
> Hi!I've 2 asterisk at home and I use openser becouse I want use more
> proxies for my softphones;my problem is this:
> I'm using vrrp protocol;
> 192.168.25.1 <http://192.168.25.1/> is the master (asterisk1)
> 192.168.25.2 <http://192.168.25.2/> is the slave (asterisk2)
> 192.168.25.200 <http://192.168.25.200/> is the virtual IP.
> then I have my softphones on a Xp pc with IP 192.168.25.10
> <http://192.168.25.10/>
>
> I set my softphones with 192.168.25.200 <http://192.168.25.200/> and
> they run, only that, the problem with asterisk is that softphones and
> IP phones(some like wi-fi) can register only one proxy, and asterisk
> can't make a option for more proxies than one;so the proxy is the
> 192.168.25.200 <http://192.168.25.200/>, but at real it is
> 192.168.25.1..and softphones or wi-fi are registered only in the first
> asterisk with the 192.168.25.1..if the master falls down the slave
> hasn't the authentication SIP registration...only the master..So I
> must use openser or ser to have 2 = box
>
> my problem is resolved only if I use the redirect option to have 2 =
> asterisk box so the database can be opened and read from one asterisk
> to the other;if the master falls down the slave has all the
> configuration and the SIP registration, so it can work without problems.
>
> A) I've set this file on asterisk 192.168.25.1 <http://192.168.25.1/>
> the master
>
> #
> # $Id: replicate.cfg,v 1.2 2005/07/25 16:27:33 miconda Exp $
> #
> # demo script showing how to set-up usrloc replication
> #
>
> # ----------- global configuration parameters ------------------------
>
> debug=3 # debug level (cmd line: -dddddddddd)
> fork=no
> log_stderror=yes # (cmd line: -E)
>
> # ------------------ module loading ----------------------------------
>
> loadmodule "modules/mysql/mysql.so"
> loadmodule "modules/sl/sl.so"
> loadmodule "modules/tm/tm.so"
> loadmodule "modules/maxfwd/maxfwd.so"
> loadmodule "modules/usrloc/usrloc.so"
> loadmodule "modules/registrar/registrar.so"
> loadmodule "modules/auth/auth.so"
> loadmodule "modules/auth_db/auth_db.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # digest generation secret; use the same in backup server;
> # also, make sure that the backup server has sync'ed time
> modparam("auth", "secret", "alsdkhglaksdhfkloiwr")
>
> # ------------------------- request routing logic -------------------
>
> # main routing logic
>
> route{
>
> # initial sanity checks -- messages with
> # max_forwars==0, or excessively long requests
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> return;
> };
> if (len_gt( max_len )) {
> sl_send_reply("513", "Message too big");
> return;
> };
>
> # 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 (uri==myself) {
>
> if (method=="REGISTER") {
>
> # verify credentials
> if (!www_authorize("", "subscriber")) {
> www_challenge("", "0");
> return;
> };
>
> # if ok, update contacts and ...
> save("location");
> # ... if this REGISTER is not a replica from our
> # peer server, replicate to the peer server
> if (!src_ip== 192.168.25.2 <http://192.168.25.2/>) {
> t_replicate("192.168.25.2 <http://192.168.25.2/>", "5060");
> };
> return;
> };
> # do whatever else appropriate for your domain
> log("non-REGISTER\n");
> };
> }
>
>
>
> B) I've set this file on asterisk 192.168.25.2 <http://192.168.25.2/>
> the slave
>
>
> #
> # $Id: replicate.cfg,v 1.2 2005/07/25 16:27:33 miconda Exp $
> #
> # demo script showing how to set-up usrloc replication
> #
>
> # ----------- global configuration parameters ------------------------
>
> debug=3 # debug level (cmd line: -dddddddddd)
> fork=no
> log_stderror=yes # (cmd line: -E)
>
> # ------------------ module loading ----------------------------------
>
> loadmodule "modules/mysql/mysql.so"
> loadmodule "modules/sl/sl.so"
> loadmodule "modules/tm/tm.so"
> loadmodule "modules/maxfwd/maxfwd.so"
> loadmodule "modules/usrloc/usrloc.so"
> loadmodule "modules/registrar/registrar.so"
> loadmodule "modules/auth/auth.so"
> loadmodule "modules/auth_db/auth_db.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # digest generation secret; use the same in backup server;
> # also, make sure that the backup server has sync'ed time
> modparam("auth", "secret", "alsdkhglaksdhfkloiwr")
>
> # ------------------------- request routing logic -------------------
>
> # main routing logic
>
> route{
>
> # initial sanity checks -- messages with
> # max_forwars==0, or excessively long requests
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> return;
> };
> if (len_gt( max_len )) {
> sl_send_reply("513", "Message too big");
> return;
> };
>
> # 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 (uri==myself) {
>
> if (method=="REGISTER") {
>
> # verify credentials
> if (!www_authorize("", "subscriber")) {
> www_challenge("", "0");
> return;
> };
>
> # if ok, update contacts and ...
> save("location");
> # ... if this REGISTER is not a replica from our
> # peer server, replicate to the peer server
> if (!src_ip== 192.168.25.1 <http://192.168.25.1/>) {
> t_replicate("192.168.25.1 <http://192.168.25.1/>", "5060");
> };
> return;
> };
> # do whatever else appropriate for your domain
> log("non-REGISTER\n");
> };
> }
>
> Must I call this file ser.cfg?Right?Must I set the
>
No you can call it whatever you want. Start SER with the -f option or
modify the STARTOPTIONS statement in serctl to point to the
configuration file you wish to use.
> on the master
>
> listen=192.168.25.1 <http://192.168.25.1/> #on the master
>
> port=5060
>
> on the slave
>
> listen=192.168.25.2 <http://192.168.25.2/> #on the slave
>
> port=5060
>
>
>
> Then I use on all the 2 linux;
>
> #chkconfig -add ser
>
> #chkconfig -add mediaproxy
>
> And ser and mediaproxy works like deamon every time I start-up the 2
> linux.
>
> Is it right to add this 2 sip number in openser or ser in this
> way?(they're registered in asterisk and 650 is a number from a X-lite,
> 651 from Phoner)
>
> serctl add 650 1234 650 at 192.168.25.200
> <mailto:650 at 192.168.25.200> [mailto: 650 at 192.168.25.200
> <mailto:650 at 192.168.25.200>]
> serctl add 651 1234 651 at 192.168.25.200
> <mailto:651 at 192.168.25.200> [mailto: 651 at 192.168.25.200
> <mailto:651 at 192.168.25.200>]
>
> Is it right this configuration?If the master falls down the slave has
> all the Sip registration authentificated and run without any problem?
>
You'd want to add the alias statement on each SER so that each one knows
it "owns" 192.168.2.200.
> 100000 thanks!
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Serusers mailing list
>Serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
>
>
More information about the sr-users
mailing list