////////////////////////////////////////////////////////////////////////////////////// ser.cfg ***************** debug=4 # debug level (cmd line: -dddddddddd) #fork=yes # (cmd. line: -D) fork=no log_stderror=yes # (cmd line: -E) #log_stderror=no # (cmd line: -E) children=2 check_via=no # (cmd. line: -v) dns=off # (cmd. line: -r) rev_dns=off # (cmd. line: -R) port=5060 listen=sip.server.net listen=192.168.1.70 fifo="/tmp/ser_fifo" #fifo="/tmp/ser_fifoql://ser:heslo@localhost/ser" # for more info: sip_router -h # ------------------ module loading ---------------------------------- #modules loadmodule "/usr/local/lib/ser/modules/print.so" loadmodule "/usr/local/lib/ser/modules/textops.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/jabber.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/pa.so" # ----------------- setting module-specific parameters --------------- # -- registrar params -- modparam("registrar", "default_expires", 120) modparam("registrar", "use_domain", 1) # -- usrloc params -- modparam("usrloc", "use_domain", 1) modparam("usrloc", "db_mode", 0) # -- jabber params -- modparam("jabber","db_url","mysql://jabber:jabber@127.0.0.1/sip_jab") modparam("jabber","jaddress","jabber.server.net") modparam("jabber","jport",5222) modparam("jabber","workers",2) modparam("jabber","max_jobs",10) modparam("jabber","cache_time",200) modparam("jabber","delay_time",60) modparam("jabber","jdomain","jabber.server.net=*") route{ #if ( !mf_process_maxfwd_header("10") ) #{ # sl_send_reply("483","To Many Hops"); # drop(); #}; if (uri=~"[@:]sip\.server\.net([;:].*)*") #if (uri=~"^sip:(.+@)?(192\.168\.1\.70|(jabber\.)?server\.net)([:;\?].*)?$") { # for testing purposes, simply okay all REGISTERs if (method=="REGISTER") { if (t_newtran()) { save("location"); log("REGISTER received -> reply okay\n"); }; if(search("registration")) { log("XJAB: Going ONline in Jabber network!!!!\n"); if(jab_go_online()) { sl_send_reply("200", "Accepted"); } else { sl_send_reply("404","Not found"); }; } else { log("XJAB: Going OFFline in Jabber network!!!!\n"); if(jab_go_offline()) { sl_send_reply("200", "Accepted"); } else { sl_send_reply("404","Not found"); }; }; break; }; if (method=="SUBSCRIBE") { log("XJAB:methode SUBSCRIBE \n"); if(jab_go_offline()) if (t_newtran()) { log("XJAB: subscribe registrar\n"); # subscribe("registrar"); handle_subscription("registrar"); }; break; }; if(!lookup("location")) { sl_send_reply("404","Not found"); break; }; }; if (search("To:.*@jabber\.server\.net")) { log("XJAB : search for jabber.sofiphone.net /n"); if (! t_newtran()) { sl_reply_error(); break; }; if (method=="MESSAGE") { log("MESSAGE received -> manage it with XJAB\n"); if(search("\n:on")) { if (jab_go_online()) { sl_send_reply("200","Accepted"); }else{ sl_send_reply("404","Not found"); }; break; }; if(search("\n:off")) { if (jab_go_offline()) { sl_send_reply("200","Accepted"); }else{ sl_send_reply("404","Not found"); }; break; }; if(search("\n:join")) { if (jab_join_jconf()) { sl_send_reply("200","Accepted"); }else{ sl_send_reply("404","Not Found"); }; break; }; if(search("\n:exit")) { if (jab_exit_jconf()) { sl_send_reply("200","Accepted"); }else{ sl_send_reply("404","Not Found"); }; break; }; if (jab_send_message()) { sl_send_reply("200","Accepted"); }else{ sl_send_reply("503","Service Unavailable"); }; break; }; if (method=="SUBSCRIBE") { log("subscribe jabber /n"); # subscribe("jabber"); handle_subscription("jabber"); break; }; log("NON_Message request received for JABBER gateway->dropt!\n"); sl_send_reply("202","Accepted"); break; }; if (!t_relay()) { sl_reply_error(); }; #forward(uri:host,uri:port); } /////////////////////////////////////////////////////////////////////////////////////