Further below I have pasted the config with the t_on_failure("1") which gives me the error message.This is how I added msilo to the kamailio default config. It still doesn't work for me (ie. offline messages are not delivered - but that's likely me messing up the routing), but at least Kamailio starts ok.Hi Daniel,Thanks for replying.
$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;
};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"); }; }On Sun, Feb 16, 2014 at 10:01 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,
t_on_failure("1") should work fine with latest version, can you give the log messages with the errors?
Cheers,
Daniel
On 16/02/14 20:41, Peter Villeneuve wrote:
ThanksI just want to test out msilo with the default kamailio config in 4.1.1, but the current example in http://kamailio.org/docs/modules/4.1.x/modules/msilo.html doesn't work for me.I've tried following older tutorials out there but they no longer seem to apply.Hi,Can someone share a working msilo config for 4.1.1?
Specifically, I get an error regarding the syntax in
t_on_failure("1");Any help or pointers appreciated.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users