Skip to content
GitLab
Explore
Sign in
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
c80ecbc5
Commit
c80ecbc5
authored
7 years ago
by
Jenkins2
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_pjsip_header_funcs: Various cleanups"
parents
f063ea65
e4a5c9cc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_pjsip_header_funcs.c
+10
-17
10 additions, 17 deletions
res/res_pjsip_header_funcs.c
with
10 additions
and
17 deletions
res/res_pjsip_header_funcs.c
+
10
−
17
View file @
c80ecbc5
...
...
@@ -146,18 +146,11 @@ struct hdr_list_entry {
pjsip_hdr
*
hdr
;
AST_LIST_ENTRY
(
hdr_list_entry
)
nextptr
;
};
AST_LIST_HEAD
(
hdr_list
,
hdr_list_entry
);
/*! \brief Destructor for hdr_list */
static
void
hdr_list_destroy
(
void
*
obj
)
{
AST_LIST_HEAD_DESTROY
((
struct
hdr_list
*
)
obj
);
}
AST_LIST_HEAD_NOLOCK
(
hdr_list
,
hdr_list_entry
);
/*! \brief Datastore for saving headers */
static
const
struct
ast_datastore_info
header_datastore
=
{
.
type
=
"header_datastore"
,
.
destroy
=
hdr_list_destroy
,
};
/*! \brief Data structure used for ast_sip_push_task_synchronous */
...
...
@@ -215,7 +208,7 @@ static int incoming_request(struct ast_sip_session *session, pjsip_rx_data * rda
ast_log
(
AST_LOG_ERROR
,
"Unable to create datastore for header functions.
\n
"
);
return
0
;
}
AST_LIST_HEAD_INIT
((
struct
hdr_list
*
)
datastore
->
data
);
AST_LIST_HEAD_INIT
_NOLOCK
((
struct
hdr_list
*
)
datastore
->
data
);
}
insert_headers
(
pool
,
(
struct
hdr_list
*
)
datastore
->
data
,
rdata
->
msg_info
.
msg
);
...
...
@@ -340,7 +333,7 @@ static int add_header(void *obj)
ast_log
(
AST_LOG_ERROR
,
"Unable to create datastore for header functions.
\n
"
);
return
-
1
;
}
AST_LIST_HEAD_INIT
((
struct
hdr_list
*
)
datastore
->
data
);
AST_LIST_HEAD_INIT
_NOLOCK
((
struct
hdr_list
*
)
datastore
->
data
);
}
ast_debug
(
1
,
"Adding header %s with value %s
\n
"
,
data
->
header_name
,
...
...
@@ -486,15 +479,15 @@ static int func_read_header(struct ast_channel *chan, const char *function, char
header_data
.
buf
=
buf
;
header_data
.
len
=
len
;
if
(
str
i
cmp
(
args
.
action
,
"read"
)
==
0
)
{
if
(
!
str
case
cmp
(
args
.
action
,
"read"
))
{
return
ast_sip_push_task_synchronous
(
channel
->
session
->
serializer
,
read_header
,
&
header_data
);
}
else
if
(
str
i
cmp
(
args
.
action
,
"remove"
)
==
0
)
{
}
else
if
(
!
str
case
cmp
(
args
.
action
,
"remove"
))
{
return
ast_sip_push_task_synchronous
(
channel
->
session
->
serializer
,
remove_header
,
&
header_data
);
}
else
{
ast_log
(
AST_LOG_ERROR
,
"Unknown action
\
'
%s
\
'
is not valid,
M
ust be
\
'
read
\
'
or
\
'
remove
\
'
.
\n
"
,
"Unknown action '%s' is not valid,
m
ust be 'read' or 'remove'.
\n
"
,
args
.
action
);
return
-
1
;
}
...
...
@@ -545,18 +538,18 @@ static int func_write_header(struct ast_channel *chan, const char *cmd, char *da
header_data
.
buf
=
NULL
;
header_data
.
len
=
0
;
if
(
str
i
cmp
(
args
.
action
,
"add"
)
==
0
)
{
if
(
!
str
case
cmp
(
args
.
action
,
"add"
))
{
return
ast_sip_push_task_synchronous
(
channel
->
session
->
serializer
,
add_header
,
&
header_data
);
}
else
if
(
str
i
cmp
(
args
.
action
,
"update"
)
==
0
)
{
}
else
if
(
!
str
case
cmp
(
args
.
action
,
"update"
))
{
return
ast_sip_push_task_synchronous
(
channel
->
session
->
serializer
,
update_header
,
&
header_data
);
}
else
if
(
str
i
cmp
(
args
.
action
,
"remove"
)
==
0
)
{
}
else
if
(
!
str
case
cmp
(
args
.
action
,
"remove"
))
{
return
ast_sip_push_task_synchronous
(
channel
->
session
->
serializer
,
remove_header
,
&
header_data
);
}
else
{
ast_log
(
AST_LOG_ERROR
,
"Unknown action
\
'
%s
\
'
is not valid,
M
ust be
\
'
add
\
'
,
\
'
update
\
'
, or
\
'
remove
\
'
.
\n
"
,
"Unknown action '%s' is not valid,
m
ust be 'add', 'update', or 'remove'.
\n
"
,
args
.
action
);
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