[sr-dev] MSLIO module issue in Kamailio3.1 behind NAT

Coca chanea at gmail.com
Tue Jul 26 22:04:55 CEST 2011


Hi list,

I have Kamailio running behind NAT.  (Amazon EC2)

When I use mslio module, storing messages for offline contact is working
fine,
however the stored messages are never sent to the contacts when they get
online.

My configuration is as below.
Any kind of help will be great appreciated.

Thank you!

----------------------------------------------------------------------------------------------------------------------
loadmodule "msilo.so"
...
modparam("msilo", "add_date", 0)
modparam("msilo", "db_url",DBURL)
...


route[REGISTRAR] {
if (is_method("REGISTER"))
{
if(isflagset(FLT_NATS))
{
setbflag(FLB_NATB);
# uncomment next line to do SIP NAT pinging
setbflag(FLB_NATSIPPING);
}
 $avp(s:fu) = $fu;
    $var(initialregister) = 1;
                if( registered("location")){
                       $var(initialregister) = 0;
                }
if (!save("location"))
sl_reply_error();

if( !is_present_hf("Expires") || $(hdr(Expires){s.int})!=0 &&
$var(initialregister)==1 ){
# Send messages recieved while offline
if (m_dump("$fu")){
                      xlog("L_INFO", "offline messages dumped for $avp(s:fu)
\n");
                }
                else{
                         xlog("L_INFO", "no offline messages dumped for
$avp(s:fu) \n");
}
}
exit;
}
}

# USER location service
route[LOCATION] {
if (!lookup("location")) {
switch ($rc) {
case -1:
                                 ...


                             if (is_method("MESSAGE")) {
     $var(m_store_owner) = $tu;
                                     if (m_store("$var(m_store_owner)"))
                    {
                      xlog("L_INFO", "(MSILO_STORE) offline message stored
for $var(m_store_owner)\n");
               if (!t_reply("202", "Accepted")) sl_reply_error();
                    }
                   else {
              xlog("L_ERR","BUG: dropped an offline MESSAGE: M=$rm S=$rs
D=$rr F=$fu T=$tu IP=$si ID=$ci UA=$ua Txt=$rb");
              if (!t_reply("503", "Service Unavailable"))  sl_reply_error();
                    };

              }
exit;

case -3:
t_newtran();
t_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}

# when routing via usrloc, log the missed calls also
if (is_method("INVITE"))
{
setflag(FLT_ACCMISSED);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20110727/ef453fe2/attachment.htm>


More information about the sr-dev mailing list