[svn-commits] nadi: trunk r40178 - /trunk/channels/chan_misdn.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Thu Aug 17 02:14:01 MST 2006
Author: nadi
Date: Thu Aug 17 04:14:01 2006
New Revision: 40178
URL: http://svn.digium.com/view/asterisk?rev=40178&view=rev
Log:
fixing the 64bit issue with misdn_l1_task.
Modified:
trunk/channels/chan_misdn.c
Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?rev=40178&r1=40177&r2=40178&view=diff
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Thu Aug 17 04:14:01 2006
@@ -259,6 +259,8 @@
/* the main schedule context for stuff like l1 watcher, overlap dial, ... */
static struct sched_context *misdn_tasks = NULL;
static pthread_t misdn_tasks_thread;
+
+static int *misdn_ports;
static void chan_misdn_log(int level, int port, char *tmpl, ...);
@@ -560,8 +562,8 @@
static int misdn_l1_task (void *data)
{
- misdn_lib_isdn_l1watcher((int)data);
- chan_misdn_log(5, (int)data, "L1watcher timeout\n");
+ misdn_lib_isdn_l1watcher(*(int *)data);
+ chan_misdn_log(5, *(int *)data, "L1watcher timeout\n");
return 1;
}
@@ -4465,7 +4467,8 @@
free(misdn_debug);
if (misdn_debug_only)
free(misdn_debug_only);
-
+ free(misdn_ports);
+
return 0;
}
@@ -4489,12 +4492,15 @@
g_config_initialized=1;
misdn_debug = (int *)malloc(sizeof(int) * (max_ports+1));
+ misdn_ports = (int *)malloc(sizeof(int) * (max_ports+1));
misdn_cfg_get( 0, MISDN_GEN_DEBUG, &misdn_debug[0], sizeof(int));
- for (i = 1; i <= max_ports; i++)
+ for (i = 1; i <= max_ports; i++) {
misdn_debug[i] = misdn_debug[0];
+ misdn_ports[i] = i;
+ }
+ *misdn_ports = 0;
misdn_debug_only = (int *)calloc(max_ports + 1, sizeof(int));
-
{
char tempbuf[BUFFERSIZE+1];
misdn_cfg_get( 0, MISDN_GEN_TRACEFILE, tempbuf, BUFFERSIZE);
@@ -4584,7 +4590,7 @@
misdn_cfg_get(port, MISDN_CFG_L1_TIMEOUT, &l1timeout, sizeof(l1timeout));
if (l1timeout) {
chan_misdn_log(4, 0, "Adding L1watcher task: port:%d timeout:%ds\n", port, l1timeout);
- misdn_tasks_add(l1timeout * 1000, misdn_l1_task, (void*)port);
+ misdn_tasks_add(l1timeout * 1000, misdn_l1_task, &misdn_ports[port]);
}
}
More information about the svn-commits
mailing list