t_on_failure("1") works fine, I just gave it a try.

Check the curly braces to be sure the route block doesn't end before th t_on_failure.

Cheers,
Daniel

On 05/03/14 20:49, Peter Villeneuve wrote:
Sorry to bug you, but I never got any feedback on this, and I can't get msilo working.

Any hints/thoughts?

Cheers


On Tue, Feb 18, 2014 at 1:02 PM, Peter Villeneuve <peterv...@gmail.com <mailto:peterv...@gmail.com>> wrote:

    Hi Daniel,

    Any thoughts on why t_on_failure("1") gives me the syntax error?

    Thanks


    On Mon, Feb 17, 2014 at 4:31 PM, Peter Villeneuve
    <peterv...@gmail.com <mailto:peterv...@gmail.com>> wrote:

        Hi Daniel,

        Thanks for replying.

        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.
        Further below I have pasted the config with the
        t_on_failure("1")  which gives me the error message.

            $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
        <mico...@gmail.com <mailto:mico...@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:
            Hi,

            Can someone share a working msilo config for 4.1.1?

            I've tried following older tutorials out there but they
            no longer seem to apply.

            I 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.

            Specifically, I get an error regarding the syntax in
            t_on_failure("1");

            Any help or pointers appreciated.

            Thanks


            _______________________________________________
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
list
            sr-users@lists.sip-router.org  
<mailto: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://twitter.com/#%21/miconda>  
-http://www.linkedin.com/in/miconda


            _______________________________________________
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list
            sr-users@lists.sip-router.org
            <mailto: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

Reply via email to