[asterisk-commits] file: branch 1.4 r49259 - /branches/1.4/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 2 18:19:54 MST 2007


Author: file
Date: Tue Jan  2 19:19:53 2007
New Revision: 49259

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49259
Log:
Check pvt structure presence before passing to send_command. This gets rid of the irritating message about a packet without pvt structure. This happens because the scheduled item is getting cancelled at almost the exact moment it is getting executed.

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=49259&r1=49258&r2=49259
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Tue Jan  2 19:19:53 2007
@@ -915,7 +915,10 @@
 static void __send_ping(void *data)
 {
 	int callno = (long)data;
-	send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+	ast_mutex_lock(&iaxsl[callno]);
+	if (iaxs[callno])
+		send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+	ast_mutex_unlock(&iaxsl[callno]);
 }
 
 static int send_ping(void *data)
@@ -948,7 +951,10 @@
 {
 	int callno = (long)data;
 	/* Ping only if it's real not if it's bridged */
-	send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
+	ast_mutex_lock(&iaxsl[callno]);
+	if (iaxs[callno])
+		send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
+	ast_mutex_unlock(&iaxsl[callno]);
 }
 
 static int send_lagrq(void *data)



More information about the asterisk-commits mailing list