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
3fa60762
Commit
3fa60762
authored
9 years ago
by
zuul
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "chan_sip.c: Simplify sip_pvt destructor call levels."
parents
b5671814
cb97198c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
channels/chan_sip.c
+8
-25
8 additions, 25 deletions
channels/chan_sip.c
channels/sip/include/dialog.h
+0
-13
0 additions, 13 deletions
channels/sip/include/dialog.h
with
8 additions
and
38 deletions
channels/chan_sip.c
+
8
−
25
View file @
3fa60762
...
...
@@ -6381,11 +6381,14 @@ static void offered_media_list_destroy(struct sip_pvt *p)
}
}
/*! \brief
Execute
destruct
ion of
SIP dialog structure
, release memory
*/
void
__
sip_
destroy(struct sip_pvt *p, int lockowner, int lockdialoglist
)
/*! \brief
ao2
destruct
or for
SIP dialog structure */
static
void sip_
pvt_dtor(void *vdoomed
)
{
struct sip_pvt *p = vdoomed;
struct sip_request *req;
ast_debug(3, "Destroying SIP dialog %s\n", p->callid);
/* Destroy Session-Timers if allocated */
if (p->stimer) {
p->stimer->quit_flag = 1;
...
...
@@ -6404,14 +6407,12 @@ void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist)
/* Unlink us from the owner if we have one */
if (p->owner) {
if (lockowner)
ast_channel_lock(p->owner);
ast_channel_lock(p->owner);
ast_debug(1, "Detaching from %s\n", ast_channel_name(p->owner));
ast_channel_tech_pvt_set(p->owner, NULL);
/* Make sure that the channel knows its backend is going away */
ast_channel_softhangup_internal_flag_add(p->owner, AST_SOFTHANGUP_DEV);
if (lockowner)
ast_channel_unlock(p->owner);
ast_channel_unlock(p->owner);
/* Give the channel a chance to react before deallocation */
usleep(1);
}
...
...
@@ -6716,24 +6717,6 @@ static int update_call_counter(struct sip_pvt *fup, int event)
return 0;
}
static void sip_destroy_fn(void *p)
{
sip_destroy(p);
}
/*! \brief Destroy SIP call structure.
* Make it return NULL so the caller can do things like
* foo = sip_destroy(foo);
* and reduce the chance of bugs due to dangling pointers.
*/
struct sip_pvt *sip_destroy(struct sip_pvt *p)
{
ast_debug(3, "Destroying SIP dialog %s\n", p->callid);
__sip_destroy(p, TRUE, TRUE);
return NULL;
}
/*! \brief Convert SIP hangup causes to Asterisk hangup causes */
int hangup_sip2cause(int cause)
{
...
...
@@ -8635,7 +8618,7 @@ struct sip_pvt *__sip_alloc(ast_string_field callid, struct ast_sockaddr *addr,
{
struct sip_pvt *p;
p = __ao2_alloc(sizeof(*p), sip_
destroy_fn
,
p = __ao2_alloc(sizeof(*p), sip_
pvt_dtor
,
AO2_ALLOC_OPT_LOCK_MUTEX, "allocate a dialog(pvt) struct",
file, line, func);
if (!p) {
This diff is collapsed.
Click to expand it.
channels/sip/include/dialog.h
+
0
−
13
View file @
3fa60762
...
...
@@ -43,19 +43,6 @@ void sip_scheddestroy_final(struct sip_pvt *p, int ms);
void
sip_scheddestroy
(
struct
sip_pvt
*
p
,
int
ms
);
int
sip_cancel_destroy
(
struct
sip_pvt
*
p
);
/*! \brief Destroy SIP call structure.
* Make it return NULL so the caller can do things like
* foo = sip_destroy(foo);
* and reduce the chance of bugs due to dangling pointers.
*/
struct
sip_pvt
*
sip_destroy
(
struct
sip_pvt
*
p
);
/*! \brief Destroy SIP call structure.
* Make it return NULL so the caller can do things like
* foo = sip_destroy(foo);
* and reduce the chance of bugs due to dangling pointers.
*/
void
__sip_destroy
(
struct
sip_pvt
*
p
,
int
lockowner
,
int
lockdialoglist
);
/*!
* \brief Unlink a dialog from the dialogs container, as well as any other places
* that it may be currently stored.
...
...
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