Author: bebuild
Date: Fri Dec 19 14:35:33 2014
New Revision: 429858

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=429858
Log:
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
........

Merged revisions 429571 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    certified/branches/13.1/   (props changed)
    certified/branches/13.1/res/res_pjsip_pubsub.c

Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
    (empty)

Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
--- branch-13-merged (original)
+++ branch-13-merged Fri Dec 19 14:35:33 2014
@@ -1,1 +1,1 @@
-/branches/13:
+/branches/13:429571

Modified: certified/branches/13.1/res/res_pjsip_pubsub.c
URL: 
http://svnview.digium.com/svn/asterisk/certified/branches/13.1/res/res_pjsip_pubsub.c?view=diff&rev=429858&r1=429857&r2=429858
==============================================================================
--- certified/branches/13.1/res/res_pjsip_pubsub.c (original)
+++ certified/branches/13.1/res/res_pjsip_pubsub.c Fri Dec 19 14:35:33 2014
@@ -1289,6 +1289,9 @@
        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 @@
                }
                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);
        }


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to