Further below I have pasted the config with the t_on_failure("1") which gives me the error message.
By the way, I get the 404 Not found reply (result of case -3) when the user isn't registered. Shouldn't an offline user return case -1 instead?
And here's the config that prevents kamailio from starting up.
I get the following error message: (line 754, column 21 corresponds to t_on_failure("1"))
0(4603) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 754, column 21: syntax error
0(4603) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 754, column 21:
ERROR: bad config file (2 errors)
$avp(oexten) = $rU;
if (!lookup("location")) {
$var(rc) = $rc;
route(TOVOICEMAIL);
t_newtran();
switch ($var(rc)) {
case -1:
case -3:
send_reply("404", "Not found");
exit;
case -2:
send_reply("405", "Method Not Allowed");
exit;
}
}
# when routing via usrloc, log the missed calls also
if (is_method("INVITE"))
{
setflag(FLT_ACCMISSED);
}
route(RELAY);
exit;
# we do not care about anything else but MESSAGEs
if (!method=="MESSAGE")
{
if (!t_reply("404", "Not found"))
{
sl_reply_error();
};
exit;
};
log("MESSAGE received -> storing using MSILO\n");
# MSILO - storing as offline message
if (m_store("$ru"))
{
log("MSILO: offline message stored\n");
if (!t_reply("202", "Accepted"))
{
sl_reply_error();
};
}else{
log("MSILO: offline message NOT stored\n");
if (!t_reply("503", "Service Unavailable"))
{
sl_reply_error();
};
};
exit;
};
# if the downstream UA does not support MESSAGE requests
# go to failure_route[1]
t_on_failure("1");
t_relay();
exit;
};
# forward anything else
t_relay();
}
failure_route[1] {
# forwarding failed -- check if the request was a MESSAGE
if (!method=="MESSAGE")
{
exit;
};
log(1,"MSILO:the downstream UA doesn't support MESSAGEs\n");
# we have changed the R-URI with the contact address, ignore it now
if (m_store("$ou"))
{
log("MSILO: offline message stored\n");
t_reply("202", "Accepted");
}else{
log("MSILO: offline message NOT stored\n");
t_reply("503", "Service Unavailable");
};
}