diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-12-15 15:36:57 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-12-15 15:36:57 +0000 |
commit | b85f79c0c1aa8f77492a09b91a077daef1192ff8 (patch) | |
tree | 7759d93b3543169e7daa77ce74b4df244af7fa6d /res/res_pjsip_pubsub.c | |
parent | 2b8c4410964ef037450626099c65636340190312 (diff) |
Activate persistent subscriptions when they are recreated.
Prior to this change, recreating persistent subscriptions would
create the subscription but would not activate it. This led to subscriptions
being listed in the "NULL" state by diagnostics and not sending NOTIFYs
when expected.
Review: https://reviewboard.asterisk.org/r/4261
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r-- | res/res_pjsip_pubsub.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index 02deeb668..490f694d2 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -1289,6 +1289,9 @@ static struct sip_subscription_tree *create_subscription_tree(const struct ast_s return sub_tree; } +static int generate_initial_notify(struct ast_sip_subscription *sub); +static int send_notify(struct sip_subscription_tree *sub_tree, unsigned int force_full_state); + /*! \brief Callback function to perform the actual recreation of a subscription */ static int subscription_persistence_recreate(void *obj, void *arg, int flags) { @@ -1377,6 +1380,10 @@ static int subscription_persistence_recreate(void *obj, void *arg, int flags) } sub_tree->persistence = ao2_bump(persistence); subscription_persistence_update(sub_tree, &rdata); + if (generate_initial_notify(sub_tree->root)) { + pjsip_evsub_terminate(sub_tree->evsub, PJ_TRUE); + } + send_notify(sub_tree, 1); } else { ast_sorcery_delete(ast_sip_get_sorcery(), persistence); } |