[Asterisk-code-review] pjsip/config global: regcontext context not created (asterisk[13])
Kevin Harwell
asteriskteam at digium.com
Tue Jan 15 17:50:38 CST 2019
Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/10879
Change subject: pjsip/config_global: regcontext context not created
......................................................................
pjsip/config_global: regcontext context not created
The context specified by 'regcontext' was not being created, so when Asterisk
attempted to later dynamically add an extension it would fail. This patch now
creates the context if a 'regcontext' is specified.
ASTERISK-28238
Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265
---
M res/res_pjsip/config_global.c
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/10879/1
diff --git a/res/res_pjsip/config_global.c b/res/res_pjsip/config_global.c
index 5b52574..9583567 100644
--- a/res/res_pjsip/config_global.c
+++ b/res/res_pjsip/config_global.c
@@ -23,6 +23,7 @@
#include "asterisk/res_pjsip.h"
#include "include/res_pjsip_private.h"
+#include "asterisk/pbx.h"
#include "asterisk/sorcery.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/ast_version.h"
@@ -154,6 +155,12 @@
ast_sip_add_global_request_header("User-Agent", cfg->useragent, 1);
ast_sip_add_global_response_header("Server", cfg->useragent, 1);
+ if (!ast_strlen_zero(cfg->regcontext) &&
+ !ast_context_find_or_create(NULL, NULL, cfg->regcontext, "SIP")) {
+ ast_log(LOG_ERROR,"Failed to create regcontext '%s'\n", cfg->regcontext);
+ return -1;
+ }
+
ao2_t_global_obj_replace_unref(global_cfg, cfg, "Applying global settings");
return 0;
}
--
To view, visit https://gerrit.asterisk.org/10879
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265
Gerrit-Change-Number: 10879
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190115/b89dcd89/attachment.html>
More information about the asterisk-code-review
mailing list