<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8160">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip/config_domain_aliases.c: Add check for missing domain.<br><br>What is the point of defining an alias and not saying what is being<br>aliased?<br><br>Change-Id: I98a892016ed61dcf5efeb6619fd748925103f0be<br>---<br>M res/res_pjsip/config_domain_aliases.c<br>1 file changed, 21 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip/config_domain_aliases.c b/res/res_pjsip/config_domain_aliases.c<br>index 8feff05..79ea8dd 100644<br>--- a/res/res_pjsip/config_domain_aliases.c<br>+++ b/res/res_pjsip/config_domain_aliases.c<br>@@ -34,8 +34,9 @@<br> <br> static void *domain_alias_alloc(const char *name)<br> {<br>- struct ast_sip_domain_alias *alias = ast_sorcery_generic_alloc(sizeof(*alias), domain_alias_destroy);<br>+ struct ast_sip_domain_alias *alias;<br> <br>+ alias = ast_sorcery_generic_alloc(sizeof(*alias), domain_alias_destroy);<br> if (!alias) {<br> return NULL;<br> }<br>@@ -48,6 +49,23 @@<br> return alias;<br> }<br> <br>+/*! \brief Apply handler for domain_alias type */<br>+static int domain_alias_apply(const struct ast_sorcery *sorcery, void *obj)<br>+{<br>+ struct ast_sip_domain_alias *alias = obj;<br>+<br>+ if (ast_strlen_zero(alias->domain)) {<br>+ /*<br>+ * What is the point of defining an alias and not saying<br>+ * what is being aliased?<br>+ */<br>+ ast_log(LOG_ERROR, "%s '%s' missing required domain being aliased.\n",<br>+ SIP_SORCERY_DOMAIN_ALIAS_TYPE, ast_sorcery_object_get_id(alias));<br>+ return -1;<br>+ }<br>+ return 0;<br>+}<br>+<br> /*! \brief Initialize sorcery with domain alias support */<br> int ast_sip_initialize_sorcery_domain_alias(void)<br> {<br>@@ -55,7 +73,8 @@<br> <br> ast_sorcery_apply_default(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, "config", "pjsip.conf,criteria=type=domain_alias");<br> <br>- if (ast_sorcery_object_register(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, domain_alias_alloc, NULL, NULL)) {<br>+ if (ast_sorcery_object_register(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE,<br>+ domain_alias_alloc, NULL, domain_alias_apply)) {<br> return -1;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8160">change 8160</a>. To unsubscribe, 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/8160"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I98a892016ed61dcf5efeb6619fd748925103f0be </div>
<div style="display:none"> Gerrit-Change-Number: 8160 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>