summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-08-30 19:55:56 +0000
committerKevin Harwell <kharwell@digium.com>2013-08-30 19:55:56 +0000
commit9bad1dabcf52db0a75b3dfb7c0c27f613402a01b (patch)
tree8a4b5f2a47df2dbe6fcc8ac29f64ca67affeb9e0 /res
parent16b8d0cb5a3b15eae8db19c99223170ebed79fef (diff)
Add a reloadable option for sorcery type objects
Some configuration objects currently won't place nice if reloaded. Specifically, in this case the pjsip transport objects. Now when registering an object in sorcery one may specify that the object is allowed to be reloaded or not. If the object is set to not reload then upon reloading of the configuration the objects of that type will not be reloaded. The initially loaded objects of that type however will remain. While the transport objects will not longer be reloaded it is still possible for a user to configure an endpoint to an invalid transport. A couple of log messages were added to help diagnose this problem if it occurs. (closes issue ASTERISK-22382) Reported by: Rusty Newton (closes issue ASTERISK-22384) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2807/ ........ Merged revisions 398139 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c2
-rw-r--r--res/res_pjsip/config_transport.c2
-rw-r--r--res/res_pjsip_outbound_registration.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index e7c83d9d1..d9d841472 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -1290,6 +1290,8 @@ static int sip_get_tpselector_from_endpoint(const struct ast_sip_endpoint *endpo
transport = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", transport_name);
if (!transport || !transport->state) {
+ ast_log(LOG_ERROR, "Unable to retrieve PJSIP transport '%s' for endpoint '%s'\n",
+ transport_name, ast_sorcery_object_get_id(endpoint));
return -1;
}
diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index 82a995cb6..cf0b5e878 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -309,7 +309,7 @@ int ast_sip_initialize_sorcery_transport(struct ast_sorcery *sorcery)
{
ast_sorcery_apply_default(sorcery, "transport", "config", "pjsip.conf,criteria=type=transport");
- if (ast_sorcery_object_register(sorcery, "transport", transport_alloc, NULL, transport_apply)) {
+ if (ast_sorcery_object_register_no_reload(sorcery, "transport", transport_alloc, NULL, transport_apply)) {
return -1;
}
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 67e0ead33..166b55777 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -602,6 +602,8 @@ static int sip_outbound_registration_regc_alloc(void *data)
RAII_VAR(struct ast_sip_transport *, transport, ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", registration->transport), ao2_cleanup);
if (!transport || !transport->state) {
+ ast_log(LOG_ERROR, "Unable to retrieve PJSIP transport '%s' "
+ " for outbound registration", registration->transport);
return -1;
}