mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 13:28:31 +00:00
Merge remote branch 'fsorig/master'
Conflicts: libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c
This commit is contained in:
commit
7e31b9cc28
300 files changed
+15500
-6153
No files matched your search
@@ -184,9 +184,9 @@ endif
|
||||
if HAVE_LIBPRI
|
||||
mod_LTLIBRARIES += ftmod_libpri.la
|
||||
ftmod_libpri_la_SOURCES = $(SRC)/ftmod/ftmod_libpri/ftmod_libpri.c $(SRC)/ftmod/ftmod_libpri/lpwrap_pri.c
|
||||
ftmod_libpri_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS)
|
||||
ftmod_libpri_la_LDFLAGS = -shared -module -avoid-version -lpri
|
||||
ftmod_libpri_la_LIBADD = libfreetdm.la
|
||||
ftmod_libpri_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) $(LIBPRI_CPPFLAGS)
|
||||
ftmod_libpri_la_LDFLAGS = -shared -module -avoid-version $(LIBPRI_LDFLAGS)
|
||||
ftmod_libpri_la_LIBADD = libfreetdm.la $(LIBPRI_LIBS)
|
||||
endif
|
||||
|
||||
if HAVE_PRITAP
|
||||
@@ -251,7 +251,7 @@ endif
|
||||
if HAVE_MISDN
|
||||
mod_LTLIBRARIES += ftmod_misdn.la
|
||||
ftmod_misdn_la_SOURCES = $(SRC)/ftmod/ftmod_misdn/ftmod_misdn.c
|
||||
ftmod_misdn_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) $(MISDN_CFLAGS)
|
||||
ftmod_misdn_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) $(MISDN_CFLAGS) -D_GNU_SOURCE
|
||||
ftmod_misdn_la_LDFLAGS = -shared -module -avoid-version
|
||||
ftmod_misdn_la_LIBADD = libfreetdm.la
|
||||
endif
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
m4_include([build/ax_compiler_vendor.m4])
|
||||
m4_include([build/libpcap.m4])
|
||||
+36
-11
@@ -54,7 +54,7 @@ fi
|
||||
|
||||
AC_SUBST([confdir])
|
||||
|
||||
DEFAULT_INCLUDES="-I. -I./src/include -I$(srcdir)"
|
||||
DEFAULT_INCLUDES="-I. -I./src/include -I\$(srcdir)"
|
||||
AC_SUBST([DEFAULT_INCLUDES])
|
||||
|
||||
# Where to install the modules
|
||||
@@ -194,28 +194,46 @@ AM_CONDITIONAL([HAVE_OPENR2], [test "${HAVE_OPENR2}" = "yes"])
|
||||
#
|
||||
HAVE_LIBPRI="no"
|
||||
AC_ARG_WITH([libpri],
|
||||
[AS_HELP_STRING([--with-libpri], [Install ftmod_libpri])],
|
||||
[AS_HELP_STRING([--with-libpri@<:@=PREFIX@:>@], [Install ftmod_libpri])],
|
||||
[case "${withval}" in
|
||||
no) enable_libpri="no" ;;
|
||||
*) enable_libpri="yes" ;;
|
||||
no|yes) with_libpri="${withval}" ;;
|
||||
*) AS_IF([test -d "${withval}"],
|
||||
[with_libpri="${withval}"],
|
||||
[AC_MSG_ERROR([Invalid argument for --with-libpri, \"${withval}\" is not a directory])]
|
||||
) ;;
|
||||
esac],
|
||||
[enable_libpri="no"]
|
||||
[with_libpri="no"]
|
||||
)
|
||||
if test "${enable_libpri}" != "no"
|
||||
if test "x${with_libpri}" != "xno"
|
||||
then
|
||||
save_LIBS="${LIBS}"
|
||||
save_CPPFLAGS="${CPPFLAGS}"
|
||||
save_LDFLAGS="${LDFLAGS}"
|
||||
|
||||
LIBPRI_CPPFLAGS=""
|
||||
LIBPRI_LDFLAGS=""
|
||||
|
||||
AC_MSG_RESULT([${as_nl}<<>> Digium libpri])
|
||||
|
||||
save_LIBS="${LIBS}"
|
||||
AS_IF([test "x${with_libpri}" != "xyes"],
|
||||
[LIBPRI_CPPFLAGS="-I${with_libpri}/include"
|
||||
LIBPRI_LDFLAGS="-L${with_libpri}/lib"],
|
||||
)
|
||||
|
||||
LDFLAGS="${save_LDFLAGS} ${LIBPRI_LDFLAGS}"
|
||||
CPPFLAGS="${save_CPPFLAGS} ${LIBPRI_CPPFLAGS}"
|
||||
LIBS="${LIBS} -lpri"
|
||||
|
||||
AC_MSG_CHECKING([whether libpri is usable])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <libpri.h>],
|
||||
[const char *version = pri_get_version();]
|
||||
)],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
HAVE_LIBPRI="yes"],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([libpri is not installed or unusable (see config.log for details)])]
|
||||
AC_MSG_ERROR([libpri not found or unusable (see config.log for details)])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether libpri has BRI support])
|
||||
@@ -241,10 +259,17 @@ then
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_NOTICE([You will need libpri-1.4.12_beta1 or newer for AOC event support])]
|
||||
)
|
||||
|
||||
# libpri is available, set variables for Makefile(.am)
|
||||
AC_SUBST([LIBPRI_LIBS], [-lpri])
|
||||
AC_SUBST([LIBPRI_LDFLAGS])
|
||||
AC_SUBST([LIBPRI_CPPFLAGS])
|
||||
|
||||
LIBS="${save_LIBS}"
|
||||
LDFLAGS="${save_LDFLAGS}"
|
||||
CPPFLAGS="${save_CPPFLAGS}"
|
||||
fi
|
||||
HAVE_LIBPRI="${enable_libpri}"
|
||||
AM_CONDITIONAL([HAVE_LIBPRI],[test "${enable_libpri}" = "yes"])
|
||||
AM_CONDITIONAL([HAVE_LIBPRI],[test "x${HAVE_LIBPRI}" = "xyes"])
|
||||
|
||||
##
|
||||
# Sangoma Wanpipe
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../src/isdn/include"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../../curl/include;../src/isdn/include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -126,7 +126,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../src/isdn/include"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../../curl/include;../src/isdn/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -210,7 +210,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../src/isdn/include"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../../curl/include;../src/isdn/include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -292,7 +292,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../src/isdn/include"
|
||||
AdditionalIncludeDirectories="../../../src/include;../src/include;../../curl/include;../src/isdn/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../../curl/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@@ -117,7 +117,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../../curl/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
@@ -148,7 +148,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../../curl/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@@ -177,7 +177,7 @@
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../../src/include;../src/include;../../curl/include;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
|
||||
@@ -507,7 +507,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
|
||||
const char *name = NULL;
|
||||
int span_id = 0;
|
||||
int chan_id = 0;
|
||||
int t = 0;
|
||||
uint32_t t = 0;
|
||||
uint32_t tokencnt;
|
||||
char *uuid = NULL;
|
||||
const char *token = NULL;
|
||||
@@ -2317,7 +2317,6 @@ static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_DEAD);
|
||||
channel = switch_core_session_get_channel(session);
|
||||
switch_channel_hangup(channel, caller_data->hangup_cause);
|
||||
ftdm_channel_clear_token(sigmsg->channel, switch_core_session_get_uuid(session));
|
||||
switch_core_session_rwunlock(session);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3969,7 +3969,9 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_process_media(ftdm_channel_t *ftdmchan, v
|
||||
if (ftdmchan->state == FTDM_CHANNEL_STATE_CALLWAITING && (digit_char == 'D' || digit_char == 'A')) {
|
||||
ftdmchan->detected_tones[FTDM_TONEMAP_CALLWAITING_ACK]++;
|
||||
} else {
|
||||
char digit_str[2] = { digit_char, 0};
|
||||
char digit_str[2] = { 0 };
|
||||
|
||||
digit_str[0] = digit_char;
|
||||
|
||||
if (!ftdmchan->span->sig_dtmf || (ftdmchan->span->sig_dtmf(ftdmchan, (const char*)digit_str) != FTDM_BREAK)) {
|
||||
ftdm_channel_queue_dtmf(ftdmchan, digit_str);
|
||||
|
||||
@@ -310,9 +310,7 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, ftdm_libpri_usage);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 2) {
|
||||
} else if (argc == 2) {
|
||||
if (!strcasecmp(argv[0], "kill")) {
|
||||
int span_id = atoi(argv[1]);
|
||||
ftdm_span_t *span = NULL;
|
||||
@@ -321,7 +319,8 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
ftdm_libpri_data_t *isdn_data = span->signal_data;
|
||||
|
||||
if (span->start != ftdm_libpri_start) {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR '%s' is not a libpri span.\n",
|
||||
__FILE__, ftdm_span_get_name(span));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -329,13 +328,12 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, "%s: +OK killed.\n", __FILE__);
|
||||
goto done;
|
||||
} else {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR span '%s' not found.\n",
|
||||
__FILE__, argv[0]);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
} else if (argc >= 2) {
|
||||
if (!strcasecmp(argv[0], "debug")) {
|
||||
ftdm_span_t *span = NULL;
|
||||
|
||||
@@ -344,7 +342,8 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
uint32_t flags = 0;
|
||||
|
||||
if (span->start != ftdm_libpri_start) {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR '%s' is not a libpri span.\n",
|
||||
__FILE__, ftdm_span_get_name(span));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -364,7 +363,8 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, "%s: +OK debug %s.\n", __FILE__, (flags) ? "enabled" : "disabled");
|
||||
goto done;
|
||||
} else {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR span '%s' not found.\n",
|
||||
__FILE__, argv[0]);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -372,8 +372,10 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
ftdm_span_t *span = NULL;
|
||||
if (ftdm_span_find_by_name(argv[1], &span) == FTDM_SUCCESS) {
|
||||
ftdm_libpri_data_t *isdn_data = span->signal_data;
|
||||
|
||||
if (span->start != ftdm_libpri_start) {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR '%s' is not a libpri span.\n",
|
||||
__FILE__, ftdm_span_get_name(span));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -381,7 +383,8 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, "%s: +OK reset.\n", __FILE__);
|
||||
goto done;
|
||||
} else {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR span '%s' not found.\n",
|
||||
__FILE__, argv[0]);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -389,8 +392,10 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
ftdm_span_t *span = NULL;
|
||||
if (ftdm_span_find_by_name(argv[1], &span) == FTDM_SUCCESS) {
|
||||
ftdm_libpri_data_t *isdn_data = span->signal_data;
|
||||
|
||||
if (span->start != ftdm_libpri_start) {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR '%s' is not a libpri span.\n",
|
||||
__FILE__, ftdm_span_get_name(span));
|
||||
goto done;
|
||||
}
|
||||
if (!strcasecmp(argv[2], "all")) {
|
||||
@@ -405,7 +410,8 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, "%s: +OK restart set.\n", __FILE__);
|
||||
goto done;
|
||||
} else {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR span '%s' not found.\n",
|
||||
__FILE__, argv[0]);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -413,8 +419,10 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
ftdm_span_t *span = NULL;
|
||||
if (ftdm_span_find_by_name(argv[1], &span) == FTDM_SUCCESS) {
|
||||
ftdm_libpri_data_t *isdn_data = span->signal_data;
|
||||
|
||||
if (span->start != ftdm_libpri_start) {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR '%s' is not a libpri span.\n",
|
||||
__FILE__, ftdm_span_get_name(span));
|
||||
goto done;
|
||||
}
|
||||
if (!isdn_data->service_message_support) {
|
||||
@@ -433,11 +441,15 @@ static FIO_API_FUNCTION(ftdm_libpri_api)
|
||||
stream->write_function(stream, "%s: +OK change status set.\n", __FILE__);
|
||||
goto done;
|
||||
} else {
|
||||
stream->write_function(stream, "%s: -ERR invalid span.\n", __FILE__);
|
||||
stream->write_function(stream, "%s: -ERR span '%s' not found.\n",
|
||||
__FILE__, argv[0]);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
/* zero args print usage */
|
||||
stream->write_function(stream, ftdm_libpri_usage);
|
||||
goto done;
|
||||
}
|
||||
|
||||
stream->write_function(stream, "%s: -ERR invalid command.\n", __FILE__);
|
||||
@@ -1165,7 +1177,7 @@ static int on_proceeding(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_
|
||||
|
||||
if (chan) {
|
||||
/* Open channel if inband information is available */
|
||||
if (pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) {
|
||||
if (pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE || pevent->proceeding.progressmask & PRI_PROG_CALL_NOT_E2E_ISDN) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
@@ -1207,7 +1219,7 @@ static int on_progress(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ev
|
||||
|
||||
if (chan) {
|
||||
/* Open channel if inband information is available */
|
||||
if (pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) {
|
||||
if (pevent->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE || pevent->proceeding.progressmask & PRI_PROG_CALL_NOT_E2E_ISDN) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "-- In-band information available, B-Channel %d:%d\n",
|
||||
ftdm_channel_get_span_id(chan),
|
||||
ftdm_channel_get_id(chan));
|
||||
|
||||
@@ -547,7 +547,7 @@ static void handle_pri_passive_event(pritap_t *pritap, pri_event *e)
|
||||
break;
|
||||
|
||||
case PRI_EVENT_PROGRESS:
|
||||
crv = tap_pri_get_crv(pritap->pri, e->ring.call);
|
||||
crv = tap_pri_get_crv(pritap->pri, e->proceeding.call);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Progress on channel %s:%d:%d with callref %d\n",
|
||||
pritap->span->name, PRI_SPAN(e->proceeding.channel), PRI_CHANNEL(e->proceeding.channel), crv);
|
||||
break;
|
||||
|
||||
@@ -897,12 +897,19 @@ int16_t sngisdn_rcv_l1_data_req(uint16_t spId, sng_l1_frame_t *l1_frame)
|
||||
do {
|
||||
flags = FTDM_WRITE;
|
||||
status = signal_data->dchan->fio->wait(signal_data->dchan, &flags, 1000);
|
||||
if (status != FTDM_SUCCESS) {
|
||||
ftdm_log_chan_msg(signal_data->dchan, FTDM_LOG_WARNING, "transmit timed-out\n");
|
||||
return -1;
|
||||
switch(status) {
|
||||
case FTDM_SUCCESS:
|
||||
break;
|
||||
case FTDM_TIMEOUT:
|
||||
continue;
|
||||
case FTDM_FAIL:
|
||||
default:
|
||||
ftdm_log_chan_msg(signal_data->dchan, FTDM_LOG_WARNING, "failed to poll for channel\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* status = FTDM_SUCCESS */
|
||||
if ((flags & FTDM_WRITE)) {
|
||||
#if 0
|
||||
int i;
|
||||
@@ -993,7 +1000,9 @@ void sngisdn_rcv_sng_log(uint8_t level, char *fmt,...)
|
||||
ftdm_log(FTDM_LOG_DEBUG, "sng_isdn->%s\n", data);
|
||||
break;
|
||||
case SNG_LOGLEVEL_WARN:
|
||||
ftdm_log(FTDM_LOG_INFO, "sng_isdn->%s\n", data);
|
||||
if ( strncmp(data, "Invalid Q.921/Q.931 frame", 25) ) {
|
||||
ftdm_log(FTDM_LOG_INFO, "sng_isdn->%s", data);
|
||||
}
|
||||
break;
|
||||
case SNG_LOGLEVEL_INFO:
|
||||
ftdm_log(FTDM_LOG_INFO, "sng_isdn->%s\n", data);
|
||||
|
||||
@@ -567,7 +567,7 @@ ftdm_status_t set_calling_num2(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb)
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
|
||||
string = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "isdn.cg_pty2.digits");
|
||||
if ((string == NULL) || !(*string)) {
|
||||
if (ftdm_strlen_zero(string)) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
@@ -696,16 +696,26 @@ ftdm_status_t set_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb)
|
||||
ftdm_status_t set_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt)
|
||||
{
|
||||
uint8_t len;
|
||||
const char *string = NULL;
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
ftdm_bool_t force_send_cid_name = FTDM_FALSE;
|
||||
|
||||
|
||||
len = strlen(caller_data->cid_name);
|
||||
if (!len) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
if (signal_data->send_cid_name == SNGISDN_OPT_FALSE) {
|
||||
string = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "isdn.send_cid_name");
|
||||
if (!ftdm_strlen_zero(string)) {
|
||||
if (!strcasecmp(string, "no")) {
|
||||
return FTDM_SUCCESS;
|
||||
} else if (!strcasecmp(string, "yes")) {
|
||||
force_send_cid_name = FTDM_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (force_send_cid_name == FTDM_FALSE && signal_data->send_cid_name == SNGISDN_OPT_FALSE) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -758,7 +768,7 @@ ftdm_status_t set_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad)
|
||||
{
|
||||
const char* clg_subaddr = NULL;
|
||||
clg_subaddr = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "isdn.calling_subaddr");
|
||||
if ((clg_subaddr != NULL) && (*clg_subaddr)) {
|
||||
if (!ftdm_strlen_zero(clg_subaddr)) {
|
||||
unsigned len = strlen (clg_subaddr);
|
||||
cgPtySad->eh.pres = PRSNT_NODEF;
|
||||
cgPtySad->typeSad.pres = 1;
|
||||
|
||||
@@ -256,7 +256,7 @@ static void zt_build_gains(struct zt_gains *g, float rxgain, float txgain, int c
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Initialises a range of ftdmtel channels
|
||||
* \brief Initialises a range of Zaptel/DAHDI channels
|
||||
* \param span FreeTDM span
|
||||
* \param start Initial wanpipe channel number
|
||||
* \param end Final wanpipe channel number
|
||||
@@ -349,7 +349,7 @@ static unsigned zt_open_range(ftdm_span_t *span, unsigned start, unsigned end, f
|
||||
}
|
||||
|
||||
if (ioctl(CONTROL_FD, codes.CHANCONFIG, &cc)) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "this ioctl fails on older ftdmtel but is harmless if you used ztcfg\n[device %s chan %d fd %d (%s)]\n", chanpath, x, CONTROL_FD, strerror(errno));
|
||||
ftdm_log(FTDM_LOG_WARNING, "this ioctl fails in older zaptel but is harmless if you used ztcfg\n[device %s chan %d fd %d (%s)]\n", chanpath, x, CONTROL_FD, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ static unsigned zt_open_range(ftdm_span_t *span, unsigned start, unsigned end, f
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Initialises an freetdm ftdmtel span from a configuration string
|
||||
* \brief Initialises a freetdm Zaptel/DAHDI span from a configuration string
|
||||
* \param span FreeTDM span
|
||||
* \param str Configuration string
|
||||
* \param type FreeTDM span type
|
||||
@@ -523,7 +523,7 @@ static FIO_CONFIGURE_SPAN_FUNCTION(zt_configure_span)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Process configuration variable for a ftdmtel profile
|
||||
* \brief Process configuration variable for a Zaptel/DAHDI profile
|
||||
* \param category Wanpipe profile name
|
||||
* \param var Variable name
|
||||
* \param val Variable value
|
||||
@@ -601,7 +601,7 @@ static FIO_CONFIGURE_FUNCTION(zt_configure)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Opens a ftdmtel channel
|
||||
* \brief Opens a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to open
|
||||
* \return Success or failure
|
||||
*/
|
||||
@@ -671,7 +671,7 @@ static FIO_OPEN_FUNCTION(zt_open)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Closes ftdmtel channel
|
||||
* \brief Closes Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to close
|
||||
* \return Success
|
||||
*/
|
||||
@@ -689,7 +689,7 @@ static FIO_CLOSE_FUNCTION(zt_close)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Executes an FreeTDM command on a ftdmtel channel
|
||||
* \brief Executes a FreeTDM command on a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to execute command on
|
||||
* \param command FreeTDM command to execute
|
||||
* \param obj Object (unused)
|
||||
@@ -870,7 +870,7 @@ static FIO_COMMAND_FUNCTION(zt_command)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Gets alarms from a ftdmtel Channel
|
||||
* \brief Gets alarms from a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to get alarms from
|
||||
* \return Success or failure
|
||||
*/
|
||||
@@ -893,7 +893,7 @@ static FIO_GET_ALARMS_FUNCTION(zt_get_alarms)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Waits for an event on a ftdmtel channel
|
||||
* \brief Waits for an event on a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to open
|
||||
* \param flags Type of event to wait for
|
||||
* \param to Time to wait (in ms)
|
||||
@@ -967,7 +967,7 @@ pollagain:
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Checks for events on a ftdmtel span
|
||||
* \brief Checks for events on a Zaptel/DAHDI span
|
||||
* \param span Span to check for events
|
||||
* \param ms Time to wait for event
|
||||
* \return Success if event is waiting or failure if not
|
||||
@@ -1164,7 +1164,7 @@ FIO_CHANNEL_NEXT_EVENT_FUNCTION(zt_channel_next_event)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieves an event from a ftdmtel span
|
||||
* \brief Retrieves an event from a Zaptel/DAHDI span
|
||||
* \param span Span to retrieve event from
|
||||
* \param event FreeTDM event to return
|
||||
* \return Success or failure
|
||||
@@ -1204,7 +1204,7 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Reads data from a ftdmtel channel
|
||||
* \brief Reads data from a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to read from
|
||||
* \param data Data buffer
|
||||
* \param datalen Size of data buffer
|
||||
@@ -1246,7 +1246,7 @@ static FIO_READ_FUNCTION(zt_read)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Writes data to a ftdmtel channel
|
||||
* \brief Writes data to a Zaptel/DAHDI channel
|
||||
* \param ftdmchan Channel to write to
|
||||
* \param data Data buffer
|
||||
* \param datalen Size of data buffer
|
||||
@@ -1285,7 +1285,7 @@ tryagain:
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Destroys a ftdmtel Channel
|
||||
* \brief Destroys a Zaptel/DAHDI Channel
|
||||
* \param ftdmchan Channel to destroy
|
||||
* \return Success
|
||||
*/
|
||||
@@ -1298,12 +1298,12 @@ static FIO_CHANNEL_DESTROY_FUNCTION(zt_channel_destroy)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Global FreeTDM IO interface for ftdmtel
|
||||
* \brief Global FreeTDM IO interface for Zaptel/DAHDI
|
||||
*/
|
||||
static ftdm_io_interface_t zt_interface;
|
||||
|
||||
/**
|
||||
* \brief Loads ftdmtel IO module
|
||||
* \brief Loads Zaptel/DAHDI IO module
|
||||
* \param fio FreeTDM IO interface
|
||||
* \return Success or failure
|
||||
*/
|
||||
@@ -1358,7 +1358,7 @@ static FIO_IO_LOAD_FUNCTION(zt_init)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Unloads ftdmtel IO module
|
||||
* \brief Unloads Zaptel/DAHDI IO module
|
||||
* \return Success
|
||||
*/
|
||||
static FIO_IO_UNLOAD_FUNCTION(zt_destroy)
|
||||
@@ -1369,7 +1369,7 @@ static FIO_IO_UNLOAD_FUNCTION(zt_destroy)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief FreeTDM ftdmtel IO module definition
|
||||
* \brief FreeTDM Zaptel/DAHDI IO module definition
|
||||
*/
|
||||
ftdm_module_t ftdm_module = {
|
||||
"zt",
|
||||
|
||||
Reference in new issue
Block a user