Merge branch 'master' into smgmaster

This commit is contained in:
Moises Silva 2011-01-27 18:22:57 -05:00
commit fb18da3a71
6 changed files with 33 additions and 20 deletions

0
libs/freetdm/cyginstall.sh Normal file → Executable file
View File

View File

@ -729,16 +729,24 @@ static void dump_mf(openr2_chan_t *r2chan)
snprintf(dfile, sizeof(dfile), logname ? "%s.s%dc%d.input.alaw" : "%s/s%dc%d.input.alaw", snprintf(dfile, sizeof(dfile), logname ? "%s.s%dc%d.input.alaw" : "%s/s%dc%d.input.alaw",
logname ? logname : r2data->logdir, ftdmchan->span_id, ftdmchan->chan_id); logname ? logname : r2data->logdir, ftdmchan->span_id, ftdmchan->chan_id);
f = fopen(dfile, "wb"); f = fopen(dfile, "wb");
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Dumping IO input in file %s\n", dfile); if (f) {
ftdm_channel_command(ftdmchan, FTDM_COMMAND_DUMP_INPUT, f); ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Dumping IO input in file %s\n", dfile);
fclose(f); ftdm_channel_command(ftdmchan, FTDM_COMMAND_DUMP_INPUT, f);
fclose(f);
} else {
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Could not dump IO input in file %s, error: %s", dfile, strerror(errno));
}
snprintf(dfile, sizeof(dfile), logname ? "%s.s%dc%d.output.alaw" : "%s/s%dc%d.output.alaw", snprintf(dfile, sizeof(dfile), logname ? "%s.s%dc%d.output.alaw" : "%s/s%dc%d.output.alaw",
logname ? logname : r2data->logdir, ftdmchan->span_id, ftdmchan->chan_id); logname ? logname : r2data->logdir, ftdmchan->span_id, ftdmchan->chan_id);
f = fopen(dfile, "wb"); f = fopen(dfile, "wb");
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Dumping IO output in file %s\n", dfile); if (f) {
ftdm_channel_command(ftdmchan, FTDM_COMMAND_DUMP_OUTPUT, f); ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Dumping IO output in file %s\n", dfile);
fclose(f); ftdm_channel_command(ftdmchan, FTDM_COMMAND_DUMP_OUTPUT, f);
fclose(f);
} else {
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Could not dump IO output in file %s, error: %s", dfile, strerror(errno));
}
} }
} }

View File

@ -1242,7 +1242,7 @@ static FIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms)
/* there is a bug in wanpipe where alarms were not properly set when they should be /* there is a bug in wanpipe where alarms were not properly set when they should be
* on at application startup, until that is fixed we check the link status here too */ * on at application startup, until that is fixed we check the link status here too */
ftdm_channel_command(ftdmchan, FTDM_COMMAND_GET_LINK_STATUS, &sangoma_status); ftdm_channel_command(ftdmchan, FTDM_COMMAND_GET_LINK_STATUS, &sangoma_status);
ftdmchan->alarm_flags = sangoma_status == FTDM_HW_LINK_DISCONNECTED ? 1 : 0; ftdmchan->alarm_flags = sangoma_status == FTDM_HW_LINK_DISCONNECTED ? FTDM_ALARM_RED : FTDM_ALARM_NONE;
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Link status is %d\n", sangoma_status); ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Link status is %d\n", sangoma_status);
} }
} }

View File

@ -838,11 +838,11 @@ typedef enum {
/*! \brief FreeTDM supported hardware alarms. */ /*! \brief FreeTDM supported hardware alarms. */
typedef enum { typedef enum {
FTDM_ALARM_NONE = 0, FTDM_ALARM_NONE = 0,
FTDM_ALARM_RED = (1 << 1), FTDM_ALARM_RED = (1 << 0),
FTDM_ALARM_YELLOW = (1 << 2), FTDM_ALARM_YELLOW = (1 << 1),
FTDM_ALARM_RAI = (1 << 3), FTDM_ALARM_RAI = (1 << 2),
FTDM_ALARM_BLUE = (1 << 4), FTDM_ALARM_BLUE = (1 << 3),
FTDM_ALARM_AIS = (1 << 5), FTDM_ALARM_AIS = (1 << 4),
FTDM_ALARM_GENERAL = (1 << 30) FTDM_ALARM_GENERAL = (1 << 30)
} ftdm_alarm_flag_t; } ftdm_alarm_flag_t;

View File

@ -178,18 +178,20 @@ typedef int ftdm_socket_t;
/*! \brief FreeTDM APIs possible return codes */ /*! \brief FreeTDM APIs possible return codes */
typedef enum { typedef enum {
FTDM_SUCCESS, /*!< Success */ FTDM_SUCCESS, /*!< Success */
FTDM_FAIL, /*!< Failure, generic error return code, use ftdm_channel_get_last_error or ftdm_span_get_last_error for details */ FTDM_FAIL, /*!< Failure, generic error return code when no more specific return code can be used */
FTDM_MEMERR, /*!< Memory error, most likely allocation failure */
FTDM_MEMERR, /*!< Allocation failure */
FTDM_ENOMEM = FTDM_MEMERR,
FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/ FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/
FTDM_ETIMEDOUT = FTDM_TIMEOUT,
FTDM_NOTIMPL, /*!< Operation not implemented */ FTDM_NOTIMPL, /*!< Operation not implemented */
FTDM_ENOSYS = FTDM_NOTIMPL, /*!< The function is not implemented */
FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */ FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */
/*!< Any new return codes should try to mimc unix style error codes, no need to reinvent */ /*!< Any new return codes should try to mimc unix style error codes, no need to reinvent */
/* Remapping some of the codes that were before */
FTDM_ENOMEM = FTDM_MEMERR, /*!< Memory error */
FTDM_ETIMEDOUT = FTDM_TIMEOUT, /*!< Operation timedout */
FTDM_ENOSYS = FTDM_NOTIMPL, /*!< The function is not implemented */
FTDM_EINVAL, /*!< Invalid argument */ FTDM_EINVAL, /*!< Invalid argument */
FTDM_ECANCELED, /*!< Operation cancelled */ FTDM_ECANCELED, /*!< Operation cancelled */
FTDM_EBUSY, /*!< Device busy */ FTDM_EBUSY, /*!< Device busy */

View File

@ -94,7 +94,10 @@
!strcasecmp(expr, "active") || \ !strcasecmp(expr, "active") || \
atoi(expr))) ? 1 : 0 atoi(expr))) ? 1 : 0
#ifdef WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <mmsystem.h>
#endif
#include <time.h> #include <time.h>
#ifndef __WINDOWS__ #ifndef __WINDOWS__