[OpenSER-Users] About t_replicate

Ali Jawad ali.jawad at splendor.net
Tue Jun 3 14:42:45 CEST 2008


Hi All

 

As per previous Q "mentioned below" I did try using t_replicate however
once the client A logons on to server A it just keeps sending subscribe
requests to server B

 

Hi All

I have the following scenario
Openser Server A --> Uses Localhost MySQL Server
Openser Server B --> Uses ServerA MySQL server

Each server is in a different location.  Both servers share the same
database. I.e. in other words a user can successfully logon to either
server. Both servers have a similar configuration file. My problem at
hand is the following

User A and User C logon to Server A
User  B logs on to Server B

User A and User C can call each other.

How can User A and C communicate with user B ?

Can anyone provide me with a working example.

 

 

My Config

 

####### Modules Section ########

 

#set module path

mpath="/usr/local/lib/openser/modules/"

 

/* uncomment next line for MySQL DB support */

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 "mi_fifo.so"

loadmodule "uri_db.so"

loadmodule "uri.so"

loadmodule "xlog.so"

loadmodule "auth.so"

loadmodule "auth_db.so"

 

# ----- rr params -----

# add value to ;lr param to cope with most of the UAs

modparam("rr", "enable_full_lr", 1)

# do not append from tag to the RR (no need for this script)

modparam("rr", "append_fromtag", 0)

 

 

# ----- rr params -----

modparam("registrar", "method_filtering", 1)

/* uncomment the next line to disable parallel forking via location */

# modparam("registrar", "append_branches", 0)

/* uncomment the next line not to allow more than 10 contacts per AOR */

#modparam("registrar", "max_contacts", 10)

 

 

# ----- uri_db params -----

modparam("uri_db", "use_uri_table", 0)

modparam("uri_db", "db_url", "mysql://db_string")

 

# ----- usrloc params -----

modparam("usrloc", "db_mode",   3)

modparam("usrloc", "db_url","mysql://db_string")

 

# ----- auth_db params -----

modparam("auth_db", "calculate_ha1", yes)

modparam("auth_db", "password_column", "password")

modparam("auth_db", "use_domain", 0)

modparam("auth_db", "db_url","mysql://db_string")

 

 

 

modparam("usrloc", "db_url","mysql://db_string")

 

# ----------------- setting module-specific parameters ---------------

 

# -- mi_fifo params --

 

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo_xmpp")

 

# -- usrloc params --

 

# -- rr params --

# add value to ;lr param to make some broken UAs happy

modparam("rr", "enable_full_lr", 1)

 

###### Routing Logic ########

 

 

route

{

        if(!mf_process_maxfwd_header("10")){

                sl_send_reply("486", "To Many Hops");

                return;

        }

 

        if(msg:len >= max_len){

                sl_send_reply("513", "Message To Big");

                return;

        }

 

        

        

        #########End of XMPP Section ###################

        

        

        if(!is_method("REGISTER")){

                record_route();

        }

 

        if(loose_route()){

                route(1);

                return;

        }

 

        if(uri == myself){

                if(is_method("REGISTER")){

                        if(!www_authorize("mydomain.net",
"subscriber")){

                                www_challenge("mydomain.net", "1");

                                return;

                        }

 

                        save("location");

                        if(!src_ip==xx.yy.zz.12)

                        {

                          t_replicate("xx.yy.zz.12", "5060");

                        };

                       return;

                                               

 

                }

 

                if(does_uri_exist()){

                        # local uri does exist, is probably a user.

 

                        # lookup location

                        if(lookup("location")){

                        route(1);

                        return;

                        }

                } else {

                        # probably a call to pstn....

                        route(2);

                        return;

                }

        }

}

 

route[1] {

 

          

        # for INVITEs enable some additional helper routes

        if (is_method("INVITE")) {

                t_on_branch("2");

                t_on_reply("2");

                t_on_failure("1");

        }

 

        if (!t_relay()) {

                sl_reply_error();

        };

        exit;

}

 

route[2]

{

        # pstn handling, simply route out to pstn.

         xlog("L_INFO","rewritehostport to Splendor_VOIP_GW:5065");

         sl_send_reply("100","Call Going To PSTN");

         sethostport("xx.yy.zz.39");

         route(1);

}

 

/*

route[2] {

# for INVITEs enable some additional helper routes

       rewritehostport ("xx.yy.zz.39:5060");

       xlog("L_INFO","rewritehostport to Splendor_VOIP_GW:5065");

       route(1);

}

*/                   

 

# Presence route

/* uncomment the whole following route for enabling presence

   NOTE: do not forget to enable the call of this route from the main

     route */

 

branch_route[2] {

        xlog("new branch at $ru\n");

}

 

 

onreply_route[2] {

        xlog("incoming reply\n");

}

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20080603/8db6e58e/attachment.htm 


More information about the Users mailing list