[Spce-user] SIP "MESSAGE" to offline user

andreas tseiko a.tseiko at hotmail.com
Thu May 16 08:48:46 EDT 2013


Dear Andrew,
Dear Andrew,

 

According to
your recommendations we have inserted the following configuration lines into
file  /etc/ngcp-config/templates/etc/kamailio/proxy
“kamailio.cfg.tt2”.

Nevertheless
messages cannot be stored in silo db table and though cannot be sent to sub
when he will be back on line.

Do we need
something more?

 

loadmodule
"msilo.so"

 

#!ifdef
WITH_MSILO

modparam("msilo","db_url","mysql://[%
kamailio.proxy.dbrwuser %]:[% kamailio.proxy.dbrwpw %]@[% database.dbhost %]/[%
kamailio.proxy.dbname %]")

modparam("msilo",
"db_table", "silo")

modparam("msilo","from_address","sip:registrar at xxxxxxx.local")

modparam("msilo",
"from_address", "sip:$rU at xxxxxxx.local")

modparam("msilo","contact_hdr","Contact:
<sip:registrar at xx.xx.xx.xx:5062>;msilo=yes\r\n")

modparam("msilo","content_type_hdr","Content-Type:
text/plain\r\n")

modparam("msilo","offline_message","***
User $rU is offline!")

#!endif

 

modparam("usrloc",
"db_mode", 0) initial value was “1”

 

########################################################################

#Store
messages to offline Subs

########################################################################

route

{

    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");

    };

}

 

Best regards.
> Date: Wed, 15 May 2013 16:42:41 +0200
> From: apogrebennyk at sipwise.com
> To: a.tseiko at hotmail.com
> CC: spce-user at lists.sipwise.com
> Subject: Re: [Spce-user] SIP "MESSAGE" to offline user
> 
> Hi,
> You need msilo module - it should be pretty straightforward to add it to
> kamailio config: http://kamailio.org/docs/modules/3.3.x/modules_k/msilo.html
> 
> BR,
> Andrew
> 
> On 05/15/2013 04:32 PM, andreas tseiko wrote:
> > Dear All,
> > 
> > When we send a instant message to a subcriber that is currently offline
> > the message sending is unsuccessful.
> > Is it possible this message to be stored and retrasmitted when this
> > subscriber will be again on-line?
> > If not, is there any other workaround?
> > 
> > Best regards.
> > 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20130516/e56d1a8c/attachment-0001.html>


More information about the Spce-user mailing list