When a client sends a SUBSCRIBE with Expires: 0, Kamailio responds correctly with a "202 OK".
But then Kamailio sends a NOTIFY to the same client with "Subscription-State: terminated;reason=timeout". The client rejects this NOTIFY with a "481 Dialog/Transaction Does Not Exist". Why does Kamailio send this NOTIFY, and is there any way to fix or disable it because it's always rejected by the client? The client is IMSDroid, and Kamailio is 5.2.2 with a default configuration.
Packet 1 = Client sending SUBSCRIBE with Expires: 0
SUBSCRIBE sip:X.X.X.X:443;transport=tcp SIP/2.0Via: SIP/2.0/TCP 192.168.0.21:45336;branch=z9hG4bK-670576127From: sip:username@domain.com;tag=1372208921To: sip:kamailio.domain.com;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6Contact: sip:username@192.168.0.21:45336;transport=tcpCall-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 1321654295 SUBSCRIBEExpires: 0Content-Length: 299Max-Forwards: 70Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFERAccept: application/pidf+xmlEvent: presence
Packet 2 = Kamailio responding with 202 OK
SIP/2.0 202 OKVia: SIP/2.0/TCP 192.168.0.21:45336;branch=z9hG4bK-670576127From: sip:username@domain.com;tag=1372208921To: sip:kamailio@domain.com;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6Call-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 1321654295 SUBSCRIBEExpires: 0Contact: sip:X.X.X.X:443;transport=tcpServer: kamailio (5.2.2 (x86_64/linux))Content-Length: 0
Packet 3 = Kamailio sending a NOTIFY
NOTIFY sip:username@192.168.0.21:45336;transport=tcp SIP/2.0Via: SIP/2.0/TCP X.X.X.X:443;branch=z9hG4bKefe7.5f8ec435000000000000000000000000.0To: sip:username@domain.com;tag=1372208921From: sip:kamailio@domain.com;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6CSeq: 3 NOTIFYCall-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0Content-Length: 0Max-Forwards: 70Event: presenceContact: sip:X.X.X.X:443;transport=tcpSubscription-State: terminated;reason=timeout
Packet 4 = Client responding to the NOTIFY with "481 Dialog/Transaction Does Not Exist"
SIP/2.0 481 Dialog/Transaction Does Not ExistVia: SIP/2.0/TCP X.X.X.X:443;branch=z9hG4bKefe7.5f8ec435000000000000000000000000.0From: sip:kamailio@domain.com;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6To: sip:username@domain.com;tag=1372208921Call-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 3 NOTIFYContent-Length: 0
There are two entries in the Kamailio log:
INFO: {1 1321654295 SUBSCRIBE e8cffa8f-948d-eb99-69ca-c9f18bdf11a0} presence [notify.c:1614]: send_notify_request(): NOTIFY sip:username@domain.com via sip:Y.Y.Y.Y:45336;transport=tcp on behalf of sip:kamailio.domain.com for event presence : e8cffa8f-948d-eb99-69ca-c9f18bdf11a0 ERROR: {2 3 NOTIFY e8cffa8f-948d-eb99-69ca-c9f18bdf11a0} presence [subscribe.c:497]: delete_subs(): Failed to delete subscription from memory [slot: 174 ev: sip:kamailio.domain.com pu: presence ci: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0 ft: 1372208921 tt: c4eb72dabf44e7588b972bd3b454ea11-0cd6]
These are the presence settings in the Kamailio config file:
#!ifdef WITH_PRESENCE# ----- presence params -----modparam("presence", "db_url", DBURL)modparam("presence", "send_fast_notify", 0) # ----- presence_xml params -----modparam("presence_xml", "db_url", DBURL)modparam("presence_xml", "force_active", 1)modparam("presence_xml", "force_dummy_presence", 0)#!endif
Appreciate your help.