[asterisk-commits] trunk r11313 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Feb 27 21:27:57 MST 2006


Author: markster
Date: Mon Feb 27 22:27:56 2006
New Revision: 11313

URL: http://svn.digium.com/view/asterisk?rev=11313&view=rev
Log:
Make sure we clear up schedule numbers before we process schedule 
entries.

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=11313&r1=11312&r2=11313&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Feb 27 22:27:56 2006
@@ -6022,7 +6022,6 @@
 	struct iax_ie_data ied;
 	ast_mutex_lock(&iaxsl[callno]);
 	if (iaxs[callno]) {
-		iaxs[callno]->authid = -1;
 		memset(&ied, 0, sizeof(ied));
 		if (iaxs[callno]->authfail == IAX_COMMAND_REGREJ) {
 			iax_ie_append_str(&ied, IAX_IE_CAUSE, "Registration Refused");
@@ -6038,6 +6037,12 @@
 
 static int auth_reject(void *data)
 {
+	int callno = (int)(long)(data);
+	ast_mutex_lock(&iaxsl[callno]);
+	if (iaxs[callno]) {
+		iaxs[callno]->authid = -1;
+	}
+	ast_mutex_unlock(&iaxsl[callno]);
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__auth_reject, data))
 #endif		
@@ -6070,7 +6075,6 @@
 	struct iax_ie_data ied;
 	ast_mutex_lock(&iaxsl[callno]);
 	if (iaxs[callno]) {
-		iaxs[callno]->autoid = -1;
 		memset(&ied, 0, sizeof(ied));
 		iax_ie_append_str(&ied, IAX_IE_CAUSE, "Timeout");
 		iax_ie_append_byte(&ied, IAX_IE_CAUSECODE, AST_CAUSE_NO_USER_RESPONSE);
@@ -6081,6 +6085,12 @@
 
 static int auto_hangup(void *data)
 {
+	int callno = (int)(long)(data);
+	ast_mutex_lock(&iaxsl[callno]);
+	if (iaxs[callno]) {
+		iaxs[callno]->autoid = -1;
+	}
+	ast_mutex_unlock(&iaxsl[callno]);
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__auto_hangup, data))
 #endif		
@@ -6125,12 +6135,13 @@
 static void __iax2_poke_peer_s(void *data)
 {
 	struct iax2_peer *peer = data;
+	iax2_poke_peer(peer, 0);
+}
+
+static int iax2_poke_peer_s(void *data)
+{
+	struct iax2_peer *peer = data;
 	peer->pokeexpire = -1;
-	iax2_poke_peer(peer, 0);
-}
-
-static int iax2_poke_peer_s(void *data)
-{
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__iax2_poke_peer_s, data))
 #endif		
@@ -8070,7 +8081,6 @@
 static void __iax2_poke_noanswer(void *data)
 {
 	struct iax2_peer *peer = data;
-	peer->pokeexpire = -1;
 	if (peer->lastms > -1) {
 		ast_log(LOG_NOTICE, "Peer '%s' is now UNREACHABLE! Time: %d\n", peer->name, peer->lastms);
 		manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unreachable\r\nTime: %d\r\n", peer->name, peer->lastms);
@@ -8086,6 +8096,8 @@
 
 static int iax2_poke_noanswer(void *data)
 {
+	struct iax2_peer *peer = data;
+	peer->pokeexpire = -1;
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__iax2_poke_noanswer, data))
 #endif		



More information about the asterisk-commits mailing list