aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 16:46:13 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 16:46:13 +0000
commite92ad91be488555880685790affc2b3a3c207e30 (patch)
tree70fc0295ee46d476bb08cd6269d115373916969b /channels
parent167a0d33acdc2d8a1269116a7d8f007c9f864b0c (diff)
Merged revisions 150580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r150580 | tilghman | 2008-10-17 11:34:29 -0500 (Fri, 17 Oct 2008) | 2 lines Fix the FRACK! warnings in chan_iax2 when POKE/LAGRQ packets are not answered. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@150606 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index c8d2308cf..85b6d9e39 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1412,6 +1412,8 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len)
return res;
}
+/*!\note Assumes the lock on the pvt is already held, when
+ * iax2_destroy_helper() is called. */
static void iax2_destroy_helper(struct chan_iax2_pvt *pvt)
{
/* Decrement AUTHREQ count if needed */
@@ -1430,8 +1432,8 @@ static void iax2_destroy_helper(struct chan_iax2_pvt *pvt)
ast_clear_flag(pvt, IAX_MAXAUTHREQ);
}
/* No more pings or lagrq's */
- AST_SCHED_DEL(sched, pvt->pingid);
- AST_SCHED_DEL(sched, pvt->lagid);
+ AST_SCHED_DEL_SPINLOCK(sched, pvt->pingid, &iaxsl[pvt->callno]);
+ AST_SCHED_DEL_SPINLOCK(sched, pvt->lagid, &iaxsl[pvt->callno]);
AST_SCHED_DEL(sched, pvt->autoid);
AST_SCHED_DEL(sched, pvt->authid);
AST_SCHED_DEL(sched, pvt->initid);
@@ -1450,7 +1452,9 @@ static void pvt_destructor(void *obj)
struct chan_iax2_pvt *pvt = obj;
struct iax_frame *cur = NULL;
+ ast_mutex_lock(&iaxsl[pvt->callno]);
iax2_destroy_helper(pvt);
+ ast_mutex_unlock(&iaxsl[pvt->callno]);
/* Already gone */
ast_set_flag(pvt, IAX_ALREADYGONE);
@@ -2309,6 +2313,8 @@ static void iax2_destroy(int callno)
retry:
pvt = iaxs[callno];
+ iax2_destroy_helper(pvt);
+
lastused[callno] = ast_tvnow();
owner = pvt ? pvt->owner : NULL;