Hi all,
I am using Kamailio 4.3 as Presence server and I have a question regarding NOTIFY messages sent after publication status refresh. When PUA sends refreshing PUBLISH request (before expiration) Kamailio sends NOTIFY request. Large number of watchers per one presentity causes large traffic.
RFC3265 states: NOTIFY messages are sent to inform subscribers of changes in state to which the subscriber has a subscription.
But when publication is only refreshed (publication expiration is extended) the publish state is not changed (PUBLISH without XML body).
From RFC5839: The SIP PUBLISH [RFC3903] method uses a similar mechanism,
where a refresh of a publication is done by reference to its assigned entity-tag, instead of retransmitting the event state each time the publication expiration is extended.
Is it possible to configure Kamailio that wouldn't send NOTIFY request to watchers when publication status refresh (PUBLISH without XML Body) occur?
Can anyone help?
Thanks in advance,
Ales
Hello,
On 20/01/16 12:34, Aleš Šturm wrote:
Hi all,
I am using Kamailio 4.3 as Presence server and I have a question regarding NOTIFY messages sent after publication status refresh. When PUA sends refreshing PUBLISH request (before expiration) Kamailio sends NOTIFY request. Large number of watchers per one presentity causes large traffic.
RFC3265 states: NOTIFY messages are sent to inform subscribers of changes in state to which the subscriber has a subscription.
But when publication is only refreshed (publication expiration is extended) the publish state is not changed (PUBLISH without XML body).
From RFC5839: The SIP PUBLISH [RFC3903] method uses a similar mechanism, where a refresh of a publication is done by reference to its assigned entity-tag, instead of retransmitting the event state each time the publication expiration is extended.
Is it possible to configure Kamailio that wouldn’t send NOTIFY request to watchers when publication status refresh (PUBLISH without XML Body) occur?
no NOTIFY should be sent? Or the NOTIFY in this case should be sent without body, just with a new expire value and same etag?
Cheers, Daniel
Daniel-Constantin Mierla writes:
Is it possible to configure Kamailio that wouldn’t send NOTIFY request to watchers when publication status refresh (PUBLISH without XML Body) occur?
no NOTIFY should be sent? Or the NOTIFY in this case should be sent without body, just with a new expire value and same etag?
Based on first example in Section 15 of rfc3903 no notify should be sent:
M9: The PUA determines that the event state it previously published is about to expire, and refreshes that event state.
PUBLISH sip:presentity@example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK771ash02 To: sip:presentity@example.com From: sip:presentity@example.com;tag=1234kljk Call-ID: 98798798@pua.example.com CSeq: 1 PUBLISH Max-Forwards: 70 SIP-If-Match: dx200xyz Expires: 3600 Event: presence Content-Length: 0
M10: The presence agent receives, and accepts the publication refresh. The timers regarding the expiration of the specific event state identified by the entity-tag are updated. As always, the ESC returns an entity-tag in the response to a successful PUBLISH. Note that no actual state change has occurred, so the watchers will receive no NOTIFYs.
-- Juha
On 21/01/16 20:16, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Is it possible to configure Kamailio that wouldn’t send NOTIFY request to watchers when publication status refresh (PUBLISH without XML Body) occur?
no NOTIFY should be sent? Or the NOTIFY in this case should be sent without body, just with a new expire value and same etag?
Based on first example in Section 15 of rfc3903 no notify should be sent:
M9: The PUA determines that the event state it previously published is about to expire, and refreshes that event state.
PUBLISH sip:presentity@example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK771ash02 To: <sip:presentity@example.com> From: <sip:presentity@example.com>;tag=1234kljk Call-ID: 98798798@pua.example.com CSeq: 1 PUBLISH Max-Forwards: 70 SIP-If-Match: dx200xyz Expires: 3600 Event: presence Content-Length: 0
M10: The presence agent receives, and accepts the publication refresh. The timers regarding the expiration of the specific event state identified by the entity-tag are updated. As always, the ESC returns an entity-tag in the response to a successful PUBLISH. Note that no actual state change has occurred, so the watchers will receive no NOTIFYs.
So the condition is that if a PUBLISH with no body is received and it matches and existing record based on the value of SIP-If-Match header, then don't trigger NOTIFY requests at all... right?
Cheers, Daniel
Daniel,
would you be willing to prepare a correction? I can test the solution.
Another question regarding NOTIFY: is it possible to catch negative response (4xx or timeout if no answer from UA) on sent NOTIFY (after handle_publish or handle_subscribe) in any of routing blocks (failure_route, ...)? Just to print debug message or take other action when NOTIFY is rejected or timeout expired .
Thanks,
Ales
-----Original Message----- From: Juha Heinanen [mailto:jh@tutpro.com] Sent: Monday, January 25, 2016 8:58 PM To: miconda@gmail.com Cc: Kamailio (SER) - Users Mailing List; 'Ales Sturm' Subject: Re: [SR-Users] Presence: Notify on publication status refresh
Daniel-Constantin Mierla writes:
So the condition is that if a PUBLISH with no body is received and it matches and existing record based on the value of SIP-If-Match header, then don't trigger NOTIFY requests at all... right?
Right,
-- Juha