[asterisk-dev] [Code Review] 3598: res_pjsip_pubsub: Persist subscriptions using sorcery and recreate them upon startup.
Mark Michelson
reviewboard at asterisk.org
Mon Jun 9 17:06:28 CDT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3598/#review12101
-----------------------------------------------------------
/branches/12/res/res_pjsip_pubsub.c
<https://reviewboard.asterisk.org/r/3598/#comment22122>
This function should be broken up into separate parts. The following could be extracted into their own functions:
1) A function to create an rdata. This could potentially even be placed into a more neutral place like res_pjsip.c.
2) Adding the expiration to the rdata. I could live with this staying in this function though since it's pretty specialized.
3) Getting the Accept header and locating the body generator. This is the worst offender here since it's copy-pasted from pubsub_on_rx_subscribe_request().Extracting it into its own function allows both users to call the common function.
/branches/12/res/res_pjsip_pubsub.c
<https://reviewboard.asterisk.org/r/3598/#comment22123>
Red
- Mark Michelson
On June 6, 2014, 6:14 p.m., Joshua Colp wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3598/
> -----------------------------------------------------------
>
> (Updated June 6, 2014, 6:14 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> This change adds persistence support to res_pjsip_pubsub.
>
> What does this mean?
>
> As subscriptions are created and destroyed their state is kept in sorcery. By default this uses the local astdb but realtime support is also possible. If Asterisk goes down and is restarted these subscriptions are retrieved and recreated as if nothing had happened.
>
>
> Diffs
> -----
>
> /branches/12/res/res_pjsip_pubsub.exports.in 415169
> /branches/12/res/res_pjsip_pubsub.c 415169
> /branches/12/res/res_pjsip_mwi.c 415169
> /branches/12/res/res_pjsip_exten_state.c 415169
> /branches/12/include/asterisk/res_pjsip_pubsub.h 415169
> /branches/12/contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py PRE-CREATION
>
> Diff: https://reviewboard.asterisk.org/r/3598/diff/
>
>
> Testing
> -------
>
> Did "core stop now" and "core restart now" multiple times. Confirmed, via wireshark, that the expected NOTIFY was sent out upon startup as if nothing had happened. Tested using the default persistence of going to astdb and also configured it to persist through realtime -> ODBC -> MySQL.
>
>
> Thanks,
>
> Joshua Colp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140609/587f60da/attachment.html>
More information about the asterisk-dev
mailing list