Hello,

I am running a presence server. I am searching for a problem with my presence, and I have traced it down to this query :

delete from active_watchers where presentity_uri='sip:test...@domain.tld' AND event='dialog' AND to_tag='f0253efb8005057b3cc0ab8fa35ff1d9-c961'

This query is being sent to the database a few seconds after the initial subscribe is received. So the subscription only lasts in the database for a few seconds.

I tried running level 3 error reporting ( hundreds of DEBUG ). I did not see any justification for query.

Where is this query coming from ( source code/ config file )? Why is this subscription being deleted almost immediatly after it is setup ?

Thanks,

David

Here is a sample request ( not the same as the one above, I did not capture the SIP at the same time as the SQL ) :

U PROXYIP:5060 -> PRESENCEIP:5060
SUBSCRIBE sip:test...@domain.tld SIP/2.0.
Record-Route: <sip:PROXYIP;lr=on;ftag=db911ce615f1598c>.
Record-Route: <sip:TCPPROXYIP;r2=on;lr=on>.
Record-Route: <sip:TCPPROXYIP;transport=tcp;r2=on;lr=on>.
Via: SIP/2.0/UDP PROXYIP;branch=z9hG4bK9543.f0668033.0.
Via: SIP/2.0/UDP TCPPROXYIP;branch=z9hG4bK9543.d2e18073.0;i=0a3.
Via: SIP/2.0/TCP USERIP:61334;branch=z9hG4bK-6ee64c28;rport=61334.
To: sip:test...@domain.tld.
From: "103 Zone T" <sip:test...@domain.tld>;tag=db911ce615f1598c.
Call-ID: 3f55db6e-b2ec6ca4@192.168.219.109.
CSeq: 53944 SUBSCRIBE.
Max-Forwards: 68.
Contact: "103 Zone T" <sip:test103@USERIP:8280;transport=tcp>.
Accept: application/dialog-info+xml.
Expires: 1800.
Event: dialog.
User-Agent: Cisco/SPA504G-7.4.9c.
Content-Length: 0.
.

#
U PRESENCEIP:5060 -> PROXYIP:5060
SIP/2.0 202 OK.
Record-Route: <sip:PROXYIP;lr=on;ftag=db911ce615f1598c>.
Record-Route: <sip:TCPPROXYIP;r2=on;lr=on>.
Record-Route: <sip:TCPPROXYIP;transport=tcp;r2=on;lr=on>.
Via: SIP/2.0/UDP PROXYIP;branch=z9hG4bK9543.f0668033.0.
Via: SIP/2.0/UDP TCPPROXYIP;branch=z9hG4bK9543.d2e18073.0;i=0a3.
Via: SIP/2.0/TCP USERIP:61334;branch=z9hG4bK-6ee64c28;rport=61334.
To: sip:test...@domain.tld;tag=f0253efb8005057b3cc0ab8fa35ff1d9-8c10.
From: "103 Zone T" <sip:test...@domain.tld>;tag=db911ce615f1598c.
Call-ID: 3f55db6e-b2ec6ca4@192.168.219.109.
CSeq: 53944 SUBSCRIBE.
Expires: 1800.
Contact: <sip:PRESENCEIP:5060>.
Server: kamailio (3.1.5 (x86_64/linux)).
Content-Length: 0.

#!KAMAILIO
#
# $Id$
#
# simple quick-start config script
#
 
# ----------- global configuration parameters ------------------------
 
/* Uncomment these lines to enter debugging mode */
debug=2
fork=yes
log_stderror=no
 
check_via=no    # (cmd. line: -v)
dns=no          # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
alias=presence.domain.tld
listen=udp:SERVERIP:5060
children=16
 
# uncomment the following lines for TLS support
#disable_tls = 0
#listen = tls:your_IP:5061
#tls_verify_server = 1
#tls_verify_client = 1
#tls_require_client_certificate = 0
#tls_method = TLSv1
#tls_certificate = "/usr/local/etc/openser/tls/user/user-cert.pem"
#tls_private_key = "/usr/local/etc/openser/tls/user/user-privkey.pem"
#tls_ca_list = "/usr/local/etc/openser/tls/user/user-calist.pem"
 
# ------------------ module loading ----------------------------------
mpath="/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/"

loadmodule "kex.so"
loadmodule "tm.so"
loadmodule "tmx.so"

 
loadmodule "db_mysql.so"
loadmodule "sl.so"
loadmodule "xlog.so"

loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "rr.so"
loadmodule "siputils.so"
loadmodule "pv.so"
loadmodule "presence.so"
loadmodule "presence_dialoginfo.so"
loadmodule "presence_mwi.so"
#loadmodule "presence_xml.so"



loadmodule "avpops.so"
loadmodule "regex.so"
 
# ----------------- setting module-specific parameters ---------------
 
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
 
# -- presence params --
modparam("presence", "db_url", "mysql://user:pass@dbip/kamailio")
 
modparam("presence", "server_address", "sip:SERVERIP:5060")

# Damn linksys needs this value
#modparam("presence", "max_expires", 2147483647 )
modparam("presence", "max_expires",3600 )
modparam("presence", "expires_offset", 300)
#modparam("presence_xml", "force_active", 1)

modparam("presence", "fallback2db" ,1 )

modparam("presence", "db_update_period", 5);

modparam("presence_dialoginfo", "force_single_dialog", 1)
 
#modparam("mi_fifo", "fifo_name", "/tmp/")

# The following are corrections for performance on GXP phones
# RFC value 32000
modparam("tm", "wt_timer", 32000)

# -------------------------  request routing logic -------------------
 
# main routing logic
 
route{

    # initial sanity checks -- messages with
    # max_forwards==0, or excessively long requests
    if (!mf_process_maxfwd_header("10")) {
        sl_send_reply("483","Too Many Hops");
        exit;
    };
 
    if (msg:len >=  2048 ) {
        sl_send_reply("513", "Message too big");
        exit;
    };
 
    # we record-route all messages -- to make sure that
    # subsequent messages will go through our proxy; that's
    # particularly good if upstream and downstream entities
    # use different transport protocol
    if (!is_method("SUBSCRIBE|PUBLISH")) {
        sl_send_reply("488", "Not Acceptable Here");
        exit;
    }
 
    # Block retransmissions
    if (! t_newtran())
    {
            sl_reply_error();
            exit;
    };

    if(is_method("PUBLISH"))
    {
            handle_publish();
            t_release();
    } else if( is_method("SUBSCRIBE"))
    {
            handle_subscribe();
            t_release();
    };
 
    exit;
}
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to