[OpenSIPS-Devel] [patch] Disable generation of presence PIDFs with state "closed" when publication is expired

Saúl Ibarra Corretgé saul at ag-projects.com
Wed Apr 18 18:58:13 CEST 2012


Hi,

(I'm sending the patch here because email better to have a discussion than sourceforge)

Currently the presence module has a parameter called 'notify_offline_body' which will trigger a _fake_ NOTIFY to be sent with a body indicating the user is offline (ie, status is closed) if a SUBSCRIBE is received and there is no presence data for the requested user. Setting this parameter to 0 will disable sending such NOTIFY.

However, after the user has published at least one PIDF, if the wants to end his publication he will send a PUBLISH with Expires: 0 and at that moment OpenSIPS will generate a PIDF derived from the one he previously had sent (regardless of the aforementioned setting).

I want to disable this behavior, so the attached patch adds a new module parameter to the presence_xml document: generate_offline_body (it defaults to 1), when set to 0 no derived PIDF will be generated with status set to closed.

At first I thought about reusing the notify_offline_body parameter in the presence module for this as well, but I can think of use cases where one would want just one of the 2, so adding a new module parameter seemed like the best approach to me. (I discussed some other alternatives with Razvan on IRC and this seemed fine)

The patch is not big, I'd appreciate if someone can have a look, I'll commit it once I get the green light :-)


Kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generate_offline_body.diff
Type: application/octet-stream
Size: 2902 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120418/9e055691/attachment.obj>
-------------- next part --------------

--
Sa?l Ibarra Corretg?
AG Projects





More information about the Devel mailing list