<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10879">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip/config_global: regcontext context not created<br><br>The context specified by 'regcontext' was not being created, so when Asterisk<br>attempted to later dynamically add an extension it would fail. This patch now<br>creates the context if a 'regcontext' is specified.<br><br>ASTERISK-28238<br><br>Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265<br>---<br>M res/res_pjsip/config_global.c<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/10879/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip/config_global.c b/res/res_pjsip/config_global.c</span><br><span>index 5b52574..9583567 100644</span><br><span>--- a/res/res_pjsip/config_global.c</span><br><span>+++ b/res/res_pjsip/config_global.c</span><br><span>@@ -23,6 +23,7 @@</span><br><span> </span><br><span> #include "asterisk/res_pjsip.h"</span><br><span> #include "include/res_pjsip_private.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "asterisk/pbx.h"</span><br><span> #include "asterisk/sorcery.h"</span><br><span> #include "asterisk/taskprocessor.h"</span><br><span> #include "asterisk/ast_version.h"</span><br><span>@@ -154,6 +155,12 @@</span><br><span>     ast_sip_add_global_request_header("User-Agent", cfg->useragent, 1);</span><br><span>     ast_sip_add_global_response_header("Server", cfg->useragent, 1);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     if (!ast_strlen_zero(cfg->regcontext) &&</span><br><span style="color: hsl(120, 100%, 40%);">+                   !ast_context_find_or_create(NULL, NULL, cfg->regcontext, "SIP")) {</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_log(LOG_ERROR,"Failed to create regcontext '%s'\n", cfg->regcontext);</span><br><span style="color: hsl(120, 100%, 40%);">+                return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  ao2_t_global_obj_replace_unref(global_cfg, cfg, "Applying global settings");</span><br><span>       return 0;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10879">change 10879</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10879"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265 </div>
<div style="display:none"> Gerrit-Change-Number: 10879 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>