[OpenSIPS-Users] No Presence NOTIFY - When a Contact comes online

Manivasagam Sivaraman smvasagam2000 at gmail.com
Sat Oct 24 21:49:30 CEST 2009


I'm using non rls presence mode. When a user logs in , he gets the latest
presence for all the users correctly who are online at that time, and if any
of the online users goes offline I get NOTIFY as well. In this logged in
state, if any other user newly logs in , this presentity is not getting
NOTIFIED by the presence server. The newly logged in user gets all the
presence NOTIFIES (incl his own) correctly. I can reproduce this almost
every time. I'm not sure if my config is wrong or there is a bug.

Please help.

Here is my config.

#auto_aliases=no

loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri_db.so"
loadmodule "uri.so"
loadmodule "xlog.so"
loadmodule "acc.so"
loadmodule "nathelper.so"
loadmodule "mi_xmlrpc.so"
modparam("mi_xmlrpc", "log_file", "/var/log/openser-xmlrpc.log")
modparam("mi_xmlrpc", "port", 8000)
modparam("usrloc", "nat_bflag", 6)

# -- nathelper params --
modparam("nathelper", "rtpproxy_sock", "udp:localhost:22222")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper|registrar", "received_avp", "$avp(i:42)")
modparam("nathelper", "sipping_from",
"sip:pinger at sips01.smithmicro.com<sip%3Apinger at sips01.smithmicro.com>
")

loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "alias_db.so"

#loadmodule "domain.so"

loadmodule "presence.so"
loadmodule "presence_xml.so"
loadmodule "presence_mwi.so"
loadmodule "pua.so"
loadmodule "pua_mi.so"
#loadmodule "rls.so"

# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)

# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)

# ----- registrar params -----
modparam("registrar", "method_filtering", 1)

# ----- usrloc params -----
modparam("usrloc", "db_mode",   0)
/* uncomment the following lines if you want to enable DB persistency
   for location entries */
modparam("usrloc", "db_mode",   2)
modparam("usrloc", "db_url",
        "mysql://opensips:opensipsrw@localhost/opensips")

modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url", "")

# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)

modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
        "mysql://opensips:opensipsrw@localhost/opensips")
modparam("auth_db", "load_credentials", "")


modparam("alias_db", "db_url",
        "mysql://opensips:opensipsrw@localhost/opensips")

# ----- presence params -----
/* uncomment the following lines if you want to enable presence */
modparam("presence|presence_xml", "db_url",
        "mysql://opensips:opensipsrw@localhost/opensips")
modparam("presence", "server_address", "sip:63.148.166.215:5060")
modparam("presence", "fallback2db", 1)
modparam("presence", "clean_period",  30)

# -- xcap params --
modparam("presence_xml", "db_url", "mysql://opensips:opensipsrw@localhost
/opensips")
modparam("presence_xml", "force_active", 1)
modparam("presence_xml", "pidf_manipulation", 1)
modparam("presence_xml", "integrated_xcap_server", 0)
modparam("presence_xml", "xcap_server", "localhost:9080")
# -- rr params --
#modparam("rr", "enable_full_lr", 1)


route {
  if (method!="REGISTER") {
    record_route();
  };

  if (loose_route()) {
    append_hf("P-Hint: rr-enforced");
    if (method=="INVITE") {
      if (!proxy_authorize("","subscriber")) {
        proxy_challenge("","0");
        return;
      } else if (!check_from()) {
        sl_send_reply("403", "Use From=ID");
        return;
      };
      consume_credentials();
      if (nat_uac_test("19")) {
        setbflag(6);
        force_rport();
        fix_nated_contact();
      };
      force_rtp_proxy("l");
    };
    if (method=="ACK") {
      if (nat_uac_test("19")) {
        setbflag(6);
        force_rport();
        fix_nated_contact();
      };
    }
  route(1);
  return;
};
# -----------------------------------------------------------------
# Call Type Processing Section
# -----------------------------------------------------------------
if (uri!=myself) {
    route(4);
    route(1);
    return;
  };
 if (method=="REGISTER") {
    route(2);
    return;
  } else if (method=="SUBSCRIBE") {
    route(3);
    return;
  } else if (method=="PUBLISH") {
    route(3);
    return;
  };
  lookup("aliases");
  if (uri!=myself) {
    append_hf("P-Hint: outbound alias");
    route(4);
    route(1);
    return;
  };
  if (!lookup("location")) {
    sl_send_reply("404", "User Not Found");
    return;
  };
  append_hf("P-Hint: usrloc applied");
  route(1);
}
route[1] {
  # -----------------------------------------------------------------
  # Default Message Handler
  # -----------------------------------------------------------------
  t_on_reply("1");
  if (!t_relay()) {
    if (method=="INVITE" && isbflagset(6)) {
      unforce_rtp_proxy();
    };
    sl_reply_error();
  };
}
route[3] {
  if (nat_uac_test("19")) {
    setbflag(6);
  }
  lookup("aliases");
  if (uri!=myself) {
    route(4);
    route(1);
    return;
  };
  if (!lookup("location")) {
    if(method!="SUBSCRIBE" && method!="MESSAGE") {
        sl_send_reply("404", "User Not Found");
        return;
    }
  }
  route(4);
  route(1);
}
route[4] {
if ( isbflagset(6) )
{
    ## Added for Subscribes
    if (method=="SUBSCRIBE") {
            # in-dialog subscribe request
            # mani added 2 following line to fix subscribe contact
            if (nat_uac_test("1")) {
            fix_nated_contact();
            }
            route(5);
            return;
    }
    else  if (method=="PUBLISH") {
           # publish
           route(5);
           return;
    }
    fix_nated_contact();
}
# !! Presence handling
route[5]
{
        if (!t_newtran())
        {
                sl_reply_error();
                exit;
        };
        if(is_method("PUBLISH"))
        {
                handle_publish();
        }
        else
        if( is_method("SUBSCRIBE"))
        {
                handle_subscribe();
        }
        exit;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20091024/7461d8a4/attachment-0001.htm 


More information about the Users mailing list