[OpenSIPS-Users] msilo problem

ASHWINI NAIDU ashwini.naidu at gmail.com
Wed May 13 16:22:37 CEST 2009


hi all,

    I am trying to implement offline messages. When a message is sent to a
user who is offline the messages are getting stored. but when the user logs
in the messages are not getting delivered. i am posting the extract of the
opensips.cfg

*route[2] {^M
    ^M
   ## Register request handler^M
    if (is_uri_host_local()) {^M
        if (!www_authorize("", "subscriber")) {^M
            www_challenge("", "1");^M
            exit;^M
        };

        if (!check_to()) {^M
            sl_send_reply("403", "Forbidden");^M
            exit;^M
        };^M
        if(!search("^Contact:[ ]*\*") && client_nat_test("7")) {^M
            log(1,"-------NAT Checking\n");^M
            setbflag(6);^M
            fix_nated_contact();^M
            force_rport();^M
        };^M
        save("location");
#--------------------------------------------------------- msilo
testing--------------------------------------------------------------------
        log(1, "REGISTER received -> dumping messages with
MSILO------------------- 1\n");
        #append_hf("Contact: $ct\r\n");
        # MSILO - dumping user's offline messages
                xlog("L_INFO","*****************************************
Request Body is :---------> $rb\n");
                if (m_dump())
                {
                        log(1, "MSILO: offline messages dumped - if they
were----------------------------------- 2\n");
                }else{
                        log(1, "MSILO: no offline messages dumped\n");
                };^M
                xlog("L_INFO,", "\n Method: [$rm] From-URI: [$fu] To URI
[$tu]  REply Status is : [$rs] ************************** Reply reason is:
[$rr]");
#---------------------------------------------------------------------------------------------------------------------------------------------------
        exit;^M
    } else if {^M
     sl_send_reply("403", "Forbidden");^M
    };^M
}^M*

.......
.......*

    if (!lookup("location")) {
#----------Storing Offline Messages----------------------------
            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(1, "MESSAGE received -> storing using MSILO\n");
            # MSILO - storing as offline message
            if (m_store("$ru"))
            {
                log(1, "MSILO: offline message stored\n");
                log(1,"MSILO: ---------------------------------------> in
lookup location------------------------------- 4\n");
                if (!t_reply("202", "Accepted"))
                {
                    sl_reply_error();
                };
            }else{
                log(1, "MSILO: offline message NOT stored\n");
                if (!t_reply("503", "Service Unavailable"))
                {
                    sl_reply_error();
                };
            };
           t_on_failure("3");
#           t_relay();^M
#-------------Finished, Storing Offline
Messages------------------------------------
if (does_uri_exist()) {^M
            ## User not registered at this time.^M
            ## Use the IP Address of your e-mail server^M
            revert_uri();^M
            prefix("u");^M
            rewritehostport("192.168.1.149"); #Use the IP address of your
voicemail server^M
            route(6);^M
       route(1);^M
        } else {^M
            sl_send_reply("404", "Not Found");^M
       exit;^M
        }   ^M
        sl_send_reply("404", "Not Found");^M
        exit;^M
            };^M
    route(6); ^M
    route(1);^M
#   }
}^M*


can anyone tell me where have i gone wrong.
-- 
Thanking You,
Ashwini BR Naidu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090513/455d3188/attachment.htm 


More information about the Users mailing list