yes i shall post the entire code .. i have marked it by using *******, that s exactly where the code is..
debug=5 # debug level (cmd line: -dddddddddd)
fork=no # don't fork
log_stderror=yes # log to stderr (cmd line: -E)
children=0 # number of children
check_via=no # (cmd. line: -v)
dns=off # (cmd. line: -r)
rev_dns=off # (cmd. line: -R)
port=5065
listen=192.168.64.75
alias="stefan.lo"
# ------------------ module loading ----------------------------------
mpath="/usr/local//lib/kamailio/modules/"
loadmodule "db_mysql.so"
loadmodule "textops.so"
loadmodule "usrloc.so"
loadmodule "maxfwd.so"
loadmodule "imc.so"
loadmodule "tm.so"
loadmodule "sl.so"
loadmodule "xlog.so"
loadmodule "mi_fifo.so"
loadmodule "registrar.so"
# ----------------- setting module-specific parameters ---------------
# -- mi_fifo params --
##modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# -- usrloc params --
modparam("usrloc", "db_mode", 2)
# -- registrar params --
modparam("registrar", "default_expires", 120)
# -- registrar params --
modparam("usrloc", "db_mode", 0)
# -- imc params --
modparam("imc", "imc_cmd_start_char", "#")
modparam("imc|usrloc", "db_url", "mysql://openser

penserrw@192.168.64.75/openser")
# -- tm params --
modparam("tm", "fr_timer", 10 )
modparam("tm", "fr_inv_timer", 15 )
modparam("tm", "wt_timer", 10 )
route{
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
drop();
};
# registrations -
if(is_method("REGISTER")) {
save("location");
exit;
}
##if(uri=~"sip:q*@")
## if(uri=~"sip:chat-0000@192.168.64.75")
##the below line has been edited by Rajesh.
if(uri=~"sip:chat0000@192.168.64.75")
{
# IMC - message
**************************************************************************************************
xdbg("script: message from [$fu ] chat0000 [$ru ] msg [$rb]\n");
if(is_method("MESSAGE"))
{
log("MESSAGE received -> processing with imc\n");
sl_send_reply("200", "ok");
imc_manager();
exit;
} else {
sl_send_reply("404", "not found");
exit;
};
} else {
xdbg("script: message not for room, from [$fu ] r-uri [$ru] msg [$rb]\n");
if(!lookup("location"))
{
sl_send_reply("404", "not found");
exit;
}
t_relay();
#sl_send_reply("200", "ok");
exit();
};
}