Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
9255048d
Commit
9255048d
authored
7 years ago
by
Jenkins2
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_pjsip/config_domain_aliases.c: Add check for missing domain."
parents
0a784a91
b71e469d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_pjsip/config_domain_aliases.c
+21
-2
21 additions, 2 deletions
res/res_pjsip/config_domain_aliases.c
with
21 additions
and
2 deletions
res/res_pjsip/config_domain_aliases.c
+
21
−
2
View file @
9255048d
...
...
@@ -34,8 +34,9 @@ static void domain_alias_destroy(void *obj)
static
void
*
domain_alias_alloc
(
const
char
*
name
)
{
struct
ast_sip_domain_alias
*
alias
=
ast_sorcery_generic_alloc
(
sizeof
(
*
alias
),
domain_alias_destroy
)
;
struct
ast_sip_domain_alias
*
alias
;
alias
=
ast_sorcery_generic_alloc
(
sizeof
(
*
alias
),
domain_alias_destroy
);
if
(
!
alias
)
{
return
NULL
;
}
...
...
@@ -48,6 +49,23 @@ static void *domain_alias_alloc(const char *name)
return
alias
;
}
/*! \brief Apply handler for domain_alias type */
static
int
domain_alias_apply
(
const
struct
ast_sorcery
*
sorcery
,
void
*
obj
)
{
struct
ast_sip_domain_alias
*
alias
=
obj
;
if
(
ast_strlen_zero
(
alias
->
domain
))
{
/*
* What is the point of defining an alias and not saying
* what is being aliased?
*/
ast_log
(
LOG_ERROR
,
"%s '%s' missing required domain being aliased.
\n
"
,
SIP_SORCERY_DOMAIN_ALIAS_TYPE
,
ast_sorcery_object_get_id
(
alias
));
return
-
1
;
}
return
0
;
}
/*! \brief Initialize sorcery with domain alias support */
int
ast_sip_initialize_sorcery_domain_alias
(
void
)
{
...
...
@@ -55,7 +73,8 @@ int ast_sip_initialize_sorcery_domain_alias(void)
ast_sorcery_apply_default
(
sorcery
,
SIP_SORCERY_DOMAIN_ALIAS_TYPE
,
"config"
,
"pjsip.conf,criteria=type=domain_alias"
);
if
(
ast_sorcery_object_register
(
sorcery
,
SIP_SORCERY_DOMAIN_ALIAS_TYPE
,
domain_alias_alloc
,
NULL
,
NULL
))
{
if
(
ast_sorcery_object_register
(
sorcery
,
SIP_SORCERY_DOMAIN_ALIAS_TYPE
,
domain_alias_alloc
,
NULL
,
domain_alias_apply
))
{
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment