diff options
author | Joshua Colp <jcolp@digium.com> | 2015-12-28 09:02:24 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-12-28 09:02:25 -0600 |
commit | e3f1dbd91cd618c633ca471c59f68e903a3e050d (patch) | |
tree | a543498648c79c549acf6b48846bd3774b0de9f9 | |
parent | 6b08f01c60dc73d8b2b27f7d4cbc9c0b9b2f6fd6 (diff) | |
parent | 2df4ad647c06451715a22efb17c05ceb4875fa69 (diff) |
Merge "res/res_pjsip_location: Delete contact_status object when contact is deleted"
-rw-r--r-- | res/res_pjsip/location.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index c070e7dbc..045218424 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -317,6 +317,14 @@ int ast_sip_location_update_contact(struct ast_sip_contact *contact) int ast_sip_location_delete_contact(struct ast_sip_contact *contact) { + void *contact_status_obj; + + contact_status_obj = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), CONTACT_STATUS, ast_sorcery_object_get_id(contact)); + if (contact_status_obj) { + ast_sorcery_delete(ast_sip_get_sorcery(), contact_status_obj); + ao2_ref(contact_status_obj, -1); + } + return ast_sorcery_delete(ast_sip_get_sorcery(), contact); } |