res_pjsip_pubsub: Move where the subscription is stored to after initialized.
authorJoshua Colp <jcolp@digium.com>
Mon, 15 Feb 2016 18:52:22 +0000 (14:52 -0400)
committerJoshua Colp <jcolp@digium.com>
Mon, 15 Feb 2016 19:01:54 +0000 (13:01 -0600)
commit5c400a0fedffface7d7b41c40bcaa2810ca6da15
tree9a9973d8836561857090be25c642c5187d0c2e32
parent1783edd181ede9847ba6e34137c8e7051f135525
res_pjsip_pubsub: Move where the subscription is stored to after initialized.

A problem arose when testing the AMI subscription listing actions where it
was possible for a subscription that had not been fully initialized to be
listed. This was problematic as the underlying listing code would crash.

This change makes it so the subscription tree is fully set up before it is
added to the list of subscriptions. This ensures that when the listing actions
get the subscription it is valid.

ASTERISK-25738 #close

Change-Id: Iace2b13641c31bbcc0d43a39f99aba1f340c0f48
res/res_pjsip_pubsub.c