<div dir="ltr"><div><div>Hi Daniel,<br><br></div>Any thoughts on why t_on_failure("1") gives me the syntax error?<br><br></div>Thanks<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 4:31 PM, Peter Villeneuve <span dir="ltr"><<a href="mailto:petervnv1@gmail.com" target="_blank">petervnv1@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Daniel,<br><br></div>Thanks for replying.<br><br></div>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.<br>

</div>Further below I have pasted the config with the t_on_failure("1")  which gives me the error message.<br><div><br>    $avp(oexten) = $rU;<br>    if (!lookup("location")) {<br>        $var(rc) = $rc;<br>

        route(TOVOICEMAIL);<br>        t_newtran();<br>        switch ($var(rc)) {<br>            case -1:<br>            case -3:<br>                send_reply("404", "Not found");<br>                exit;<br>

            case -2:<br>                send_reply("405", "Method Not Allowed");<br>                exit;<br>        }<br>    }<br><br>    # when routing via usrloc, log the missed calls also<br>    if (is_method("INVITE"))<br>

    {<br>        setflag(FLT_ACCMISSED);<br>    }<br><br>    route(RELAY);<br>    exit;<br><br>            # we do not care about anything else but MESSAGEs<br>            if (!method=="MESSAGE")<br>            {<br>

                if (!t_reply("404", "Not found")) <br>                {<br>                    sl_reply_error();<br>                };<br>                exit;<br>            };<br>            log("MESSAGE received -> storing using MSILO\n");<br>

            # MSILO - storing as offline message<br>            if (m_store("$ru"))<br>            {<br>                log("MSILO: offline message stored\n");<br>                if (!t_reply("202", "Accepted")) <br>

                {<br>                    sl_reply_error();<br>                };<br>            }else{<br>                log("MSILO: offline message NOT stored\n");<br>                if (!t_reply("503", "Service Unavailable")) <br>

                {<br>                    sl_reply_error();<br>                };<br>            };<br>            exit;<br>        };<br><br><br></div><div>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?<br>

<br><br></div><div>And here's the config that prevents kamailio from starting up.<br>I get the following error message:  (line 754, column 21 corresponds to t_on_failure("1"))<br><br>0(4603) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 754, column 21: syntax error<br>

 0(4603) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 754, column 21: <br>ERROR: bad config file (2 errors)<br><br><br>    $avp(oexten) = $rU;<br>    if (!lookup("location")) {<br>

        $var(rc) = $rc;<br>        route(TOVOICEMAIL);<br>        t_newtran();<br>        switch ($var(rc)) {<br>            case -1:<br>            case -3:<br>                send_reply("404", "Not found");<br>

                exit;<br>            case -2:<br>                send_reply("405", "Method Not Allowed");<br>                exit;<br>        }<br>    }<br><br>    # when routing via usrloc, log the missed calls also<br>

    if (is_method("INVITE"))<br>    {<br>        setflag(FLT_ACCMISSED);<br>    }<br><br>    route(RELAY);<br>    exit;<br><br>            # we do not care about anything else but MESSAGEs<br>            if (!method=="MESSAGE")<br>

            {<br>                if (!t_reply("404", "Not found")) <br>                {<br>                    sl_reply_error();<br>                };<br>                exit;<br>            };<br>            log("MESSAGE received -> storing using MSILO\n");<br>

            # MSILO - storing as offline message<br>            if (m_store("$ru"))<br>            {<br>                log("MSILO: offline message stored\n");<br>                if (!t_reply("202", "Accepted")) <br>

                {<br>                    sl_reply_error();<br>                };<br>            }else{<br>                log("MSILO: offline message NOT stored\n");<br>                if (!t_reply("503", "Service Unavailable")) <br>

                {<br>                    sl_reply_error();<br>                };<br>            };<br>            exit;<br>        };<br><pre> # 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");
    };
}</pre><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 16, 2014 at 10:01 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    t_on_failure("1") should work fine with latest version, can you give
    the log messages with the errors?<br>
    <br>
    Cheers,<br>
    Daniel<div><div><br>
    <br>
    <div>On 16/02/14 20:41, Peter Villeneuve
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div>
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi,<br>
                  <br>
                </div>
                Can someone share a working msilo config for 4.1.1?<br>
                <br>
              </div>
              I've tried following older tutorials out there but they no
              longer seem to apply.<br>
              <br>
            </div>
            I just want to test out msilo with the default kamailio
            config in 4.1.1, but the current example in <a href="http://kamailio.org/docs/modules/4.1.x/modules/msilo.html" target="_blank">http://kamailio.org/docs/modules/4.1.x/modules/msilo.html</a>
            doesn't work for me.<br>
            <br>
          </div>
          <div>Specifically, I get an error regarding the syntax in  <br>
            <pre>t_on_failure("1");</pre>
          </div>
          <div><br>
          </div>
          Any help or pointers appreciated.<br>
          <br>
        </div>
        Thanks<br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre><span><font color="#888888">
    </font></span></blockquote><span><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>