summaryrefslogtreecommitdiff
path: root/res/res_pjsip_publish_asterisk.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2016-05-03 15:35:24 -0500
committerKevin Harwell <kharwell@digium.com>2016-05-05 16:41:50 -0500
commitadc82a2260382383bfb6593adfaa8b8b7ef7d7d8 (patch)
treec6ab7b92d78725ff4ecf00372057077804fc11d1 /res/res_pjsip_publish_asterisk.c
parent3b0ce5169d123312e4b4ac5a65b23325a59ba2a7 (diff)
res_pjsip_outbound_publishing: After unloading the library won't load again
The same thing was happening in res_pjsip_publish_asterisk. When the library was unloaded it did not unregister the object type from sorcery. Subsequent loads resulted in a failed load due to the sorcery type already existing. Change-Id: Ifdc25e94e4cd40bc5a19eb4d0a00b86c2e9fedc9
Diffstat (limited to 'res/res_pjsip_publish_asterisk.c')
-rw-r--r--res/res_pjsip_publish_asterisk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_pjsip_publish_asterisk.c b/res/res_pjsip_publish_asterisk.c
index 3218b0a0c..002d976d4 100644
--- a/res/res_pjsip_publish_asterisk.c
+++ b/res/res_pjsip_publish_asterisk.c
@@ -862,6 +862,7 @@ static int load_module(void)
ast_sorcery_apply_default(ast_sip_get_sorcery(), "asterisk-publication", "config", "pjsip.conf,criteria=type=asterisk-publication");
if (ast_sorcery_object_register(ast_sip_get_sorcery(), "asterisk-publication", asterisk_publication_config_alloc, NULL, NULL)) {
+ ast_log(LOG_ERROR, "Unable to register 'asterisk-publication' type with sorcery\n");
return AST_MODULE_LOAD_DECLINE;
}
@@ -919,6 +920,7 @@ static int unload_module(void)
ast_sip_unregister_publish_handler(&asterisk_mwi_publication_handler);
ast_sip_unregister_event_publisher_handler(&asterisk_devicestate_publisher_handler);
ast_sip_unregister_event_publisher_handler(&asterisk_mwi_publisher_handler);
+ ast_sorcery_object_unregister(ast_sip_get_sorcery(), "asterisk-publication");
return 0;
}