# $Id: infosips_presence.cfg 30-05-2007 # # Simple quick-start config script for the infosips to act as a presence server # To be used with the Open Source IMS Core http://www.openimscore.org # and the UCTIMSClient http://www.uctimsclient.berlios.de # Please refer to the Core CookBook at http://www.infosips.org/dokuwiki/doku.php # for a explanation of possible statements, functions and parameters. # # ----------- global configuration parameters ------------------------ debug=8 log_stderror=no fork=yes log_stderror=no # (cmd line: -E) children=4 # Uncomment these lines to enter debugging mode #fork=no #log_stderror=yes listen=172.18.1.134 port=5065 alias=presence1.info-spectrum.com:5065 # uncomment the following lines for TLS support #disable_tls = 0 #listen = tls:your_IP:5061 #tls_verify_server = 1 #tls_verify_client = 1 #tls_require_client_certificate = 0 #tls_method = TLSv1 #tls_certificate = "/etc/infosips/tls/user/user-cert.pem" #tls_private_key = "/etc/infosips/tls/user/user-privkey.pem" #tls_ca_list = "/etc/infosips/tls/user/user-calist.pem" # ------------------ module loading ---------------------------------- #set module path mpath="/usr/local/lib64/infosips/modules/" # Uncomment this if you want to use SQL database loadmodule "db_mysql.so" loadmodule "sl.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "presence.so" loadmodule "presence_xml.so" loadmodule "maxfwd.so" loadmodule "usrloc.so" loadmodule "registrar.so" loadmodule "textops.so" loadmodule "mi_fifo.so" loadmodule "pua.so" loadmodule "pua_usrloc.so" #loadmodule "xcap_client.so" # Uncomment this if you want digest authentication # db_mysql.so must be loaded ! #loadmodule "auth.so" #loadmodule "auth_db.so" # ----------------- setting module-specific parameters --------------- # -- mi_fifo params -- modparam("mi_fifo", "fifo_name", "/tmp/infosips_fifo") # -- usrloc params -- modparam("usrloc", "db_mode", 2) modparam("usrloc", "db_url", "mysql://infosips:infosipsrw@localhost/infosips") # Uncomment this if you want to use SQL database # for persistent storage and comment the previous line #modparam("usrloc", "db_mode", 2) # -- auth params -- # Uncomment if you are using auth module # #modparam("auth_db", "calculate_ha1", yes) # # If you set "calculate_ha1" parameter to yes (which true in this config), # uncomment also the following parameter) # #modparam("auth_db", "password_column", "password") # -- rr params -- # add value to ;lr param to make some broken UAs happy modparam("rr", "enable_full_lr", 1) # -- presence params -- modparam("presence", "db_url", "mysql://infosips:infosipsrw@localhost/infosips") modparam("presence", "presentity_table", "presentity") modparam("presence", "active_watchers_table", "active_watchers") #modparam("presence", "watchers_table", "watchers") #modparam("presence", "xcap_table", "xcaps") #modparam("xcap_client", "xcap_table", "xcaps") modparam("presence", "clean_period", 100) modparam("presence", "to_tag_pref", 'a') #modparam("presence", "lock_set_size", 8) modparam("presence", "expires_offset", 10) #modparam("presence", "force_active", 1) modparam("presence_xml", "force_active", 1) modparam("presence", "max_expires", 3600) modparam("presence", "server_address", "sip:localhost:5065") #PUA -- modparam("pua", "db_url", "mysql://infosips:infosipsrw@localhost/infosips") modparam("pua_usrloc", "default_domain", "172.18.1.134") #modparam("pua_usrloc","presence_server", "sip:alice@info-spectrum:5065") # ------------------------- request routing logic ------------------- # main routing logic route{ # initial sanity checks -- messages with # max_forwards==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; }; # 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) # presence handling if(method=="PUBLISH"){ route(2); } if(method=="SUBSCRIBE"){ route(2); } if(method=="NOTIFY"){ pua_update_contact(); } route(1); } route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; exit; } # presence handling route route[2] { # absorb retransmissions if (! t_newtran()) { sl_reply_error(); exit; }; if(is_method("PUBLISH")) { setdsturi("sip:172.18.1.134:5070"); send_publish(); route(1); #pua_update_contact(); #handle_publish(); #t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); }; exit; }