[SR-Users] msilo route error

Eng Hooda eenghooda at yahoo.com
Wed Aug 17 22:22:11 CEST 2016


Hello All,
I am trying to enable msilo offline message delivery module,
I used the official technical documentation : 
https://www.kamailio.org/docs/modules/stable/modules/msilo.html
I managed to add load module statement and modparam statement without error.
At this point msilo is still not active , it was obvious that I needed to add route statement.
I copied the provided route statement , and edited it so will be similar to route functions that are already there.

that was the outcome:
# Routing to MSILO
route[MSILO] {
    #!ifdef WITH_MSILO
    if ( !mf_process_maxfwd_header("10") )
    {
        sl_send_reply("483","To Many Hops");
        exit;
    };
    if (uri==myself) {
                {
                    # for testing purposes, simply okay all REGISTERs
                    if (method=="REGISTER")
                    {
                        save("location");
                        log("REGISTER received -> dumping messages with MSILO\n");
                        # MSILO - dumping user's offline messages
                        if (m_dump())
                        {
                            log("MSILO: offline messages dumped - if they were\n");
                        }else{
                            log("MSILO: no offline messages dumped\n");
                        };
                        exit;
                    };
                    # domestic SIP destinations are handled using our USRLOC DB
                    if(!lookup("location"))
                    {
                        if (! t_newtran())
                        {
                            sl_reply_error();
                            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");
                    };
                }
                #!endif
                return;
}


but after that I restarted kamailio service and got the following errors:
root at debian:~# service kamailio restart
Job for kamailio.service failed. See 'systemctl status kamailio.service' and 'journalctl -xn' for details.
root at debian:~# systemctl status kamailio.service -l
● kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
   Loaded: loaded (/lib/systemd/system/kamailio.service; enabled)
   Active: failed (Result: exit-code) since Wed 2016-08-17 21:35:41 EET; 4s ago
  Process: 3693 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP (code=exited, status=255)
Main PID: 3470 (code=exited, status=0/SUCCESS)

Aug 17 21:35:41 debian kamailio[3693]: : <core> [cfg.y:3368]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 556, column 5: bad command
Aug 17 21:35:41 debian kamailio[3693]: : <core> [cfg.y:3368]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 613, column 12: syntax error
Aug 17 21:35:41 debian kamailio[3693]: : <core> [cfg.y:3368]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 613, column 12:
Aug 17 21:35:41 debian kamailio[3693]: ERROR: bad config file (5 errors)
Aug 17 21:35:41 debian kamailio[3693]: WARNING: <core> [ppcfg.c:221]: pp_ifdef_level_check(): different number of preprocessor directives: N(#!IF[N]DEF) - N(#!ENDIF) = 3
Aug 17 21:35:41 debian kamailio[3693]: INFO: <core> [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
Aug 17 21:35:41 debian kamailio[3693]: loading modules under config path: /usr/lib/x86_64-linux-gnu/kamailio/modules/
Aug 17 21:35:41 debian systemd[1]: kamailio.service: control process exited, code=exited status=255
Aug 17 21:35:41 debian systemd[1]: Failed to start Kamailio (OpenSER) - the Open Source SIP Server.
Aug 17 21:35:41 debian systemd[1]: Unit kamailio.service entered failed state.

line 556 is a parenthesis. {

I checked the code for missing parentheses and they are all there.
line 613 is t_relay();
also tried to run with #!define WITH_DEBUG , there was no further info to debug the cfg file.

Also I tried to mimic some cfg examples like this one : 
http://telephonynetworks.blogspot.com.eg/2012/08/configuracion-de-kamailio-33-con-nat.html

but it uses an older version of kamailio 3.3 , and I noticed considerable changes in mpath statement, so that was unsuccessful.


kamailio.cfg is attached with and without msilo route.


For the experts out there Please Advise .

system details : {(OS:Debian8 i386),(Kamailio4.4 with mySQL , UDP only)}

Thank you all in advance.


Best Regards,
Eng Hooda



More information about the sr-users mailing list