[Asterisk-cvs] asterisk/channels chan_agent.c,1.57,1.58 chan_iax2.c,1.47,1.48 chan_mgcp.c,1.18,1.19 chan_modem.c,1.5,1.6 chan_sip.c,1.172,1.173

markster at lists.digium.com markster at lists.digium.com
Mon Sep 8 11:46:58 CDT 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30979/channels

Modified Files:
	chan_agent.c chan_iax2.c chan_mgcp.c chan_modem.c chan_sip.c 
Log Message:
BSD portability enhancements (bug #234)


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** chan_agent.c	7 Sep 2003 00:12:29 -0000	1.57
--- chan_agent.c	8 Sep 2003 16:48:06 -0000	1.58
***************
*** 195,199 ****
  			ast_mutex_init( &p->lock );
  			ast_mutex_init( &p->app_lock );
! 			p->owning_app = -1;
  			p->app_sleep_cond = 1;
  			p->group = group;
--- 195,199 ----
  			ast_mutex_init( &p->lock );
  			ast_mutex_init( &p->app_lock );
! 			p->owning_app = (pthread_t) -1;
  			p->app_sleep_cond = 1;
  			p->group = group;

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** chan_iax2.c	4 Sep 2003 04:09:09 -0000	1.47
--- chan_iax2.c	8 Sep 2003 16:48:06 -0000	1.48
***************
*** 3577,3581 ****
--- 3577,3583 ----
  	int processed = 0;
  	int totalcalls = 0;
+ #ifdef ZT_TIMERACK
  	int x = 1;
+ #endif
  	if (iaxtrunkdebug)
  		ast_verbose("Beginning trunk processing\n");
***************
*** 5117,5121 ****
--- 5119,5125 ----
  	struct iax2_user *user;
  	struct iax2_peer *peer;
+ #if 0
  	static unsigned short int last_port=0;
+ #endif
  
  	cfg = ast_load(config_file);

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** chan_mgcp.c	19 Aug 2003 15:13:54 -0000	1.18
--- chan_mgcp.c	8 Sep 2003 16:48:06 -0000	1.19
***************
*** 414,418 ****
      if (sub->messagepending && (sub->lastouttime + 20 < t)) {
          ast_log(LOG_NOTICE, "Timeout waiting for response to message:%d,  lastouttime: %ld, now: %ld.  Dumping pending queue\n",
!                 sub->msgs ? sub->msgs->seqno : -1, sub->lastouttime, t);
          dump_queue(sub->parent);
      }
--- 414,418 ----
      if (sub->messagepending && (sub->lastouttime + 20 < t)) {
          ast_log(LOG_NOTICE, "Timeout waiting for response to message:%d,  lastouttime: %ld, now: %ld.  Dumping pending queue\n",
!                 sub->msgs ? sub->msgs->seqno : -1, (long) sub->lastouttime, (long) t);
          dump_queue(sub->parent);
      }
***************
*** 2547,2551 ****
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {
--- 2547,2551 ----
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == (pthread_t) -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {

Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** chan_modem.c	16 Aug 2003 05:10:35 -0000	1.5
--- chan_modem.c	8 Sep 2003 16:48:06 -0000	1.6
***************
*** 29,32 ****
--- 29,33 ----
  #include <unistd.h>
  #include <stdlib.h>
+ #include <netinet/in.h>
  #include <arpa/inet.h>
  #include <fcntl.h>
***************
*** 83,87 ****
  /* This is the thread for the monitor which checks for input on the channels
     which are not currently in use.  */
! static pthread_t monitor_thread = -1;
  
  static int restart_monitor(void);
--- 84,88 ----
  /* This is the thread for the monitor which checks for input on the channels
     which are not currently in use.  */
! static pthread_t monitor_thread = (pthread_t) -1;
  
  static int restart_monitor(void);
***************
*** 645,649 ****
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {
--- 646,650 ----
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == (pthread_t) -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {
***************
*** 656,660 ****
  		return -1;
  	}
! 	if (monitor_thread != -1) {
  		pthread_cancel(monitor_thread);
  		/* Nudge it a little, as it's probably stuck in select */
--- 657,661 ----
  		return -1;
  	}
! 	if (monitor_thread != (pthread_t) -1) {
  		pthread_cancel(monitor_thread);
  		/* Nudge it a little, as it's probably stuck in select */
***************
*** 950,958 ****
  	}
  	if (!ast_mutex_lock(&monlock)) {
! 		if (monitor_thread > -1) {
  			pthread_cancel(monitor_thread);
  			pthread_join(monitor_thread, NULL);
  		}
! 		monitor_thread = -2;
  		ast_mutex_unlock(&monlock);
  	} else {
--- 951,959 ----
  	}
  	if (!ast_mutex_lock(&monlock)) {
! 		if (monitor_thread != (pthread_t) -1 && monitor_thread != (pthread_t) -2) {
  			pthread_cancel(monitor_thread);
  			pthread_join(monitor_thread, NULL);
  		}
! 		monitor_thread = (pthread_t) -2;
  		ast_mutex_unlock(&monlock);
  	} else {

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** chan_sip.c	5 Sep 2003 04:00:57 -0000	1.172
--- chan_sip.c	8 Sep 2003 16:48:06 -0000	1.173
***************
*** 5288,5292 ****
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {
--- 5288,5292 ----
  {
  	/* If we're supposed to be stopped -- stay stopped */
! 	if (monitor_thread == (pthread_t) -2)
  		return 0;
  	if (ast_mutex_lock(&monlock)) {
***************
*** 6141,6145 ****
  			pthread_join(monitor_thread, NULL);
  		}
! 		monitor_thread = -2;
  		ast_mutex_unlock(&monlock);
  	} else {
--- 6141,6145 ----
  			pthread_join(monitor_thread, NULL);
  		}
! 		monitor_thread = (pthread_t) -2;
  		ast_mutex_unlock(&monlock);
  	} else {




More information about the svn-commits mailing list