[svn-commits] jdixon: branch jdixon/chan_usbradio-1.4 r160099 - /team/jdixon/chan_usbradio-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 1 15:30:23 CST 2008


Author: jdixon
Date: Mon Dec  1 15:30:22 2008
New Revision: 160099

URL: http://svn.digium.com/view/asterisk?view=rev&rev=160099
Log:
Fixed problem with system "coming back connected" after disconnect

Modified:
    team/jdixon/chan_usbradio-1.4/channels/chan_irlp.c

Modified: team/jdixon/chan_usbradio-1.4/channels/chan_irlp.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/channels/chan_irlp.c?view=diff&rev=160099&r1=160098&r2=160099
==============================================================================
--- team/jdixon/chan_usbradio-1.4/channels/chan_irlp.c (original)
+++ team/jdixon/chan_usbradio-1.4/channels/chan_irlp.c Mon Dec  1 15:30:22 2008
@@ -34,7 +34,7 @@
 #define	rpt_free(p) __ast_free(p,__FILE__,__LINE__,__PRETTY_FUNCTION__)
 
 
-/* Version 0.16, 11/17/2008
+/* Version 0.18, 12/1/2008
 irlp channel driver for Asterisk/app_rpt.
 
 I wish to thank the following people for the immeasurable amount of
@@ -102,6 +102,7 @@
 #define IRLP_ADPCM_STATE_INFO_SIZE 3
 
 #define	LARGEST_PACKET_SIZE 1024
+#define	DISC_LINGER_TIME 2
 #define	IRLP_ROOT "/home/irlp/local"
 #define	IRLP_RESET "su - repeater /tmp/irlpwrap /home/irlp/custom/irlp_fullreset"
 #define	IRLP_END "su - repeater /tmp/irlpwrap /home/irlp/scripts/end &"
@@ -213,6 +214,7 @@
 static char astnode1[20];
 static short rtcptimeout = 10;
 static short localispeakerport = 2174;
+time_t lingertime = 0;
 static int radmode = 0;
 static int nodenum = 0;
 static int audio_sock = -1;
@@ -292,6 +294,7 @@
 	if (alt_ctrl_sock != -1) close(alt_ctrl_sock);
 	alt_ctrl_sock = -1;
 	proto = IRLP_NOPROTO;
+	time(&lingertime);
 	keepalive = 0;
 	in_node = 0;
 	nodenum = 0;
@@ -769,7 +772,8 @@
 			       {
 	                          strncpy(remote_irlp_node_ip, ip, IRLP_IP_SIZE);
 				  cp = irlp_read_file(IRLP_ROOT,"active");
-				  if (cp && (strlen(cp) > 3))
+				  if ((cp && (strlen(cp) > 3)) && 
+				    (time(NULL) >= (lingertime + DISC_LINGER_TIME)))
 				  {
 					if (cp[strlen(cp) - 1] == '\n')
 						cp[strlen(cp) - 1] = 0;




More information about the svn-commits mailing list