[asterisk-commits] file: branch 1.4 r48504 -
/branches/1.4/channels/chan_iax2.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Dec 15 12:38:51 MST 2006
Author: file
Date: Fri Dec 15 13:38:51 2006
New Revision: 48504
URL: http://svn.digium.com/view/asterisk?view=rev&rev=48504
Log:
Hold call structure lock in places where a qualify or peer action can destroy it.
Modified:
branches/1.4/channels/chan_iax2.c
Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=48504&r1=48503&r2=48504
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Fri Dec 15 13:38:51 2006
@@ -7664,7 +7664,9 @@
* call has the pointer to IP and must be updated to the new one
*/
if (reg->dnsmgr && ast_dnsmgr_changed(reg->dnsmgr) && (reg->callno > 0)) {
+ ast_mutex_lock(&iaxsl[reg->callno]);
iax2_destroy(reg->callno);
+ ast_mutex_unlock(&iaxsl[reg->callno]);
reg->callno = 0;
}
if (!reg->addr.sin_addr.s_addr) {
@@ -7830,8 +7832,11 @@
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unreachable\r\nTime: %d\r\n", peer->name, peer->lastms);
ast_device_state_changed("IAX2/%s", peer->name); /* Activate notification */
}
- if (peer->callno > 0)
+ if (peer->callno > 0) {
+ ast_mutex_lock(&iaxsl[peer->callno]);
iax2_destroy(peer->callno);
+ ast_mutex_unlock(&iaxsl[peer->callno]);
+ }
peer->callno = 0;
peer->lastms = -1;
/* Try again quickly */
@@ -7862,7 +7867,9 @@
}
if (peer->callno > 0) {
ast_log(LOG_NOTICE, "Still have a callno...\n");
+ ast_mutex_lock(&iaxsl[peer->callno]);
iax2_destroy(peer->callno);
+ ast_mutex_unlock(&iaxsl[peer->callno]);
}
if (heldcall)
ast_mutex_unlock(&iaxsl[heldcall]);
@@ -8703,8 +8710,11 @@
ast_sched_del(sched, peer->expire);
if (peer->pokeexpire > -1)
ast_sched_del(sched, peer->pokeexpire);
- if (peer->callno > 0)
+ if (peer->callno > 0) {
+ ast_mutex_lock(&iaxsl[peer->callno]);
iax2_destroy(peer->callno);
+ ast_mutex_unlock(&iaxsl[peer->callno]);
+ }
register_peer_exten(peer, 0);
More information about the asterisk-commits
mailing list